Memorize the syntax

Today I take one exam on LinkedIn about my knowledge on Ruby and after some questions I realize I don’t know the answers, so I’m wrong?, I don’t know how to solve problems on Ruby? In my opinion, to memorize all the Ruby syntax is useless because is more important the problem solving skills that the language syntax, we can memorize the syntax just to pass this kind of tests but at the end this tests are measuring only our memory.

The tech interviews some times take this approach to measure the knowledge on a programming language, but let’s be honest, do we really need to memorize all the language syntax?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Comment
variable
@instance_variable
@@class_variable
$global_variable
Constant
"#{interpolation}"
# Some reserved keywords
begin
case
class
def
else
if
module
rescue
switch
unless
while

Having a good knowledge of the syntax can help when you need to teach or if you are a mentor of someone, in this case you probably have the time to prepare the class. But it doesn’t makes a great difference when you work as a consultant because you need to be ready to use many languages and to adopt very fast new technologies depending on the client needs.

Elixir and tests doubles

If you come from an OOP language probably you know the uses for tests doubles and the dependecy injection, today I was trying to write an unit test for a Elixir function that uses some external dependencies for do his job. So I was thinking on a test using a test double to mock the behaviour of the dependency. Looking at the documentation about the mocking on Elixir, I found a comment from José Valim and the test doubles on Elixir on the article Mocks and explicit contracts

“For each test using a mock, you must have an integration test covering the usage of that mock. Without the integration test, there is no guarantee the system actually works when all pieces are put together. For example, some projects would use mocks to avoid interacting with the database during tests but in doing so, they would make their suites more fragile. These is one of the scenarios where a project could have 100% test coverage but still reveal obvious failures when put in production.”

Blog improvements

For many years my personal website was abandoned, and now with the experience of the #100DaysOfCode challenge I’m motivated to make improvements, you can notice some cool things like the code tags and some visual improvements.

Please feel free to look at the code on github.com/mijailr/mijailr.github.io