DEV Community

ayelishaamoah
ayelishaamoah

Posted on

Learning by translation

Due to the rate of change a software engineer is faced with, being able to pick up new languages and technologies is crucial. One of the focuses at Makers Academy is being able to feel confident in saying "I can make anything", to me this means being able to feel comfortable working on unfamiliar technologies so that you aren't restricted to working on the same tech stacks throughout your career.

In week 5 of Makers Academy we discussed the concept of Learning by translation which involves taking a problem that you have previously tackled and trying to solve that problem using an unfamiliar language.

By focusing on programming concepts and patterns that transfer directly into another language can help to quickly get exposure to a new language.

Once you have an idea of the problem you want to solve, make a note of the concepts that you need to understand in order to solve that problem. For example one of the steps involves writing a for loop:

Ruby code

for variable in expression do
  some repeatable statement
end

Enter fullscreen mode Exit fullscreen mode
for i in 0..5
   puts "Number: #{i}"
end

Enter fullscreen mode Exit fullscreen mode

JavaScript code


for (variable; condition; increment) {
  repeatable statement
};

Enter fullscreen mode Exit fullscreen mode
var i;

for (i = 0; i < 5; i++) {
 console.log("Number: " + i);
}

Enter fullscreen mode Exit fullscreen mode

FizzBuzz is a good starter challenge to become familiar with a new language as it is a simple problem that uses core programming concepts such as loops and can be used to learn a new testing framework.

Although this is a useful approach to get a quick overview of some of the common functionality of a language that you know you'll need but it won't necessarily help you in the conventions of the language e.g Ruby convention suggests naming variables in snake_case for methods and variables but JavaScript convention prefers camelCase.

Top comments (0)