Why produce ugly code?
It is amazing that some coders can not give a damn about how their code looks! I’ve seen it plenty of times while I was extending Joomla! compenents for client web sites. The coders simply do not give a h00t! They don’t worry about indentation. They follow no real coding standards. Naming conventions is non-existant. All in all, its damn ugly to look at.
The funny thing about it is that it still works! Although it is almost unreadable, it is stable and it does the job. And strangely enough, more often than not it is fairly simple to extend. It is just so straining on the eye… So obviously these coders are not stupid! They are simply messy…
All aspiring programmers: Make sure your code is “pretty”. It just oozes professionalism and could be a pleasure working with it when extending it! Spescially if it is an Open Source project. If others are going to work on it, then make it at least pretty to look at, please.
I guess this is one of the reasons why Python is so popular. Whether or not you are a sloppy programmer, in Python you HAVE to worry about indentation. At least when you open any Python sources, you know its going to at least look pretty. Python is gaining my respect more and more…
technorati tags:ugly-code, sourcecode, software-development, open-source
Blogged with Flock
4 Comments to "Why produce ugly code?"
Spit it out!
Programming Stii
Recent Posts
- Astalavista Wordpress!
- Lifestreaming and Twitter is making us lazy
- Days with my father
- Friday morning fail by a stripper
- Got Springleap!
- Afrigator vs Regator
- Don’t pirate music/movies! You might be forced to use Windows if you do…
- Pike > Python?
- Using Twhirl for FriendFeed
- Being anti-social SUCKS!
My Posse
- Jayx’s bloggy
- Gogo’s blog
- Go2 South Africa
- Stumble Upon
- Dave Duarte
- Wikipedia
- zlythern
- Max Kaizen
- Tresblue
- Mike Stopforth
- RafiQ
- Muti.co.za
- Employmint
- Danette’s Bloggy!
- Thinking Machine
- White African
- kiefpiet.co.za
- Skuff’s World
- Goozeberry
- Crossloop blog
- Crossloop
- Aquila Online
- Charl van Niekerk
- Derek Allard
- Code Igniter
- Carls
- Justin Hartman
- blik.co.za
- Stefano Sessa
- Uno de Waal
- Amplitude!
- bLaugh
- Tyler Reed
- Chris Rawlinson
- Stormhoek!
- 3am
- Mike Solomon
- Mobile Q and A
- Eric Edelstein
- Marc Forrest
- Imel Rautenbach
- Absolutewillie
- Vincent Maher
- Colin Daniels
- Groogle!
- Chilibean
- Paul Jacobson
- Ayelet
- Python Guru Neil
- Rails Guru Nic
- Beverley Merriman
- Miguel
- Nic Harrywhatshisname
- Chris iMod
- Geekrebel!
- Steven McD
- Belinda sweetheart!
- Henre Rossouw
- JPGeek
- Foxinni
- Adii
- Charl Norman
- Bandwidthblog
- Jason Bagley
- Simon Botes
- Auric Silverwing
- Mark Forrester
- Saul Kropman
- Fred Roed
- Sass Schultz
- Gregor Rohrig
- Catherine Lückhoff
- Toastmasters
- SAA
Filed in
- Afrigator (26)
- ajax (9)
- API (2)
- Apple stuff (10)
- Blogging (25)
- browsers (5)
- Business (28)
- Code Igniter (8)
- firefox (8)
- flock (14)
- Funnies (73)
- GeekDinner! (18)
- General and sometimes Rants (49)
- Go2SA (2)
- ideas 2.0 (14)
- javascript (12)
- Kick-ass Tools (30)
- Linux (5)
- Marketing (25)
- moo.ajax (4)
- mootools (6)
- Open Source (10)
- Programming (33)
- C# (1)
- PHP (13)
- Python (9)
- Ruby (on Rails) (9)
- RSS (5)
- Semantic Web (32)
- Social Web (57)
- Software Development (15)
- South Africa (33)
- Tagging (6)
- Techie stuff (22)
- Tshirts (3)
- Tutorials (42)
- Blogging (17)
- Flocking (6)
- muti.co.za (13)
- Web 2.0 (73)
- web development (20)
Past Stuff
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006















Hey Stii, I can speak from experience when I say good intentions as far as coding goes is left at the door as far as big business is concerned.
When you have a deadline and 148 bugs you need to get through by the end of the week then the last thing on your mind is producing good code. Yes, you waste a lot of time finding the bug simply because of a lack of coding standards, and yes, you probably have some bugs simply because of bad coding standards, but believe me, when you back is against the wall (as is the case almost all the time in most software companies) the last thing you care about is doing it pretty. Getting it out the door is all that matters.
The number of times people have told me that they will go back and clean things up is to high to remember, and of course, no one ever goes back, the list of outstanding things to get though simply gets bigger and bigger.
So, I think it will be down to the tools to help us here. Source code formatters is a plus as far as I am concerned, as it stamps down a standard. In my organization we have codes form all over the world, all with their own way of “beatifying” code. We now enforce automation of code beautification by tools rather than people, simply to ensure all code looks the same, as people kept arguing they way of formatting was better and more readable.
That’s my 2 cents worth anyway
Imel, you hit the nail right on the spot. This is exactly the same experience I have been having as a professional programmer the last couple of years.
I am actually quite the perfectionist coder and at least my indentation and code formatting is correct and consistent 99,9% of the time. There is no excuse for me not to have those incorrect because I just make sure they are right as I go along. There’s no gray area there.
My issues are mainly related to documentation and architecture. There is no such thing as the “perfect” architectural design or the “perfect” documentation. I prefer to first sit down and get my architecture correct and then document as I go along. However, if you document as you’re going along, the code often changes a bit and it’s very easy to forget to update the documentation to match. Then you get put under pressure and scope creep happens. Then your nice architecture goes out the door as well, if you were ever allowed enough time to get that right in the first place.
(Please note when I mean “documentation” I refer to both inline comments and separate external documentation on a wiki or somewhere else.)
But I have to agree with you Stii in that most people just do a particularly poor job. However, real world stuff happens.
Hi Stii, great post. I am with you there on Python, its one of the reasons I love the language although there are others as well. To be sure Python does have some ‘warts’ (len using function syntax despite being a method for example) but on the whole I find pretty code also makes one much more productive. It is possible to write ugly Python code but ugly Python code will always be prettier than ugly perl code
It certainly is possible to write ugly looking Python code. But Python does make it harder to do. It’s harder to write code that is hard to understand. But it’s still pretty easy to do, if you just don’t care.
I think variable and function naming is probably a lot more of an important factor, and a lot easier to keep good yourself, and a lot harder to make others do (and certainly near-impossible to automate with tools).
The more “experience” I get, the more I’m coming to believe that the thing that separate a good programmer from a bad one is their understanding and respect for the fact that one spends much more time reading and modifying code than writing it. You owe it to future developers, including yourself, to make sure your code is easy to read and understand. The best thing for the sponsor of the code (a company or yourself) is almost always to have understandable code. The hard part is often convincing them (or yourself) of that.