It is just like optimizing any piece of code. Log everything, identify hotspots and improve them. 1) Time yourself. Keep a little text file with timestamps and brief fragments of what is going on. Do this every time you have a mental context switch, start a new sub-goal, accomplish something or give up on an attempt. Usually I find myself logging something every 5-15 minutes. 1B) Documentation lookups should not be m…
Ask HN: How do I become a faster programmer?
61–70 of 71 posts
Re: Ask HN: How do I become a faster programmer?
#62You are not a 1960's typist. Lots of replies here will tell you to practice typing, or learn your IDE etc. That's all tactical stuff but I think biggest gains come from not writing the wrong code to start with. Understand the user; understand their problem, the real problem; and actually solve it
Re: Ask HN: How do I become a faster programmer?
#63Re: Ask HN: How do I become a faster programmer?
#64Basically, it was a fairly major coding style change that happened after working with others in my industry (game development) and seeing their prolific output of high quality code.
My process for writing code used to be:
- Identify problem. - Identify the abstractions that fit the problem - Implement those abstractions - Write code to solve problem using those abstractions.
Now it is
- Identify problem. - Write code to solve problem, pulling abstractions out if and only if they make sense and would actually be used.
Honestly, I feel this leads to much better, cleaner and more understandable code, however, it tends not to mesh well with what some people consider best practices.
The resulting code tends to not be particularly object oriented, tends to have large functions, and tends to perform very well due to having a very small distance from what the code says to what actually needs to be executed by the processor.
For more on this approach, see
[0]: http://number-none.com/blow/john_carmack_on_inlined_code.htm... [1]: http://mollyrocket.com/casey/stream_0019.html [2]: https://www.youtube.com/watch?v=rX0ItVEVjHc
Re: Ask HN: How do I become a faster programmer?
#65I would say: 1) get rid of distractions 2) stop creating bugs 3) get really good in debugging This sounds a little odd bug getting rid of distractions (set all you favorite websites in /etc/hosts to points to 127.0.0.1) forces you to focus on the problem. Stop creating bugs is impossible, but you can make your best afford to test your code and write good code (read the book "clean code") But I think the biggest speed…
Re: Ask HN: How do I become a faster programmer?
#66What you want is to become a better problem solver - solving problems better means you can then waste less time with stray thoughts and spend minimal time coding unnecessarily. For this, I highly recommend trying some elementary math proof-based texts in number theory, abstract algebra, or real analysis. With math, you learn how to structure your thoughts in a coherent fashion, then logically rule out deadend/inefficient lines of approach. Speaking personally, it has helped me immensely at figuring out the true source of bugs, and creating the optimal fix for them at an impressive speed - most of this work is without writing a single line of code.
When it comes to actually writing code, I have found it to just be an exercise in repetition. As you write more code, you become more familiar with what you can do, and with the right critical thinking skills, you can then become much faster.
Re: Ask HN: How do I become a faster programmer?
#67Re: Ask HN: How do I become a faster programmer?
#68Forget about maintainability and pick a language that hides errors: Python is good, JavaScript is even better.