J
js_dev
Here is a bunch of good tips for progamming, in general:
Murphy's Law of programming states: "The sooner you start coding your
program, the longer it is going to take." Design to great detail and
elaborately and then only, start coding. Falls very much in line with
the practice of first writing the logic in english-like words first and
then substituting the words by the code of you language. Of course, you
need to know the language well- what algorithms are directly supported
by the libraries of the language and what are not. For example, Java
now has Arrays.sort(Object[]); which sorts "according to natural order"
(meaning numercially for float[], int[] and double[] and alphabetically
for String[] etc.), so you need not write a separate sort method.
Arrays also has Binary search method - so you do not need to write a
separate binary search module.
It pays handsomely to know the API well but obviously it is a long-term
process. Coding tiem is reduced manifold if you know which fucntion is
where and does exactly what. Compiled help helps reduce the searching
time, but the gains are hardly close to the situation when you know in
your mind what the code should look like.
While learning a new language or API, it is an excellent practice to
make flash cards or simple one line notes of all the important things
you learn in a session and at the end of the session try to revise in
your mind all those points. Keep the question on one side of the card
and answers on the other. There is a good piece of software called
jMemorize which helps you do just this. Have a look at it.
Murphy's Law of programming states: "The sooner you start coding your
program, the longer it is going to take." Design to great detail and
elaborately and then only, start coding. Falls very much in line with
the practice of first writing the logic in english-like words first and
then substituting the words by the code of you language. Of course, you
need to know the language well- what algorithms are directly supported
by the libraries of the language and what are not. For example, Java
now has Arrays.sort(Object[]); which sorts "according to natural order"
(meaning numercially for float[], int[] and double[] and alphabetically
for String[] etc.), so you need not write a separate sort method.
Arrays also has Binary search method - so you do not need to write a
separate binary search module.
It pays handsomely to know the API well but obviously it is a long-term
process. Coding tiem is reduced manifold if you know which fucntion is
where and does exactly what. Compiled help helps reduce the searching
time, but the gains are hardly close to the situation when you know in
your mind what the code should look like.
While learning a new language or API, it is an excellent practice to
make flash cards or simple one line notes of all the important things
you learn in a session and at the end of the session try to revise in
your mind all those points. Keep the question on one side of the card
and answers on the other. There is a good piece of software called
jMemorize which helps you do just this. Have a look at it.