52 Comments
- valona, on 10/12/2007, -5/+28Well smack my ass and call me Charlie, but that article should be called 'The bleeding ***** obvious'. Buy a book, learn by doing and other totally apparent 'tips'. Rubbish. Most blogs are just firing out the same old crap day in day out, and then linking to each other's blogs. It's all a big steaming pile of *****.
I'm off to drink a large bottle of whiskey, I'm so mad. - Greyarea, on 10/12/2007, -3/+22I'd add "learn to enjoy the 'whooshing' sound that deadlines make as they fly past".
- cmiller1, on 10/12/2007, -0/+9How dare you try to take credit for the joke of the late Douglas Adams!
- Unicron, on 10/12/2007, -0/+8More tips please. This is what I love about digg, even if the article is mediocre you can get loads more information in the comments :D
- jonathansnook, on 10/12/2007, -0/+8"I can't beleive i wasted 30 seconds of my life on this article"
Because your time on Digg is time well spent? And you felt it was worth your time to leave that comment here and on the blog in question? Okay... just making sure. - weateallthepies, on 10/12/2007, -0/+7Pretty obvious as others have stated.
I'd add:
1. Divide and conquer - break the problem down into simpler tasks which can be dealt with.
2. It is impossible to learn to program in "21 days", no matter what Sams tells you. - InternetUser, on 10/12/2007, -0/+6Another:
If you're half-way through your project and you realise you've made an architectural error that will require some time to correct .. DO SO ANYWAY! It's well worth it. Don't fudge your way around the problem. Believe me, I've made that mistake a few times and lived to regret it :) - KibibyteBrain, on 10/12/2007, -1/+6I think a really important thing for new programmers that is not often brought up is to know ones environment even better than the language one is programming with. I know lots of Linux programmers who really don't quite understand how a POSIX/UNIX like system is all tied together, or how inter-process communications are really handled, etc. This all has nothing to do with the language they are programming in, but with the technology they are using. Sometimes, I think people are too eager to jump into things without understanding how things really work. You can get away with this very often, but it will tend to ruin productivity or efficiency. And then of course, when you are an embedded systems programmer like me, the coding is usually very straightforward C/Assembly, but you must understand how everything in your system works from a logical and electrical point of view too. So sometimes, before picking up that big fat C book, picking up the big fat Unix book might be a better place to start!
- markho, on 10/12/2007, -2/+7Some better, more specific tips I can think of off the top of my head for absolute newbies:
1. Stop and THINK. Think through what you're trying to achieve, and how best to do it. Think of what the main bits of data you're working with are, and how you're going to have to manipulate and pass around that data. That alone should give you a good idea of where to start. Use a pen and paper to sketch things out if it will help. Keep those sketches.
2. Comment your code - anything that isn't obvious should have a comment somewhere nearby; anything that is obvious shouldn't have a comment. Make your comments as concise as possible. Keep your comments up-to-date!
3. Similar to above - use whitespace effectively; leave space between functions, group related lines together, use indentation to help make functions, loops, conditionals and other blocks stand out. Simple things like making your source code more readable will greatly help you (and enyone else) understand what is going on. Take into account what editors are going to be used to view the source, though (that old tabs vs spaces argument).
4. Use descriptive variable names. "loop" is far better than "i", but "member_loop" is even better, for instance. Don't go overboard, though - you'll soon get sick of typing anything longer than 10-15 chars long. Use long function names too. The closer your source code is to English (or whatever your native language is), the easier it will be to understand.
I'm sure people will think of plenty of others - Burgerman851, on 10/12/2007, -0/+3@festmonkey716,
As the headline above might suggest, this is intended for people who are just beginning to program. If you are not just beginning to program and find that your time has been wasted in reading this article, do you deserve anything less for reading something intended for somebody else? - edwilde, on 10/12/2007, -0/+3http://www.gotapi.com
(im not spamming, just coping with diggs auto href) - edwilde, on 10/12/2007, -0/+3one essential tip for new/old programmers...
http://www.gotAPI.com, ajax search for all (well most) api's. - EochaidRiata, on 10/12/2007, -1/+4http://www.digg.com/users/ttfadia/submitted
Here's tip #6: If you are going to spam your crappy blog on Digg, set up an automatic redirect to a mirror (or does that reduce your precious ad revenue?). - inactive, on 10/12/2007, -2/+5I would love to agree with you but some of the 1st year university student I tutor could do with something like this, although I do think everyone learns differently and there should be about 50 Tips not just 5 :)
Enjoy your hangover,
Alan - inactive, on 10/12/2007, -1/+3I think these are good tips for learning...anything, not just programming languages/concepts.
- toya, on 10/12/2007, -0/+2what kind of ***** is this? and it's been dugg over 1k times, some of digg users are really dumb i guess, these kind of tips are pretty much nobrainer tips like: drive safe, when you're in school pay attention...
wtf... - lhnz, on 10/12/2007, -0/+2Here are tips I would give to aspiring programmers.
1.) Don't choose a "really easy" langauge to start off with. In the long run it will be counter-intuitive, and will probably confuse you at times.
2.) Go slow. But I don't mean only working 5 minutes a week, but instead learn the same thing from 3 or 4 different books. It will help really cement the knowledge into your head.
3.) Buy a "for dummies book" and also buy a 1337 total-everything you need to know about the particular langague you are learning ever guide. You know the sort. ;)
4.) Start reading about your OS and hardware and how everything works at some point. Learn Assembly maybe?
5.) www.gotapi.com is your friend.
6.) Comment, and use the correct ammount of whitespace...
7.) Patience and practice.
8.) Surround yourself with people who are trying to learn as well. - recursive, on 10/12/2007, -0/+2Good points.
Except that i is a loop index by convention, so it probably isn't any better than "loop". - Ingwenya, on 10/12/2007, -0/+2Tips for beginning programmer wanting to submit tips to Digg: get a bigger webserver :-)
- SQLDigg, on 10/12/2007, -0/+1Learning the art of Refactoring is a good way to deal with this
- cyclomedia, on 10/12/2007, -0/+1I somewhat concur, what I'd suggest RE: books is to find a really good reference book, rather than a dummies-guide-to book. The one i learned C from is one half Beginners Guide and one half Alphabetical Reference. And i still use it to this day: whenever i forget a formatting technicality i pick it up and open the page at P for printf, for example (the P for Pointers page, on the other hand, is bookmarked with a post-it note!). I got a Java book similar to this too in the later 90s.
- Chewie67, on 10/12/2007, -0/+1#2 and #3 above are exactly the ones I was going to post. These are the two biggest mistakes I see new programmers make. A dozen nested loops with variables like i and j. They need to realize that Kernighan and Ritchie used those variables to save printing space in the book, not because they were the right way to go.
The #1 rule in my book, however, is this -- if someone else needs to change your program in the future, will they be able to understand what you're doing?
I've done code support in many environments, and it really makes you learn to write MAINTAINABLE CODE. - inactive, on 10/12/2007, -1/+2I have to disagree with the tip 'Buy a Book' maybe it's just the way I learn but with a book you are forced to learn topics which you may have no interest in just to get to the next chapter. The biggest hurdle to programming in my experience is not knowing what you are going to do but finding a way to do it. For example if I wanted to turn a String to all upper case how would I do it?
This leads me to my Tip: Use the API's
For example the Java API is my most referenced documentation since searching through the String class I would see the toUpperCase method and maybe even find out about some other use-full things you can do with Strings (like split and substring). - ioral, on 10/12/2007, -0/+1rats, i was editing my first comment when it suddenly timed out :( anyway, i meant to explain how "they weren't cut out for it."
I spent a _lot_ of time explaining to them how to divide the problem into functions and/or objects. They just had no idea how to attack a problem. So there... try to learn to break a problem into workable parts. Also try reading other peoples' code to get the hang of how they come up with solutions. - SQLDigg, on 10/12/2007, -0/+1Code Complete (2nd edition) is a must have.
Other books that are worth mentioning are Design Patterns and Refactoring
It probably helps to start with something that doesn't have a huge library, for example C. Once you master the basic concepts you can progress to Java/C#/etc and you will see that a lot of the stuff is already in the library and you don't have to write your own
Btw the site is down ;-( - KibibyteBrain, on 10/12/2007, -0/+1To any beginners out there, very very good advice on C++. C macros and other techniques to make plain C object oriented are much cleaner, and many fun libraries like the GDK/GTK have done pretty much all the work you will need in the average desktop app job for you. I really think C++ was just an academic mistake as a way to teach C(very practical) with object oriented programming, but the result is a legendary disaster that fails at being anything good. If you want to learn OOP, look at Java. Not the best OOP language by any means, but its the one easiest to get a job with ;).
- graywave, on 10/12/2007, -0/+1That's one of the main things I look for on digg, the tips from users. Keep em coming guys!
- psychoaliendog, on 10/12/2007, -0/+1I agree with you, InternetUser, about C++ it is definitely not a beginners language. However, and this go out to KibibyteBrain, never use Java. Java is an interpreted language, which makes it incredibly slow, much, much slower than C (and its subset C++, 'cause remember kids C++ is C just with a little bit more).
- databasecowboy, on 10/12/2007, -0/+1One thing that really helps me is multimedia. I just moved over the weekend and I can tell you I have a lot of books. But I also have a lot of good multimedia that has helped along the way.
1 -Compton's Learning Programing Made Easy is a great way to get the basics.
2 -Dietel & Dietel are great books, but put out the extra bucks to get the multimedia CDROM for even better instruction.
3 - OnSiteSeminars & AppDev has some of the best in depth training available. You can often find good deals on this sort of stuff through eBay by searching "CBT"
4 - Podcasts are out there and awesome. Strongly recommend the JavaPosse and Bruce Eckel's stuff http://www.mindviewinc.com/mediacast/interviews/Index.php - burnt1ce85, on 10/12/2007, -0/+1One thing i like from this site is that they encourage you to buy a good programming book. Many of 'elite' programmers who claim they never bought a programming book and used the internet instead, take great pride in that. When more inexperience programmers hear that, they would try and mimic that. Though it's not impossible to do, it is more difficult than buying a book because books tend to be much better than websites. It's not worth trying to learn programming for the first time by using the internet alone.
- creeptick, on 10/12/2007, -1/+2@festmonkey716: troll.
- RajAtWork, on 10/12/2007, -0/+1I would add:
write unit tests. Do not care if they are true unit tests, just have something you can run all the time.
limit your functions(methods) to about a page length
limit your argument lists to about four argument per method
do not comment the obvious things. Think of commenting as conversing with the programmers who will come later on - eczarny, on 10/12/2007, -0/+1Another tip I would like to add: Don't keep yourself tied down to one particular programming language. Learn enough about general/basic programming concepts to learn other languages quickly. Sure, you can get the job done in your programming language of choice, but it is always important to look into what tools are best for that job.
I can not say it enough, programmers with an open mind tend to do much better than those tied down to what they think is the "best". The truly best ability of any good programmer is being able to pick up any programming language in a short time, while maintaining consistent code quality.
Oh, that and writing clean code. Always, always, write clean, commented, and maintainable code. Those working on your code with/after you will give you plenty of hugs and kisses for that. - whitter, on 10/12/2007, -0/+1Before writing any code,
1) work out what the code should really do for all conditions
2) work out how you intend to achieve #1 in logical steps
3) write out #2 in comments
4) Work out how you can tell if #1 has been achieved
Then start writing the code:
5) start putting code in-between the comments (you can leave the pseudo code as comments if you like, though better is to use proper function names such that the code just says what it does)
6) As you are working, keep testing #4. Don't assume your code works: always test it. - Noginsk, on 10/12/2007, -0/+0Im using gotAPI too. Nice tool.
- InternetUser, on 10/12/2007, -2/+2True. Slashdot comments also have loads of valuable info.
- ozziegt, on 10/12/2007, -0/+0The difference between a 'hack' and a professional software engineer IMO is that an engineer has a broad range of knowledge and can apply it to different problems. Having a broad range of knowledge will lead to better, more structured, more maintainable software than someone who hacks things together by learning only what they need "to get the job done". That being said, hacking is often a great way to learn a new language or new skill, but make sure you refactor your code once you actually know what you are doing!
That being said, all professionals must use reference material because until you use a language / API for a very long time you never learn the whole thing. It's just that when you are looking at how to solve a problem a broad range of knowledge that you get from a book or school or experience helps you make better choices early on. - icarus, on 10/12/2007, -0/+0Get the basics down first. This is what most of the newbies lack of.
- BRSQUIRRL, on 10/12/2007, -0/+0I'll add a tip:
Please, for the love of all that is sacred...do not even think about writing a single line of production code until you have read "Code Complete". - dr-steve, on 10/12/2007, -0/+0Describe in detail. Be brief and concise.
A punchline of an old joke, sure, but very true about programming. Know how to do what you are trying to program, learn how to observe your own processes (what you are doing). Learn how to describe what you are doing in sufficient detail, but not with such detail that you obfuscate your description. Introspection and self-observation.
This works equally well in all paradigms ("I go through the boxes, looking in each box and adding the number of marbles to the total", "I split the pile into two piles: 'big ones' and 'small ones' and then sort each pile", "It is the biggest integer that, when squared, is still less than 85"). And, if you can't do this, your programs won't work regardless of the language/system you choose. - InternetUser, on 10/12/2007, -2/+2Here's my tips:
- Learn some basic assembly. Real mode x86 will do fine.
- Get a book and learn proper OOP concepts.
- Learn by doing - make versions of your favourite programs, if you like. Or simple utilities, whatever. This is the single most important tip.
- Books aren't all they're cracked up to be. If you can afford it, get them, but don't feel bad when you only read a quarter of it.
- Stay away from C++ (dear god! :) - ioral, on 10/12/2007, -0/+0heh, that's mean but funny. also kinda true. i once worked in a shop where some programmers were in it just for the money. they were nice people to play pool with after work, but they just weren't cut out for it.
- Burgerman851, on 10/12/2007, -1/+1Please bury.
- rockzcm, on 10/12/2007, -0/+0This was a great artical for a beginning Programmer. It has list 5 key points. I couldn't agree more on the first one Get the basics down first. A lot of people tried too hard to complete the complex logic, when they don't even know if their basic loop or if statement was right or not. So make sure all the basic things are right before you going further.
- canyonclimber, on 10/12/2007, -0/+0My biggest frustration with new programmers was the lack of debugging experience (even those fresh out of a Masters Degree program).
My suggestion for new programmers: Learn to use a debugger!
P.S. Code Complete is an excellent book. - RandomGuySteve, on 10/12/2007, -1/+0Anyone have a mirror? Site's down.
- ActivitY, on 10/12/2007, -11/+5this information is so abvious but commonly overlooked.
- Grimdotdotdot, on 10/12/2007, -8/+1Save a few shots for me.
What a waste of time. - inactive, on 10/12/2007, -12/+1I can't beleive i wasted 30 seconds of my life on this article... mabye they should have added a 6th tip...
6.) Buy a computer, turn it on. - inactive, on 10/12/2007, -18/+1I can't beleive i wasted 30 seconds of my life on this article... mabye they should have added a 6th tip...
6.) Buy a computer, turn it on.


What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official