What I wish someone told me when I started programming

Software Engineer, Programmer, Developer.

Starting out your career in the field of computer science and technology is not easy, especially with the prevalent of impostor syndrome influencing the people. We dive through endless sea of documentations, articles and discussions, all claiming to have found how to finally "do it" while you work through code block by block until your head spins. The more you learn, the more you cringe.

Makes you ask is all of this really worth it. Maybe it's time to switch career and start to learn something new. Yet it doesn't have to be that way.

Before you decided to quit and move on, let me help you in setting up yourself for success in the world of professional programming. This won't be a long guide, but I'm sure you will have a better career by the end. This is something I wish I had known when I started writing code professionally.

Sticking with the tool you have

Despite all the different ways of doing things, programming has been about one thing and one thing only: to get things done.

This is something that everyone, even me, forget when we are in the trenches of code block and endless tabs of tutorials. We forget that the goal of learning JavaScript, Ruby, or PHP is to create THE app or software that will offer enormous value to our lives, whether through collecting all the videos in the world in one place for all to see, or a simple site where people from different countries can buy and sell.

Yet what do you think about when you are debating tech stacks? Between PHP and Ruby, what will you choose and why? React or Vue?

The answer is choose the one you like and stick with it. When one programming language implement something new and useful, you can be sure that other languages will follow up and make their implementations. This is something that happens to PHP, a language that I, contrary to people's opinion, still think is one of the best language you can use for all backend related stuff. PHP 7, it's latest release, is incredible and I have been satisfied with its performance.

So my first suggestion is to stick with the tool you have chosen and ignore all the internet hipsters telling you which language is the best.

Here's the secret: The people discussing what programming language is best are not shipping products. They are akin to trolls on Facebook. The people who are shipping their products doesn't care about the best language, because there is none. They'll use whatever tool they need, whenever they need it.

So use whatever is easiest for you to learn or work with. And then switch whenever you feel you've outgrown a language. But honestly, unless you're programming spaceships, it's pretty hard to outgrow a language. They're all based on the same principles of computing. You can build anything with most languages really.

But Nathan, I'm still learning and don't really have any opinions. What to do?

Oh, no problem! Just give yourself a month and explore as many tools as you are able to. Download PHP, Ruby, Python, Go and start using them for simple projects. Then select the one you feel happy with. Here is some facts you have to remember about programming tools:

The thing is, you're going to have a long way ahead. You're building a first product that might grow into something bigger and then turn into a startup company which make millions (hopefully). You can always switch at a later date. Twitter switched from Ruby to Java after they kept going down. Twitter still exists. When Facebook became popular, it became overloaded with users, so they wrote their own engine (called HipHop) to speed up PHP. And they started writing critical parts that needed more speed in other languages. Just recently, LinkedIn used React for their frontend parts.

The point is, it didn't stop them from being successful, so surely it won't for you too. To maintain your stamina and sanity as a programmer, you will need to learn avoiding the endless debates. Remember that you need to get things done, and frankly if you can get the job done with less than the best tool, it will still be better than things still left undone. Move fast, break things. Leave the debates to the trolls.

Always Be Improving

The thing about programming and software engineering is that it has a long history of advance that happened in a very short amount of time. In the 90s we rarely use the Internet aside from sending documents filled with text. Today, we download tons of data for games and videos worth gigabytes of space. The technique of serving text document and videos will definitely be different. There are many ways to improve your coding skills no matter what tools you use. Here is a short list:

In Testing Code:

  1. Unit Test
  2. Integration Test
  3. Functional Test

In Programming Paradigm:

  1. Imperative Programming
  2. Declarative Programming
  3. Symbolic Programming

Now if you dive in and chew on them all, you'll probably get dizzy and puke. There is so many jargons and concepts just in these six terms I mentioned. Just set aside a special hour for learning new things each day.

Make small code blocks

The reason Object Oriented programming and Modular programming is so nice is that it gives your code clarity, making it easier to maintain. When I started out, one of the bad habits I make is that I write thousands of lines of code in a single file. That is very bad. Remember single responsibility: your code block should do one thing and one thing only. Don't do something like this:

  /* Objects must not insert themselves to the database. 
  It belongs to DataAccess or Model class */
  class User {
  
    function getId() {
      return 1;
    }
  
    function getName() {
      return "John Doe";
    }
  
    function getEmail() {
      return "johndoe@gmail.com"
    }
  
    function save() {
      $this->db->insert($this);
    }
  
  }

Instead do it like this:

 // separate the functions for the class
 
 class User {
   
   function getId() {
     return 1;
   }
 
   function getName() {
     return "John Doe";
   }
 
   function getEmail() {
     return "johndoe@gmail.com"
   }
   
 }
   
 class UserDataAccess {
   
   private function register(User $user) {
     return $this->db->insert($user);
   }
   
 }
 
 // and so on...

Keep it simple

No matter what concept you will learn in the future, always remember this one rule. The codebase you are working on will be seen and worked on by other people. Your coworkers will need to visit that code you wrote. The way to make it simple is to forget about yourself and think about them. Sometimes developers tried to implement complex stuff simply to show how smart they are and be respected. But real life is not like that. People respect people who make other people’s lives easier. Thus if your goal is to gain respect, move up the ranks, and improve, aim to code for the team and not yourself.

Write first, then refactor

This is something real that you will rarely learn in class room. As you gain experience with doing it, you will appreciate the importance of switching hats. Just like writers, sometimes developers are hit by writer’s block, since we try to make a solution and implement the best practices at the same time. This will make a big battle in your mind and create a “developer’s block.” The way out is that you have to first write the code, then refactor it to follow best practice. One example is with the usual HTML, CSS and JavaScript files. You can work on a single file first, then split the CSS and JS files after the solution is done. Refactoring will be a natural part of your routine because you are learning. You will change your mind and rework the code again and again.

If you thrive, you will love it This is just another truth about life: What you get good at, you will love it. Imagine you start a new project dedicated to become the next Facebook. If after one year you only have 5 people signup for the site, including your mother and brother whom you kinda persuade, You will lose all the excitement for the project and shut it down. But it will be different if you have ten thousand people signing up, and a thousand more each day. You will be super excited to work.

The same thing happens to my programming career. The first time I tried out programming for a desktop Java software, I feel frustrated. Job openings were low or even non-existent as far as I can seek. Very hard to improve your coding skills when you have no opportunity. Then I switched to PHP and build a website for one person with WordPress.

Then two.

Then three.

I started learning WordPress and build even more websites. I got a full time job as a PHP Developer. I started writing test units.

Then I got another offer as a Senior Software Developer working with Express and React. I’m quite happy now.

Programming is not easy, so if you are just starting out on programming, give yourself some time. It’s not something that can be done within a day. Instead, Let your excitement and love grow slowly. It will be a long journey for you, and I wish you the very best.

Caption
from devhumor.com


Get my weekly newsletter ✉️
Let's explore the exciting world of React together.
No Spam. Unsubscribe anytime