Skip to main content

Coding Tips you should know


  1. Get started. Do not feel bad that you are not an expert programmer yet. In 10,000 hours, you will be. All you need to do is start. Dedicate some time each day or week to checking things off this list. You can take as long as you want or move as fast as you want. If you’ve decided to become a great programmer, you've already accomplished the hardest part: planting the seed. Now you just have to add time and your skills will blossom. If you need any help with any of these steps, feel free to email me and I'll do my best to help.
  2. Don't worry. Do not be imitated by how much you don't understand. Computers are still largely magic even to me. We all know that computers are fundamentally about 1s and 0s, but what the hell does that really mean? It took me a long time to figure it out–it has something to do with voltages and transistors. There are endless topics in computer science and endless terms that you won’t understand. But if you stick with it, eventually almost everything will be demystified. So don’t waste time or get stressed worrying about what you don’t know. It will come, trust me. Remember, every great programmer at one time had NO IDEA what assembly was, or a compiler, or a pointer, or a class, or a closure, or a transistor. Many of them still don't! That’s part of the fun of this subject–you’ll always be learning.
  3. Silicon Valley. Simply by moving to Silicon Valley, you have at least: 10x as many programmers to talk to, 10x as many programming job opportunities, 10x as many programming meetups, and so on. You don’t have to do this, but it will make you move much faster. The first year of my programming career was in Boston. The second year was in San Francisco. I have learned at a much faster pace my second year.
  4. Read books. In December of 2007 I spent a few hundred dollars on programming books. I bought like 20 of them because I had no idea where to begin. I felt guilty spending so much money on books back then. Looking back, it was worth it hundreds of times over. You will read and learn more from a good $30 paperback book than dozens of free blogs. I could probably explain why, but its not even worth it. The data is so very clear from my experience that trying to explain why it is that way is like trying to explain why pizza tastes better than broccoli: I'm sure there are reasons but just try pizza and you’ll agree with me.
  5. Get mentors. I used to create websites for small businesses. Sometimes my clients would want something I didn't know how to do, simple things back then like forms. I used to search Google for the answers, and if I couldn't find them, I’d panic! Don't do that. When you get in over your head, ping mentors. They don't mind, trust me. Something that you'll spend 5 hours panicking to learn will take them 2 minutes to explain to you. If you don't know any good coders, feel free to use me as your first mentor.
  6. Object Oriented. This is the “language” the world codes in. Just as businessmen communicate primarily in English, coders communicate primarily in Object Oriented terms. Terms like classes and instances and inheritance. They were completely, completely, completely foreign and scary to me. They'd make me sick to my stomach. Then I read a good book(Object Oriented PHP, Peter Lavin), and slowly practiced the techniques, and now I totally get it. Now I can communicate and work with other programmers.
  7. Publish code. If you keep a private journal and write the sentence The car green is, you may keep writing that hundreds of times without realizing its bad grammar, until you happen to come upon the correct way of doing things. If you write that in an email, someone will instantly correctly you and you probably won’t make the mistake again. You can speed up your learning 1-2 orders of magnitude by sharing your work with others. It's embarrassing to make mistakes, but the only way to become great is to trudge through foul smelling swamp of embarrassment.
  8. Use github. The term version control used to scare the hell out of me. Heck, it still can be pretty cryptic. But version control is crucial to becoming a great programmer. Every other developer uses it, and you can’t become a great programmer by coding alone, so you’ll have to start using it. Luckily, you’re learning during an ideal time. Github has made learning and using version control much easier. Also, Dropbox is a great tool that your mom could use and yet that has some of the powerful sharing and version control features of something like git.
  9. Treat yourself. Build things you think are cool. Build stuff you want to use. Its more fun to work on something you are interested in. Programming is like cooking, you don’t know if what you make is good until you taste it. If something you cook tastes like dog food, how will you know unless you taste it? Build things you are going to consume yourself and you’ll be more interested in making it taste not like dog food.
  10. Write English. Code is surprisingly more like English than like math. Great code is easy to read. In great code functions, files, classes and variables are named well. Comments, when needed, are concise and helpful. In great code the language and vocabulary is not elitist: it is easy for the layman to understand.
  11. Be prolific. You don't paint the Mona Lisa by spending 5 years working on 1 piece. You create the Mona Lisa by painting 1000 different works, one of them eventually happens to be the Mona Lisa. Write web apps, iPhone apps, Javascript apps, desktop apps, command line tools: as many things as you want. Start a small new project every week or even every day. You eventually have to strike a balance between quantity and quality, but when you are young the goal should be quantity. Quality will come in time.
  12. Learn Linux. The command line is not user friendly. It will take time and lots of repetition to learn it. But again, its what the world uses, you’ll need at least a basic grasp of the command line to become a great programmer. When you get good at the command line, it's actually pretty damn cool. You'll appreciate how much of what we depend on today was written over the course of a few decades. And you'll be amazed at how much you can do from the command line. If you use Windows, get CYGWIN! I just found it a few months ago, and it is much easier and faster than running ritualized Linux instances.
That’s it, go get started!

Popular posts from this blog

Best Ways to Initialize variables in Java programming - 2022 reviewed

When the variables in the example above are declared, they have an undetermined value until they are assigned a value for the first time. But it is possible for a variable to have a specific value from the moment it is declared. This is called the initialization of the variable. In C++, there are three ways to initialize variables. They are all equivalent and are reminiscent of the evolution of the language over the years: The first one, known as c-like initialization (because it is inherited from the C language), consists of appending an equal sign followed by the value to which the variable is initialized: type identifier = initial_value; For example, to declare a variable of type int called x and initialize it to a value of zero from the same moment it is declared, we can write:   int x = 0; A second method, known as constructor initialization (introduced by the C++ language), encloses the initial value between parentheses ( () ): type identifier

Java Literals

Literals are the most obvious kind of constants. They are used to express particular values within the source code of a program. We have already used some in previous chapters to give specific values to variables or to express messages we wanted our programs to print out, for example, when we wrote:   a = 5; The 5 in this piece of code was a literal constant . Literal constants can be classified into: integer, floating-point, characters, strings, Boolean, pointers, and user-defined literals. Integer Numerals 1 2 3 1776 707 -273 These are numerical constants that identify integer values. Notice that they are not enclosed in quotes or any other special character; they are a simple succession of digits representing a whole number in decimal base; for example, 1776 always represents the value one thousand seven hundred seventy-six . In addition to decimal numbers (those that most of us use every day), C++ allows the use of octal numbers (base 8)

Introduction to strings

Fundamental types represent the most basic types handled by the machines where the code may run. But one of the major strengths of the C++ language is its rich set of compound types, of which the fundamental types are mere building blocks. An example of compound type is the string class. Variables of this type are able to store sequences of characters, such as words or sentences. A very useful feature! A first difference with fundamental data types is that in order to declare and use objects (variables) of this type, the program needs to include the header where the type is defined within the standard library (header <string> ): // my first string #include <iostream> #include <string> using namespace std; int main () { string mystring; mystring = "This is a string" ; cout << mystring; return 0; }   printout:   This is a string As you can see in the previous example, strings can be initialized with any valid string l