Dec. 13th, 2014

juan_gandhi: (VP)
Как хорошо в шарашке

ученые на марше


– У нас в клубе есть кабинет с доступом в Интернет. Там сейчас ремонт, и его пока не завершили. Вся работа по теме – только в рабочие дни.

– Книги, статьи, распечатанные из Интернета, если посмотреть, можно у каждого в тумбочке найти. На выходных их читаем.

-Пятница – это день боевой подготовки. С утра у нас 5 часов занятий, затем обед и послеобеденный сон. В остальной армии такой сон каждый день, но на заводе спать не с руки, поэтому у нас он только по пятницам. Да и спать на заводе не хочется. Если кому-то спать не хочется, то обычно читаем книги, научные статьи. За год мы три раза выезжали на стрельбище. Также проводятся занятия по военно-медицинской подготовке, по РХБЗ, по военной топографии, основам пожаротушения, военной экологии, иным дисциплинам.

– На завод мы на автобусах добираемся, за нами присылают. Ребята, которые в НИИЦ работают, чуть раньше выезжают из-за пробок. В 9 часов мы прибываем на завод. 10–15 минут перерыв. И где-то в 9.10 мы приступаем к занятиям. В конце каждого часа 10 минут перерыв, поскольку работа за компьютером. Есть регламентные нормы по тому, сколько человек должен непрерывно находиться за компьютером, не отрывая глаз от монитора. Каждый час – 10 минут перерыва. Пожалуйста. Спокойно вышел, там кофейные автоматы стоят, курилка, если кто-то курит. В 14 часов обед, дружно, с песней, как говорится. Ну, не всегда с песней, конечно.
juan_gandhi: (VP)
Пока что не решил еще, что делать дальше.
Но взгляды на жизнь меняются.
juan_gandhi: (VP)
На самом деле я стараюсь не иметь дела с людьми, которые Антона Москаля держат в друзьях.

В конце концов, друг человека, обещающего убить меня и моих детей, вряд ли может быть мне другом.
juan_gandhi: (VP)
1. Scala is a mixed object-oriented and functional language. You are free to mix these two features as long as you can explain how it works.
2. Ideally, your code should take care of all possible outcomes. Imagine, it throws an IndexOutOfBounds exception, and somewhere up the food chain some kind of client has to figure out who was it that went outside the range of its data, and why, and what can be done about it, except writing something to the log, so that admins send an email to a manager, and the managers bugs the developer, a day or two later. And you will be scratching your head: who was that bad guy that gave you an empty array when you so desperately needed the array's first element. Since you already know this can happen, you can add the code that takes care of this.
3. Do not:
- use nulls (ask me if you don't know how);
- use vars (ask me if you don't know how);
- introduce setters and getters;
- use mutables (ask me if you don't know how);
- throw exceptions (ask me if you don't know how);
- write methods more than 50 lines long (ideally, more than 14 lines long);
- think this is java;
- hesitate to use more space characters than compiler wants you to;
- except in rare occasions, use indexes of lists, even writing list(0) is bad;
- except for very technical reasons, use length

4. The following are pairs of distinct entities:
- sets and lists;
- order and sequence;
- maps and lists of pairs
5. The code you write will be read by compiler and by your colleague.
5.1. To make compiler's life easy, you can specify the types of your values and functions; it's a known fact that scalac runs faster when types are specified.
5.2. The same applies to your colleagues: if the type of a value is explicitly written (and not obvious otherwise), they'll feel more comfortable;
5.3. Introduce intermediate variables with good names: your compiler may need them, your colleague too.
5.4. Make methods do just one thing.
5.5. There are two kinds of zero-parameter methods: those that just return something with no side effect, and those that mostly just have a side effect, e.g. myInvestment.currentValue vs myInvestment.rebalance().
6. A function that returns a function is okay, it's called currying, and it may also save your cycles (as if anybody cares these days).
7. Your code is a piece of graphic art, although it's just an ASCII art; the more space characters, the more readable it is.
8. The line length... it's up to you, but remember, others are trying to read your masterpiece.
9. Nobody reads documentation or comments these days. So a self-explanatory code makes a lot of sense.
10. Within a project, it may make sense to use the established naming conveniences, coding style and libraries... on the other hand, if we did that, we would be still coding in machine codes and sitting around fire in the caves.
11. Learn local libraries.
12. If you don't know how to write unittests in Scala, drop everything and learn it first. Hardly any of your code makes any sense (even if you believe it does) if there are no tests that prove it (to others; we know you trust yourself). Test frameworks used may vary from project to project; it's a stupid idea to have two frameworks in one project.
13. DRY. Abstraction is your friend.
14. The only true law is that which leads to freedom.


=============
Suggestions?

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 25th, 2025 02:30 am
Powered by Dreamwidth Studios