Posts tagged level
My methods to boost up my programming speed (implementation level)
3As the time goes, programmers learn new methods and tricks to reduce time needed for starting new projects. Such thing makes programmers focus on problems instead of codes.
Today I am going to share with you some of the methods I am using to reduce time required to build new projects:
- Practice typing
Keep this in your mind, keystroke equals time. Its unit is a key per second (kps). If your code consists of 1000 characters, then it will cost you 200 seconds (3.3 minutes) at a speed of 5 (kps). You can use typing tutor software to increase your kps.
- Use lightweight editor/IDE
Do not use heavy editors/IDEs. They will kill your excitement and may make you hate the project or even drop it.
- Master your preferred editor/IDE
Learn how to utilize all the features included in the editor/IDE you are working with. Memorize most used shortcuts like copy, past, cut, auto formatting, build, execute, auto complete, etc. such things will save you a lot of keystrokes.
- Reuse code snippets
If you ever wrote a function, then try to reuse it wherever appropriate. Do not rewrite a code that you already wrote. Also, you should try to search for ready codes at the internet. It is good to archive code snippets, so you can easily found them at anytime you want. I found JCodeBase useful for archiving code snippets.
- Compact most used functions
Give aliases for most used functions. E.g. in java you can make a function println that encapsulate System.out.println or a function MsgBox that call JOptionPane.showMessageDialog. This will decrease the keystrokes needed and make VB guys fall in love with Java, or maybe not.
- Make/reuse templates
Templates, skeletons, samples, whatever you may call them. They are almost done projects where you just need to replace some codes to make them full ready projects. E.g. you can build a nice looking GUI with all needed features (splash screen, menus, buttons, dialogs, input screens) then reuse it for your projects just by adding your new functions. This will reduce the time needed for designing GUIs. In fact, this can be done with all type of projects e.g. you can build a generic multithreaded project that can take any runnables and reuse it for any new multithreaded projects.
- Solve first, optimize later
Solve problems with the first solution you found. This will allow you to reach next steps faster. After finishing your project, you are free to revisit the code and optimize it as much as you can.
Avoid debugging your code as much as you can. Debuggers are so slow. Instead of it, try to print results before and after critical operations. I am not an anti-debugger guy, but I am trying to avoid there slowness.
- Do not waste time writing stories
Comments are notes that briefly describe a code. They should be short, so do not use them to tell others about your hobbies and friends. If you insist, you may write pages of comments when the project is done.
This is all what I have for the time being.
All the best.