PROGRAMMING TECHNIQUE REFLECTION

Programming Technique is one of the most important subject this year, as everything requires some kind of coding these days.


When I first started programming, my code formatting was pretty sloppy. I wasn't always consistent with indentation, spacing, and capitalization. This made my programs much less readable. Then I went through a phase where I was dogmatic about coding style, which is kind of funny, because through this phase my ideas on what was correct coding style continued to change, so I still ended up being inconsistent, but fervently instead of lazily. I would attempt to bend every piece of code I came across to my current coding style rules. I wasted a lot of time on this task. It was good practice. I got very good at repetitive arrow-space-delete keyboard actions.

Now I've become more ambivalent about coding style. When in Rome, do as the Romans do. I'll generally match my style to what's already in a code base to be consistent. I'm pretty comfortable reading a variety of styles, so I default to consistency being the better, less time-consuming choice. Although, I still have my preferences. I think snake_case is more readable than CamelCase because the underscore acts like a space instead of smashing all of the words together, so I try to stick with snake_case for variables and method names and leave CamelCase .I prefer to follow method calls immediately with a parenthesis, but leave a space between keywords like if and while and the parenthesis to distinguish them from methods.

 

 

HOME