📜 ⬆️ ⬇️

Non-standard way of teaching a new programming language (translation of the article Sahil Dua)

cover


At the moment there are over 500 different programming languages. Therefore, it is quite normal to take and start learning a new language right now. For example, you know C ++ and Java, but Python is required at work, or vice versa. Or maybe you just want to learn some fashionable language in order to increase your competitiveness? ..


What are the options to learn a new programming language:



However, someone may argue, they say, the best way to learn a new language is:



Good! But this method will only prove that you applied the knowledge of syntax in practice.


I developed more than 20 mini-projects while learning different languages. Believe me, when you write the code for your home project, which is often a passing hobby of a day off or a night hack on your knee, the only goal you pursue is to make it work. It is unlikely that you will worry about the quality of the code.


"Any fool can write a code that the computer will understand. A good developer will write a code that people will understand." Martin fowler

So where do you get the good practices of the language you're trying to learn?


Make a contribution to the open source project in this language


Surprised? Some of you thought - "Wait, open source - it's hard. I can bring something to open source project just being a mature developer, can I?" My answer is no.


I'll tell you one story.


Last year I received an offer from Booking.com. I knew that I had to write in Perl (which is the main language for the backend part of Booking). In June 2016, after graduating from college, I began to learn Perl in order to prepare for my first job. Since I had to start work in mid-July, I had a month left.


I began to read about the syntax of Perl, at the same time aware of the basic patterns of the language. After that, there was a huge desire to collect something, using Perl, to apply and run in their newfound skills. While I was looking for an idea for the application, in Github I came across an open source organization DuckDuckGo (DuckDuckGo - search engine approx. Lane). I noticed that some public projects are written in Perl. Then I looked at the issues and found a lot of those who are able to fix a newbie. Without hesitating for a second, I began to solve them and then sent a couple of pull requests.


Today, I am one of the main contributors in several public projects, as well as one of the twenty Open Source Community Leaders of the opensource community for DuckDuckGo.


So how does it work ?


Immediately after I mastered the Perl syntax, I began to contribute to various opensource projects. At the same time, I always looked at already existing modules, noticed the patterns used in Perl. Based on this, I began to select the so-called "good practices" already in my code, and this helped me to understand how to write good Perl-code.


Not so long ago, being a developer on Booking.com, I came across a task that included work (adding a new feature) on one service, which in turn was written in Go. Then I had the following dialogue with a colleague:


Me: A cool task. I want to take it into development. What do you say?

He: Yes, really cool task. But this will require the knowledge of Go. Do you know Go?

I: Nope.
')
He: Do you want?

I: Yes!

He: smiling Then go ahead!

So I was on the verge of learning another language programming - Go.


Again, I started by reading about the syntax and found a great tour of the language for beginners right on the official site. He was so good that I quickly mastered the entire base of the language.


And I again began to look for open source projects on Go that would have any issues for beginners or "easy-fix" bugs. Then I found a Google project that was a GitHub REST API go-wrapper.


My first pull request to the project was already two days after I started learning Go.


screenshot


How does open source help?


So, now you probably ask - how does participation in opensource-projects help to assimilate the best practices? There are several aspects, let's discuss them in order.


Quality code


Most good opensource projects have clear development principles (coding guidelines), which you will have to adhere to in order for your code to be in the project. This will help you master the basic principles of development, and as a result, improve the writing of the code as a whole.


In addition, you will be dealing with someone else's code that is well written and / or documented.


Code Reviews


This is the best part in opensource. When you fill in your code, you get feedback from experts of the current project, which later provides an opportunity to improve the understanding of the language as a whole.


It’s like getting free personal advice on how to write good code.


Appreciation


screenshot2


We, software developers, more than anyone else, need recognition for their work. And the opensource community guarantees you that in full. From my own experience, I have never received a single offensive or demotivating comment. They were all very encouraging and helpful.




So, the next time you want to learn a new language, find a suitable opensource project and boldly step forward towards the unknown.


Link to original
Translated: Sergey Chikirev

Source: https://habr.com/ru/post/329006/


All Articles