|
|
|
Poll: I'm a noob programmer - What should I focus on to become better?
|
|
10 points
by DrorY
4966 days ago
|
|
Following ScotterC thread about what makes one a good programmer (http://news.ycombinator.com/item?id=4759510) it got me thinking. I am a starting programer, programming mostly for iPhone and Web. When I work as a freelance with customers they'd say I'm the best. When I work with fellow programmers on the other hand they'd say I am the worse.Trying to get better, It would be great if you could help me understand what makes one a good web or mobile developer? Could you please help me rank these? 1. Simplicity 2. Readability 3. Abstracting a problem 4. Encapsulation 5. Code efficiency 6. Speed \ Quantity Am I missing any other parameter? Thanks! |
|
Learning to encapsulate code is very easy. It basically comes down to templating your code. Everywhere you might put a comment like:
// Do database authentication
That should instead be a function:
var db = do_database_authentication();
Learning to write functions into your code before you write the actual function is an important skill and will make you a better programmer.
2. Simplicity
Simplicity is relatively easy as a concept. Don't ever nest logic more than 3 levels deep (and try and keep it to 2 or less), don't ever pass more than ~6 parameters to a function (unless the limitations of your language dictate as such), and don't ever have a method more than ~50 lines or a single file more than ~500.
3. Readability
I think if you follow the rules of simplicity, readability comes down to indentation, code organization, and naming conventions. Follow what your language idioms are, not what you prefer (in most cases).
4. Abstracting a problem
This is probably the biggest and hardest beast to tackle, but it's also probably the least important when you're starting out. If you focus on this now, you'll never ship anything. The biggest thing to know is that if you've got a class with more than ~10 public-facing methods, or an object that has a constructor with ~10 parameters, you probably have something in place that could be refactored into a more abstract solution.
5. Speed / Quantity
Writing code quickly is important. If you follow what I've said above and you're relatively competent, you'll produce good code quickly.
6. Code efficiency
Never worry about this until it's an issue. When it is, use a profiler or debugger to isolate issues, and fix them one at a time. Optimization needs to be surgical.