Archive for March, 2010
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.
Web page invoker using java
0Hi,
as a programmer there are a lot of problems to face. Fortunately, solutions exist no matter how big is the problem. In my case efficiency is not that big deal, so please ignore the algorithms complexity and other geekly stuff
The problem that made me write this article is:
We have a folder (A) with more than 1000 sub-folders. Our user is forced to use a web form to submit each folder name. Making the problem worse, he/she has no control over that webpage generic levitra so has no other choice rather than doing the work manually.
Solution:
We will automate the work by building our own software. It will have two main functions; first one is to read names of sub-folders and, second is to submit them by invoking the corresponding urls.
To read the list of folders we will use this code snippet:
File file=new File("path"); File[] flist = file.listFiles();
For invoking the webpage we will use java.net.URL and java.net.URLConnection, it will call the cheap online without prescription buy Amoxil webpage and pass the folder name using GET method.
u = new URL("http", "localhost", <a href="http://buydiflucancheap.com">diflucan</a> "/index.php?option="+option); ur=u.openConnection(); ur.getContent();
Note:
In real environments you may want to add some time controls functions like wait, sleep, etc. such functions will help reducing the load on the web server.
You can download buy cheap Drugstore online Ampicillin the complete java project with php/sql amoxil online files that simulate westernunion florence the real problem levitra vardenafil from this link: url invoker
All the best.