XHTML-CSS.com

This is our blog. It's mainly about programming, web developement and design, social web, coding habits and advice and miscellaneous geekery. You can subscribe to the feeds to never miss a bit.

7 top advices to program like a master

Permanant link —Jan 6, 12:33 AM

I’d like to share some of the good programming habits I’ve acquired and still struggle to master everyday. Don’t expect me to give you some regex voodoo here, just some simple advices which if followed will bring you for sure happiness and productivity.

1# Use and improve your learning of a good text editor

I’m not talking about IDEs. Period. The simple is the text editor the better is. I, myself, use vim and I’m very happy with it. Yes you can use Emacs too (put some frustrated and shutup troll here) but learn how to use that editor as a pro, learn how to avoid the mouse. The less you use a mouse the faster you’ll be. In fact, moving a mouse will take you the time it takes to type some words. Train yourself in your spare time and when you’re bored.

2# Use a version control system

Again, it’s not for a backup purpose. And no, it’s not meant only for coding teams. You’re a team by yourself! Think about svn, git, bzr or whatever you choose as a time machine that will show you your evolution, will help you roll back, branch, study some cases… There’s a tremendous lot in using a version control system.

3# Never reinvent the wheel

Sometimes when we’re stuck in a problem we dig and dig struggle to find by ourselves the solution. This is insane! A good programmer is someone who’s able to reuse some code written by others. So keep in your bookmarks, ready to use, some snippets websites.

4# Use todo lists.

There’s a delicate difference between the words “complicated” and “complex”. An airplane is complex, spaghetti is complicated. The very first rule of good programming is “make a good conception, write on paper and then code”. Divide your problem into smaller ones, and if these smaller ones are still complex, divide them too until you have basic, atomic, problems. Then go ahead and code, start with independent parts, and easiest ones. If you’re stuck in a certain part, work on another. If you’re tired, go out and when you’re back work on some part you enjoy doing.

5# (E)books are good but…

But not when you have 30 on the same subject. If you want to learn, say, python. Don’t think that the more free ebooks you collect the better you’ll learn. That’s fundamentally wrong. We, human, have this bad habit of wanting always more and more… But we forget about time. In fact, a book or at most two to learn something new is enough! Otherwise, you’ll be overwhelmed and you won’t do anything but die of frustration.

6# You’re not bored, you’re just stupid.

Sometimes, even with the greatest will a man can have, you’ll feel bored. So you go on useless chats, reading your feeds every 3 minutes and many many things that only a depressed-stupid-geekish mind can invent. Don’t get me wrong! Geeks will rule the world! :) They’re so awesome! But come on! we’re about making a great thing alive! So, geek brothers and sisters, remember and write and stick to your machine the motto of ASCII’s father ; Bob Bemer :

((((DO SOMETHING!) SMALL) USEFUL) NOW!)

7# Be kind with yourself and smile

You’re a human chap! You’re not a machine. If you’re clueless about a problem, that’s not a problem :) Life is wonderful outside. If you feel depressed that’s because you keep on thinking on the same thing (instruction/bug/method/function) for hours. Go out, exercise (even if it’s harmful for smoking) and talk with others, real human and even on IRC. Give help and love and you’ll receive if not more, the same.

P.S. Digg folks corrected an error, this is “advice”, not “advise” :) Sorry.

P.P.S. Please if you find grammar errors in my posts let me know, I’ll try to correct them and btw improve my english which is my 4th language. Thank you!


Enjoyed this post? please subscribe to our feeds to stay informed.

Comment [15]

Cenk · Jan 6, 06:55 PM · #

I love this inputbox. Large Fonts ist the new Small Fonts :)

Great list too ;)

PENIX · Jan 6, 07:07 PM · #

Don’t reinvent the wheel. Borrow some of the points from some previous programming tip guides that have been on Digg in the past.

Here are a few: – Code documentation – Always check return codes – Create modular code that is reusable – Use existing code standards – Use “strict” mode for dev environments

rizwan · Jan 6, 07:29 PM · #

good blogging habit…i must say….loved the use of links effectively in this article

aldomatic · Jan 6, 08:01 PM · #

I have to agree on #5 I have so many eBooks on one topic that I get frustrated going back and forth.

— me · Jan 6, 10:40 PM · #

Dig has one g.

Erik Gyepes · Jan 6, 11:10 PM · #

Thanks for those tips, some of them are really useful :)

admin · Jan 7, 01:57 AM · #

Thanks you all guys :)
Especially “me” ;-)

skp · Jan 7, 07:44 AM · #

Dude !! Thanks, awesome, fucking awesome

jonabyte · Jan 7, 02:51 PM · #

A combination of 3 & 4. When I run into a problem I just cannot see to solve I will literally sleep on it (if time permits). I have found in the past if I go to sleep with a problem I can somehow wake up in the morning and have an idea as how to solve it.

— SnoopDougieDoug · Jan 7, 08:10 PM · #

Test, test, and test again. Do not assume default values. Never assume non-null.

— Tjerk · Jan 13, 04:12 PM · #

Your right on most points but wrong on point #1.

Good programming is not about bashing as much words per minute. It is about good design and about separating concerns.

Good IDE help you to design a good system. UML diagrams are very usefull to visualizing source code.

I cannot understand why one ever only wants to bash as much code as possible.

IDE really compile your text on the fly thus keeping the errors in your code low… maybe vi also supports that but anyway i see it as a very ancient editor. I know what i am talking about because i used vi for over three months.. but it does not come close to a full blown ide

admin · Jan 13, 04:26 PM · #

@Tjerk, thanks for sharing your opinion!

Well, let me say that using vim for 3 months only is just “experimenting” vim. There’s people out there with more than 10 years on vi and some other years with vim and they humbly say that they’re still learning. And I have to agree with them. Belive me cim is such a delicious editor that Id’ dare any IDE to do what vim can do.

You’re right about good programming and I absolutely agree with you about the good design first, but having your fingers automatically write code you already designed is a bless. The very zen of vim is that its commands, tips and tricks will be a part of you the more you use them. And you’ll agree that when you don’t waste your time typing code you save time on making the ONE thing a good programmer does: Design :)

— brwalias · Jan 13, 06:33 PM · #

Great read!

TPN WEB DESIGN INC. · Jan 14, 06:28 PM · #

Nice Post

prashant · Jan 15, 01:20 PM · #

Hi,

Agree with you for all points.

Thanks
Prashant Jalasutram
http://prashantjalasutram.blogspot.com

Commenting is closed for this article.

« Previous post:
Next post: »