This post is part 2 of my ongoing G.G. Series – Being a Good Programmer. This post is all about understanding. Updates will be posted every week or two so stay tuned!
This one also happened back when I was still working at my first job. I was ignorant back then so bear with me.
(Wondering out loud)
Me: Why does String start with an upper case s? I mean integer, boolean and char all start with small letters.
Junior Dev: Woah you’re right, i wonder why.
Senior Dev: Its because Strings are objects. The other things you mentioned are primitive data types which is why they start with small letters.
I don’t remember who the other junior dev in this story was. Sorry guy! The senior dev who answered my question shall remain unnamed for the time being because I have yet to ask him he minds me putting his name up on my blog.
The moment my senior dev answered my question, I was blown away. It was such a simple answer, yet it was something that honestly never occurred to me. I had somehow gone through five years of engineering without ever wondering about that.
Some of you might be saying that the answer was obvious and that if I had just thought about it, I would have arrived at the same conclusion. I can honestly say that no, I would not have arrived at the same conclusion. Simply because our minds were on different levels.
Sure I could write code in Java, but when came right down to it, I didn’t bother to understand the programming language I was using. I knew that Java was an Object Oriented programming language, but I never really thought about objects in that way.
Why Should I Bother Understanding?
Now when I talk about understanding, I don’t just mean understanding the syntax of the programming languages and how they work. Programmers working for big companies or small start ups all know that even the simplest projects need a lot of things. Text editors, IDE’s, test runners, test frameworks, debugging tools, servers, databases, and even word processors.
You should understand what you’re using because it saves you time.
Picture this, a programmer spends days writing (bad) front end form validation code for an AngularJS application.
Said programmer could have finished the same task in a couple of hours if he spent the time understanding what AngularJS could do. Why? Well because AngularJS already ships with validation directives.
A good programmer would not have wasted time reinventing the wheel because a good programmer would have seen that the vehicle was already fitted with after market performance enhancing wheels.
You should understand what you’re using because it makes you competent.
A programmer spends hours wondering why an alert does not show up when a button on the web page is clicked. Another programmer takes a look at the code, types up a line to log an error into the Eclipse IDE console and the bug is found.
If said programmer knew how to log errors in Java (or the fact that it was even possible) he would have saved himself the embarrassment and time.
A good programmer would not have needed to bother another programmer with such a trivial task.
I’m sure that there are many more reasons to understand the things you are using, but the prospect of saving time and not looking like a fool should be enough to scare anyone into trying.
Where Do I Start?
Your starting point to understanding will depend on what you’re using. However I do suggest that you take a look at the documentation for whatever you are using.
You would not believe the amount of tips and tricks the Eclipse Java IDE documentation contains. And that’s just for the Java specific version of Eclipse.
If the docs seem to be too much for you, you could always look for tutorials that talk about the basics of the things that you are using.
Or this Tutorialspoint Eclipse tutorial that teaches you how to debug a Java application.
You do not have to become an expert on whatever programming language, IDE or other tool you are using. It is just important that you understand what it is capable of.
This understanding of why something was made and what it can do might cause you to ask questions. Questions that hopefully lead to answers. Answers that you can use to help you be a better programmer.