Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming

Journal RyoShin's Journal: Practicing Practices

So much for that idea.

Working as a lowly intern for an internal programming department of a Fortune 500 company, it's amazing the quality of the code I read. Despite being a department just for one of the local facilities, you would think big money == big talent, right?

The apparent answer is no. I am in charge of maintaining over four dozen small internal web applications, written mainly in ASP and Coldfusion. (Not even .NET and MX - ug.) I've read through and fixed up code done by a dozen other "programmers", some of them interns such as myself, some of them full-time "specialists", and rarely do I look at a page and not think "WTF?".

Part of the problem could be the "rigorous standards" put in place here- and by that, I mean there are none. Very few of the applications are used by more than 20 people in the entire building, so the general process of new program creation goes like this:

  1. Program request goes to manager
  2. Manager approves/denies program
  3. Program is assigned to one of the available programmers
  4. Programmer works as quickly as possible to finish project
  5. Project is tested for approx. two hours
  6. Manager makes sure that project looks good to requestor
  7. Project is booted out door, and any bugs are fixed as they come up

Since none of the programs are large scale (even the few used by more than 20 people), this doesn't work too bad, though it doesn't have anything useful like code review.

The other problem, one more glaring even in those programs that did have a better quality control (such as those where the programmer took the time to write out a scope and get it approved), is the large absense of proper programming practices. Repeated If-Thens where Switch-Cases should be used, code copied and pasted instead of put into a function/method, the same header code repeated on every page instead of put in a file to include, horrible naming schemes, bad use of whitespace, etc. Granted, programming styles will vary from person to person, but some of the things done within these are ludicrous.

Thanks to sites like TheDailyWTF (an excellent time waster, which is also beneficial for programmers to see what not to do), I believe that this is not a local problem, but one that affects many of those who get into this because they're looking for big bucks, especially when they start using languages like Coldfusion and Visual Basic (easy to write, and therefore easy to mess up). In my courses as a Computer Science major, I have yet to see anything that deals with proper programming practices. I realize that Computer Science is intended to go beyond programming itself, but even in the classes dedicated to programming it is not touched on much.

I would almost say that an entire course could be devoted to it, but I think that would be too much time. The various practices I'm thinking of are fairly simple; a week or two at most would be needed to go over them and make sure people understand them. Potential points would include:

  • Whitespace indentation
  • Descriptive Naming practices (I prefer lowerCamelCase, myself)
  • Programming for efficiency (redundant IF checks, using SWITCH-CASE instead of IF, proper loops, code reuseability)
  • Function creation (as well as some talk about recursion)
  • Truth logic (using such things as truth tables)
  • Database setups (my college actually has an entire class for Databases, but this would be useful for those who aren't CS majors)

I'm sure others have more things that should be added to the list (feel free to comment), but if colleges would put heavier emphasis on covering these kinds of things, maintaining programs would be easier for the rest of us.

This discussion has been archived. No new comments can be posted.

Practicing Practices

Comments Filter:

Old programmers never die, they just hit account block limit.

Working...