One language to rule them all

Beneath layers of code lies a language longing to be learned.

One language to rule them all

At the time of writing this article, the query 'which programming language to learn first' yields 517 million search results. Each of these sites praises a particular language, and 90% of them ultimately recommend either Python or JavaScript.

Without further ado, I would like to officially declare that all 517 million websites are wrong and state that the first language you should learn is fundamental logic.

Simply knowing how to code is not enough. The market is so saturated with graduates from colleges and courses that the junior position has almost ceased to exist*. To succeed in today's world, you must be both a coder and possess advanced fundamental logical thinking.

* Here and thereafter, please remember that this is a translation, and the job market situation for the author may differ from that in your country (as do other nuances), which does not, however, make the original article any worse — translator's note.

My First Computer Science Lesson

My first encounter with computer science was an elective I took in the 10th grade. On the very first day, as I walked into the classroom, I was amazed to see a large number of ice cream buckets and various toppings in front of me. Once everyone settled in, the teacher proclaimed:

‘Today, we will be tasting homemade ice cream. But with one condition: you must create a list of specific instructions on how to make the dessert, and I will follow them.’

‘No problem,’ I thought, ‘this lesson won’t take long.’ Within a minute, I had drafted an excellent recipe for my dream ice cream:

  1. Scoop and place three scoops of raspberry ice cream in a bowl
  2. Open the chocolate sauce and add two tablespoons to the same bowl
  3. Add whipped cream to the bowl
  4. Sprinkle all of this with candy sticks and place a cherry on top

My teacher — the ‘computer’ in this charming metaphor — delivered a more sarcastic and literal performance than I had ever seen before. She vigorously jabbed at the ice cream bucket with a scoop, not even touching the lid.

‘Alright, alright, but you first need to open it!’ I exclaimed, trying to get the treat as quickly as possible.

You didn't write this in the instructions, and I couldn't make you ice cream. NEXT!

Let's skip ahead to attempt #2

  1. Open the raspberry ice cream by removing the lid
  2. Scoop and place three scoops of raspberry ice cream in a bowl
  3. Open the chocolate sauce and add two tablespoons to the same bowl
  4. Add whipped cream to the bowl
  5. Sprinkle everything with sugar sticks and place a cherry on top

Well, there shouldn’t be any problems now. I even double-checked that all the ingredients for my culinary masterpiece are opened.

The teacher removed the lid, scooped out three scoops of ice cream into a bowl. "Finally, my wonderful ice cream is starting to take shape!" Then she opened the chocolate sauce and added two tablespoons into the bowl. Not "added chocolate sauce from two tablespoons"—don’t get me wrong—she, of course, placed the spoons themselves into the bowl. Without sauce in them. Once again, I didn’t bother to write everything down accurately. After everything else was done in the same manner, I was left with a bowl of ice cream and two spoons, barely visible under a sea of whipped cream. On top, there was a couple of sugar sticks.

At that moment, it finally dawned on me: a computer is logic in a vacuum. It knows nothing of the surrounding circumstances and makes no assumptions. It only follows clearly formulated instructions and adheres to them word for word.

My final result was the outcome of a long but necessary series of trials and errors:

  1. Open, if not done yet, each of the following packages: raspberry ice cream, chocolate sauce, whipped cream, sugar sticks.
  2. Get a bowl and place it in front of you
  3. Take an ice cream scoop and one by one place three scoops of raspberry ice cream into the bowl. Put the ice cream scoop away.
  4. Take the jar of chocolate sauce, scoop out the sauce, and pour the contents of the tablespoon into the bowl. Repeat the scooping and pouring of the sauce once more. Put the spoon and jar away.
  5. Take the jar of whipped cream, turn it upside down, and holding it over the bowl, pour it over the ice cream for 3 seconds, then return the jar to its place.
  6. Take the jar of sugar sticks, pour about forty sticks into the bowl, and place the jar back.
  7. Take one cherry from the bowl of cherries and place it on top of the ice cream.
  8. Hand the bowl of finished ice cream and the spoon to the student.

The last point was particularly important, as without it, the teacher simply started eating my ice cream the second to last time.

But this is programming. It's the strenuous creation of a meticulous set of instructions for a computer. Essentially, this is what every programming language boils down to—crafting instructions.

A Career in Programming

Programming has reached a point where it’s difficult to discuss it as a single industry, much like it’s hard to use the term 'programmer' as a job description. Two developers can be equally in demand by the market, knowing completely different languages, which means that the ability to develop is more important than knowledge of a specific language. A universal trait shared by all successful developers is— fundamental logic.

The best programmer is one who can look at code from a new angle. This is fundamentally important because most software products are a collection of undocumented fragments of poor code. They constantly need to be pieced together, patching gaps as necessary. Those who cannot connect disparate points with a single line will forever remain in the background.

All this brings me to yet another declaration, this time in bold: fundamental knowledge has always been and will always be paramount for a programmer.

Languages come and go. Frameworks become outdated, and companies respond to demand by shifting their technology stack. Is there something that will never change? Yes—fundamental knowledge, which is called foundational precisely because it underpins everything!

How to Improve Fundamental Knowledge

One language to rule them allPhoto of Christopher Yeshke to Unsplash

If you’re looking for a starting point to enhance your fundamental logical thinking, try beginning here:

Know the complexity of your program

Also known as Big O the 'complexity of an algorithm' refers to the dependence of the program's execution time on the size of its input data (n). Keeping your finger on the pulse of the algorithms you use is an important step.

Know your data structures

Data structures are the foundation of any modern program. Knowing which structure to use in which case is a discipline in itself. Data structures are directly related to runtime complexity, and choosing the wrong structure can lead to fundamental performance issues. Searching for an element in an array takes O(n)time, which reflects the high cost of using arrays as input data. Searching in a hash table takes O(1)time, meaning that in this case, the search time does not depend on the number of elements.

I had candidates come to interviews claiming that searching in an array is faster than in a hash table. This was the surest sign that they should not be hired—know your data structures.

Read / watch / listen

Websites like Udemy, Pluralsight and CodeAcademy are a great choice for learning new programming languages. However, for the basics, refer to books on general principles, practices, and coding styles. The most recommended books are "Design Patterns", "Refactoring: Improving the Design of Existing Code", "Code Complete", "Clean Code", and "The Pragmatic Programmer". Finally, every developer should keep a copy of "Algorithms" handy.

Practice!

You can't make an omelet without breaking eggs. Websites like HackerRank, CodeWars, CoderByte, TopCoder and LeetCode offer thousands of interesting tasks to test your knowledge of data structures and algorithms. Try your luck solving a problem you like, post your solution on GitHub, and then see how others approached it. This leads us to the last point:

Read others' code

The biggest mistake you can make on the path of development is to walk this path alone. Software development is largely a team effort. Together, we create standards, make mistakes, and, despite all setbacks, become better together. The time spent reading others' code will pay off many times over. Just make sure it's good code.

The best advice I can give is to never be ashamed of what you don't know yet. As mentioned, our industry is vast, and the number of technologies is immense. It takes a lot of time and effort to build a comprehensive understanding, even more to become a professional in a specific area, and significantly more to hone your skills in your field. I will let you know when I achieve that myself.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers đŸ”„ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster