• What to read #23

    The last time I had to skip the rubric. Here are a couple of more links to compensate that:

  • Do's and Don'ts

    Here is a short list of rules I try to follow when working:

    Database

    • Avoid using nullable fields in your DB. Put not null everywhere you can when defining a table. Assign a default blank value if submitting a field is not necessary:

      create table foo (
        ...
        comment text not null default '',
        count integer not null default 0
      );
      
    • Keep your database migrations in raw *.sql files. Wrap each migration into transaction explicitly putting begin; and at the top of file and commit; at the bottom:

      --
      -- A short comment about what this migration does.
      --
      begin;
      
      update foo set bar = 42 where id = 100500;
      
      alter table baz drop column test;
      
      commit;
      
    • Don’t delete anything from your DB. Add deleted boolean flag that is false by default and put AND NOT mytable.deleted in WHERE or JOIN statements:

      select * from foo where not deleted;
      
      select *.f, *.b
      from foo f
      left join bar b on foo.bar_id = b.id and not b.deleted;
      
    • For each table, add created_at that fixates creation time automatically:

      create table foo (
        ...
        created_at timestamp not null default current_timestamp;
      );
      
    • Once you’ve got any geographical data (locations, areas, routes), install PostGIS extension without inventing your own “smart” algorithms. They will let you down one Friday evening.

    • Postgres is great for full-text searching. Try to deal with standard PostgreSQL capabilities before installing Elastic, Sphinx and related stuff.

    • Avoid using ORMs. A small wrapper that parses *.sql files and creates plain functions would be enough.

    • Don’t use triggers to implement business logic. Such behaviour is quite implicit and difficult to maintain. And business rules change all the time.

    Code

    • Don’t align you code with spaces like it’s shown below. Use one space only.

      foo = {
        "short":              1,
        "a-bit-longer":       2,
        "very-very-long-one": 3,
      }
      
    • Write unit tests for both server and UI sides immediately once you’ve started a new project.

    • Classes are not data. Prefer plain data structures like lists and maps over classes. Usually, structures are fast and covers the most of requirements.

    • Try to follow functional approach when develop a program. Avoid keeping state where it can be skipped. Separate IO from code that does pure calculations.

    Frontend

    • Don’t use vanilla Javascript. Use such modern technologies as ClojureScript, TypeScrip or Elm to develop without pain in the ass. Consider JS as necessary evil running under the hood to ship your application.

    • Don’t make SAPs (single page applications). Usually they work poorly, the layout leaks, you cannot open a link in a new window and they break W3C standards.

    • Even with Javascript turned off, your client must see important information on their screen.

    • Don’t make you own widgets to substitute standard ones (inputs, drop-downs, etc).

    • Never interrupt a user with alerts, pop-ups, splashes.

    • Never claim on Ad-Block enabled. It’s so ridiculous. It’s users choice what software to use when browsing the Internet.

    Architecture

    • Don’t make micro-services. Try to keep the whole codebase within. Run different domains of your application in separate threads as components.

    • Queues might help a lot. Don’t invent your own message queue facility. Use Rabbit, ZeroMQ or even Redis.

    • For message processing, use text format but not binary one. You are not Google with their proto-bufs invented to break down network limitations.

    • Writing logs in a file and tailing them via SSH is a mess. Write all the logs into (remote) syslog, either your own one or any third-party one. Syslog brings huge capabilities with logs processing.

    • Never commit to master branch directly (set that option in your Git config). Use the simplest Git pipeline you can imagine:

      master -> feature-branch -> commits -> pull request -> review -> merge
      
    • JSON is bad when configuring software: lots of braces, no comments. Take YAML.

    Programming languages

    • Prefer those languages that could give you a single compiled file as a result of you effort (both binary or bytecode). C-family, Go, Rust, Haskell, Java-family are OK. PHP, Python, Ruby, Perl, JavaScript are less OK.

    • Take a look at functional languages even you don’t have intentions using them in your daily work.

    • You’d better try not modern languages but rather old ones. Smalltalk, Lisp, OCaml would be a great choice.

    Workspace

    • Keep you desktop free from unused items.

    • The more gadgets you need having around the less you are productive. Ideally, you only need your Mac connected to the Internet.

    • Use messagers on mobile only except those you need to communicate with your customer. On my desktop, I have only Slask running with my customer’s room. Leave Telegram, Skype, WhatsApp or whatever else on you phone and check them rarely.

    • Turn off all the notifications on you phone/desktop.

    • Try to keep you developing tools simple. Choose text editor like Vim or Emacs over IDE. Work with Git from a command line.

    • Don’t work in open-space. A room with 3-4 people around is OK.

    • Don’t read the news. Your friends will warn you if something really important happens.

    Communication

    • Don’t argue on Vim vs Emacs, Python vs Ruby and so on. It looks quite unprofessional.

    • If you full of thoughts you want to share with the world, open a blog or write a book. But never argue on them in social networks or messagers.

    • Even you are a remote worker, say Hi and Bye every time you’ve started or finished your work day. Your team should know whether are you at the desk or not.

    • Be always polite.

    • When you don’t know what to say, keep silence.

    • Never afraid saying No.

    • Read about negotiations.

    • Invest time and money in improving your English skills.

    This post is a snapshot of my Do’s And Don’ts repository. You may always find updates there.

  • English

    Disclaimer: this post just shapes my opinion on how to become better in English. I’m not forcing anyone to follow the way I describe here. There are no links, promo-codes, Skype contacts, etc to share. I believe you may google them by yourself. The text given below is rather random advise that I consider to be useful. I admit it could look a bit weird to you or even wrong, but I don’t care.

    You may notice I’ve been blogging in English for the last two month. That is not because I’m so good at it. I’m really far away from reckoning myself as a confident English speaker. The auditory of this blog are native Russian speakers in most. So why switching then?

    Well, I consider writing in English as additional effort to learn it.

    Switching to another language also shifts something in your mind, I bet. It’s not as simple as I wish, though. When write English posts, I often feel I sound unnatural and the sentence looks artificial. Sometimes, I cannot find a proper word to ship the idea with all its details.

    In that post, I’m going to share a set of advise for those who just started learning English. I’d like somebody gave me a hand several years ago. These are just my opinion, though. Following them is up to you.

    First, you agree that English is quite important. All the new materials nowadays appear in English-speaking communities first. Blog posts, articles, documentation, talks… It would take a long time before they come into Russian- or any other Cyrillic-speaking group being translated poorly. Why wait for such long?

    Books? I’m feeling sad saying this, but I’ve stopped buying Russian IT books for now. Usually they are outdated: up to decade of years might pass since the original edition was issued. It’s OK though when you are interested in particular academic knowledge or algorithms, O-complexity and everything that has not been altered for years. For example, there are some quite good books on C and Pascal in Russian.

    But usually our books are made of extremely bad quality. They are issued with lots of typos and missing spaces in the text. Even MS Word auto-correction could indicate most of them. The page layout is terrible: thin margins, weird font, large gaps or tunnels in paragraphs. Paperback’s quality is low. Opening such a book twice breaks it in the middle on two half. Agrrr!

    For the last year, I’ve been reading SICP in Russian edition. It suffers from all the issues I covered above. I’m finishing it on Kindle nowadays.

    Working with foreign customers brings more income. It also makes you more independent and opens world-wide opportunities. Read my previous post on remote working.

    I’m sure I was convincing on telling the reasons you should learn English. Now we may focus on steps required.

    Start with something simple: enable English language whenever you can. In your phone, computer or a tablet. Choose English over your mother tongue in video games or series. It is really a pleasure to listen to the original voices rather than localized ones, even made with high quality.

    Attend to English class at work. I’ve been learning English in a small group of 6 at my previous job and it was a great experience. Small groups are great and the learning process is quite effective. Having few people around means you may count on having enough time to perform over the group.

    No English group in you office? You could always organize it by yourself. I believe you may find colleagues who also want to learn it. All together, come to your head department and discuss an option to hire an English teacher at your office. Don’t expect your boss will agree at once. Be ready to share the price within all the members. It’s for your interests all in all, not for your boss. There is only one man interested in your career. You are.

    There is a wide-spreaded myth that only a native speaker could be a good teacher. That’s totally wrong. I’ve been thinking the same way for a long time. I confess it could prevent you from meeting a really good teacher.

    Remember, even a great pronunciation does not make a person a good tutor. A good one is interested in correcting your mistakes and giving useful advise. Instead, a good native-speaker who does not have any teaching experience is not interested in correcting your English. You may say something with terrible mistakes, but your teacher will just reply “Wow cool!”. Such a way of having lessons does not give a result.

    I used to take some lessons from a USA girl. She was a great native English speaker, no claims to her pronunciation nor accent. But she was talking all the time. I’ve been spending my time listening to her bobbing my head and adding “Oh really?” or “That’s cool”. That learning period went quite ineffective.

    Nowadays, there are lots of cheaters who pretend being a good teacher. Don’t let them fool you. A good teacher asks you about the reason of education first. What skills do you want to improve? Reading, grammar, speaking, listening? Or prepare for exams maybe?

    A good teacher always asks you to share you thoughts on every fact you discuss. It’s not because he or she is so interested in your opinion. It’s to develop your mind. Matt, my current teacher, asks me all the time regarding everything we talk about: what do you think on this? What would you do in such a situation? And even a particular question sounds naive, it could become a challenge to compose a good answer and share your opinion in a clear strict way.

    When learning new words, there is a good trick to remember them. Open a exercise book subdivided on thematic sections: food, cars, computer, home etc. Then put a particular word you want to fixate in your memory in a proper section. “Gear” into “cars”, “towel” into “house”, “ceiling” into “buildings” and so on. To find a proper word, don’t open a translation program immediately. Try to find out for something from you exercise book first. Write icons near the words you remember less. But never scribe a translation on your native language beneath.

    When you are at your English class, do not switch at Russian at all, even you need to rest for a minute or say something that is not related to your class. Even if one is asking “What does the word X mean?”, don’t give a quick Russian meaning. Try to compose a phrase that reflects the subject in English words that you know. It is difficult sometimes, especially with such abstract terms as truthiness, honor and others. But you ought to try.

    Do not drill English Tense Chart. One consider that chart as a formula: mix together “have”, “been” and the third form of a verb to get a proper result. They even pass class tests with such approach. It does not work in real life, though.

    have + been + V(3) = profit!
    

    Instead of drilling the whole table, I recommend you to focus on three main tenses: just past simple, present simple and future simple. That fits your mind because we also have three terms in Russian as well. For the beginning, try to explain your thoughts within these three tenses. Keep your phrases simple. It’s always miserable to hear somebody trying to compose a complicated sentence but stops in a middle of it, breaks the whole line and starts from the beginning… Please avoid doing that.

    You’ll definitely need to use more tenses once you have become better in English. You’ll use them to bring additional details into your narrative; to fixate time boundaries more precisely.

    For example, you spent some time on a task and still continue working on it. On a daily call, you might say: I’ve been working on that task for 2 days. That’s great because it brings the whole context of what’s going on. If you are not ready for using such a tricky tense, you say: I was working on the task for 2 days. This form is less precise but nevertheless acceptable. Finally, you may say: I worked on that task yesterday and still continue today. Past simple plus present simple. A bit redundant but also works.

    What you really should drill is irregular verbs. A funny fact: there seems to be more irregular verbs then regular ones. In English, my school teacher used to joke, for each rule you’ve got more exceptions then ordinary cases.

    A minimal table of irregular verbs takes about three pages of A4 size. The most used verbs in our daily and business life are irregular ones. Say, write, read, go, do, make, pay, eat, grow, raise… you will need all of them talking to your teammates, customers or friends. Just decorate your wall with printed table and drill. No life-hacks here.

    I used to take advise on improving listening skills in my previous post about remote work. Start with listening to VOA Learning English videos on YouTube. They speak grotesquely slowly and clear and subtitles are rolling below. Chose any video you like and do the following action in series:

    1. watch it reading subtitles.
    2. Watch again without reading them (scroll the page a bit down); you should recognize all the words clearly.
    3. Increase the speed of video to 1.25 (Put a gear button, then “Speed”). Ensure you still may recognize all the words.
    4. Again, but at 1.5 speed.
    5. Finally, but at 2.0 speed. Return back to 1.5 or 1.25 if you miss the meaning.

    A note: speed change works only in Google Chrome on desktop. Tablets and phones won’t work unfortunately.

    The whole process takes usually 15 minutes per a single video. Even less then you spend on Twitter or being smoking. Do it every morning before starting your daily job. This exercise is quite productive, I may assure you. Even a week enough to start recognizing words in English songs. A month later you can understand most of spoken English as well.

    Read classical English literature. Indeed, not technical. Classical literature keeps its own secret: the language there is quite complicated and well structured. For example, after reading SICP I switched to 1984 by George Orwell. That is totally different English that I have never seen before! The phrases composed in a such precise way. The text is full of adjectives and nouns that bring particular meaning.

    But the main benefit here you start filling the structure of the language. Reading classical books brings huge advantages. Matt, my English teacher, highly appreciates my choice.

    When you finish your English classes, you might still have troubles speaking to your customers. Don’t think you have wasted your time though. In a middle of your daily calls, try to find a chance to practice your communication skills. Personal English teacher would be a great option. As for me, I have 30 minutes lesson every week with Matt. He grew in London and than moved to China to teach English there. Usually, we discuss various themes such as politics, art, literature, hobbies and so on.

    Finally, don’t think one day you’ll know English as completely so you may stop. You should never stop trying to learn more about English. Remember at school, you’ve been learnt Russian for ten years right? And you still make mistakes for sure. It’s the same with English. Once you started with it, it will become better and better, but you never should stop. It would be a catastrophe.

    Learning English is the same as any learning process in general. Your life has just expanded to keep and grow a new knowledge. Like programming, math or something else. The good things never end.

    But finally, this article has got ended for now.

  • Что почитать №22

    На этот раз все ссылки на русском, так что не буду выпендриваться.

  • Thoughts on Russian-speaking communities

    I decided to not stay in Russian-speaking communities anymore. No matter what they are about: Clojure, Emacs, etc… When I see “…for Russian speakers” at the end of the title my hand moves to the cross-button by itself.

    The main problem of Russian communities is they are all about trolling and rudeness. Every single person reckons himself as a Single Source Of Truth no matter what the facts say.

    Even without opening a chat I can say what it is about. Definitely, to prove you are the most clever guy all around.

    Recently, I’ve been chatting in Russian Clojure community in Telegram channel. That was awful. There were more then 100 people there, but only three of them (including me) work with Clojue for their daily work.

    Nevertheless, the chat was boiling all the time. People argued on functional programming without any knowledge of that. There were trolls whose intentions were just to throw shit on fan.

    I knew a person who was only 3 months with Clojure but argued so violently like he’s been 30 years with Lisps and functional programming. It applies to almost every member of discussion. On the first monitor, they have chat window and on the second there is a Wiki page or Stack-overflow where they convulsively try to find facts to support their opinion.

    I looks so poorly.

    And it’s this the same with other messagers and channels. No matter what is the subject of a community. In Russian-speaking group, it always ends up with a question who is cooler.

    That behaviour shows all the bad traits human have. We try to pretend we know everything, be a leader (no matter in what way), hide our weaknesses and muffle misunderstanding of something.

    What’s the point to read all that rubbish? Why do I need spend my time scrolling a feed full of arrogance?

    I must confess Russian people are rude in general. This is particularly noticeable after you have told to non-Russian native speakers. Russian way of discussing tend to be aggressive and even impolite sometimes.

    So what should you do? As for me, it’s better to join world-wide communities and channels in English. I’m sure you can easily find out Slack or Google Group channel for any language or technology you are interested in.

    Staying in Russian communities only stops your development and limits your horizons.

    If you disagree with me I highly recommend you to read that article written by Ivan Sagalaev, a famous Russian Python developer who moved to USA:

    …у меня есть небольшое завещание заявление в адрес этого самого русскоязычного сообщества.

    В современном мире локализация по признаку родного русского языка обрекает сообщество на вечную вторичность. Всё новое в программировании происходит на английском языке и будет появляться на русском с неизбежными задержкой и искажением. А собственные новые идеи, рождающиеся в сообществе, будут оставаться только в нём, лишённые возможности попасть на широкое обозрение.

    Нужно осознать, что у русскоязычного сообщества должна быть другая функция. Вместо перевода всей доступной документации и построения иерархии локальных гуру, оно должно служить “песочницей” для тех программистов, которые только начинают учить английский и не чувствуют себя уверенными сразу включаться в мировое сообщество. Но вектор должен быть всегда туда.

  • What to read #21

    With a little delay, here are the links:

    Non-IT links:

  • Мне пишут #1

    Автор письма разрешил ответить публично. Почта, имена и некоторые детали удалены, орфография сохранена:

    Решил так как время у меня есть свободное, я ж как-ни-как фрилансер( хоть и родные считают безработным) начать учить не фласк, а алгоритмы. Начал курс от комьютер скайнс центра на степике…тяжело..ломаюсь..

    Думаю начать с простого, кормен вводный курс плюс онлайн курс на закрепление…

    В общем я написал первую часть в надежде вашего комментария…

    А вопрос таков, стоит ли решать олимпиадные задачки? ибо один девелопер мне однажды сказал, что толку нет от них…

    Они дают плюсы для дальнейшей карьеры?

    С уважением, N.

    P.S. Знакомые ребята, которые устроились джунами в Киеве говорят, что с алгоритмами не сталкивались( да они и не знают ничего даже про стеки, очереди и тд) только слышали в раговорах в курилке между серьезными разработчиками…

    Решать олимпиадные задачи, на мой взгляд, смысла нет. Они слабо связаны с промышленными нуждами. Почти все задачи с олимпиад, что приходилось мне видеть, относятся к теории графов: как правильно составить и затем обойти. Графы не так часто используются в повседневной разработке.

    Если вы только начали айти-карьеру, не грузите мозг сверх меры. Вам платят за то, чтобы вы решили проблему заказчика максимально быстро и дешево. Другими словами, если заказчику нужно поправить авторизацию на сайте, ему все равно, сколько курсов вы прошли.

    Выражаясь еще проще, на уровне джуниоров-фрилансеров глубокие знания не котируются. Может даже быть обратный эффект – опасение. Заказчик думает: попросишь такого спеца текст распарсить, а он Tensor-flow прикрутит, ценник выкатит конский. Не буду связываться.

    Я бы посоветовал уходить с фриланса и устраиваться в фирму с профессиональным коллективом. Среди коллег опыт пойдет очень быстро. Дома на балкончике вам неоткуда будет брать опыт.

    Начните с базовых инструментов: освойте окружение разработчика, азы Линукса, какой-нибудь язык и минимальный набор библиотек к нему. Если чувствуете, что изучили повседневные инструменты (Питон, Гит, редактор, SQL, Js, CSS, HTML, HTTP/Ajax), то займитесь английским и параллельно читайте SICP и функциональноые программирование.

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

  • What to read #20

    There are 20 issues already!

    There haven’t been some spicy links for a couple of months. My bad:

  • Clojure Webinar #1

    In this video, I’m speaking on Emacs advantages when using Clojure.

    Links from the video:

  • Why not Python

    Recently, I was sorting out with my drafts for blog when I found an interesting one. It was about what programming language to use for education at schools and universities. Python for sure! the draft says. Easy syntax, cross-platform, wide community and bla-bla-bla.

    I’m happy I haven’t published that post so far because nowadays that way of thinking makes me ashamed. Considering any specific language as the primary key of successful education means to make a mistake. Even Python with all its benefits.

    You could ask me: no Python, great, so what else could you suggest? Let me keep an answer for a couple of paragraphs. Instead, could you think just a minute on what’s the reason of IT education in general? I mean, we attend to IT department for… what?

    To learn a modern language? Maybe. But once you finish the university, you’ll realize there are lots of new languages and frameworks. Your possible employers don’t need PHP + jQuery anymore, they want Ruby + React. Or substitute those tools with Java and Scala, it doesn’t matter. In a long term, you cannot reach a train that moves faster day after day. Since technologies became simpler (Python, Ruby, Node.js), there are more and more people claim on the same workplace.

    One of your trump card might be a good knowledge of algorithms. I mean, you must understand how the things work rather then copying and pasting them from the Internet. The most serious problem that happens to new ones is they just don’t know how to split a huge thing into primitives. How to build abstractions. How to write a function rather than using a class with global state.

    I saw an online interview one time. A junior Ruby guy was asked to write a function that reverses a string. I cannot do that, the answer was. OK, you have an hour, he was told. Deal with it. There were long 50 minutes of misery but he didn’t make it anyway.

    Closer to the end, they asked to stop writing code, but to describe the algorithm in words at least. No success.

    That guy knew Ruby, though. And Javascript. And Node.js, Webpack, Bower and so on. I may even think he worked on his project as well. But I would never hire him or let him join a team which I belong to. Because when you cannot express a primitive operation in words, it reveals dangerous holes in your mind. And that could cause unpredictable troubles.

    As far as I see the purpose of education, it’s not to learn Python or any other language. It’s about a) how to compose abstractions using primitives and b) how to simplify abstractions, express them via primitives. Two-ways process, I guess. Up and down. Once you can rich any level at will, you are a great programmer.

    Talking about Python, I consider it as a great tool to express your ideas. When you definitely know how the things should work, but don’t have much time. It is one of the reasons why it’s so popular in scientific area. Engineers and scientists are usually busy with research, but not learning patterns and SOLID. Python is a great choice for them. To build a chart, to train a neural network.

    But that easiness could even kill willness to learn. For a newbie, neither a good syntax and rich standard library could help to become a good programmer. Maybe to write a web app, to find the first job, but not to teach you how to solve problems other than putting a JSON into DB.

    I would never face other stuff, you may say. OK, that’s up to you. But there won’t be growth in your career. Because developing web apps becomes easier nowadays regardless Ruby, Node.js and crowds of students. How would you survive?

    So after all, what language could make you high in algorithmic thinking? Suddenly, it’s Lisp =) or Scheme if talking more precisely. Scheme is the best tool to learn programming, I think. Not C, Python, or Javascript.

    Scheme forces you to make everything from scratch by your own. At the end of SICP, that’s not a problem to write your own registry machine with compiler using pure lists and cons pairs. When you deal with some programming language or tool, you really understand how the things work under the hood without checking a source code. Only Lisp could bring that fillings.

    Yes I know that in MIT, they stopped teaching SICP in respect of Java. It’s their decision after all. Maybe, after 20 years they’ve become really tired of it. And nobody couldn’t develop a new curriculum. But I know what did Dijkstra say about that and I cannot agree more with his opinion.

    Long story short: try Lisp. It’s not a silver bullet. Perhaps you would never work with it in the future. There a quite a few jobs, I know. But even bits of its knowledge will make you a better programmer than now you are.

Страница 1 из 31