Archive for the ‘code’ Category

the deadly sins of programming – again?

Friday, February 18th, 2011

InfoWorld this week published yet another article on “The 7 deadly sins of software development”. For those who don’t care to read the ~1 page article (that’s split unless you use the “print” option that puts it all on one page), here’s the list:

  1. Lust – overengineering
  2. Gluttony – not refactoring
  3. Greed – cross-team competition
  4. Sloth – not validating input
  5. Wrath – no/bad comments
  6. Envy – no version control
  7. Pride – no unit testing

Spiffy. Items 1, 4, 5, and 7 are beaten to DEATH in every computer science / information systems / intro programming / advanced programming / algorithms / data structures / etc / etc class I have every attended, read about, heard about, or thought about. Why is it rehashed AGAIN by InfoWorld?

Better yet, why does an article like this appear every 9-18 months (or more!) in a major publication or on a major website (InfoWorld, ComputerWorld, arstechnica, joelonsoftware, codinghorror, etc etc)?

Is it because, as my friend Steven said they’re ‘basically new writers {“i’m fresh out of college and i know everything”} or quotas on programming articles‘? Is it because programmers are really THAT lazy? Or that bad? Or that inconsiderate? Or that management hasn’t encouraged a culture of excellence and teamwork? Yes, shipping IS a feature. It’s really important. So is having developers who care about their work – and who care for their fellow workers who will have to look at / modify / care for / clean their work later.

Lack of version control will bite you HARD everytime you don’t use it (don’t ask how I know – call it a Bad Experience™). Competing with other teams is just dumb: you’re all supposed to be working for the same company, the same end goal, and, ultimately, the same customers who will eventually pay for whatever it is you’re writing (I’ll relate another moderately-humorous anecdote on that another time).

If developers really are that bad, or their employers are bad enough to not help/fix behavior, then we’re all in a lot of trouble. And if they’re not – then it must just be that it was a slow week, so somebody thought they’d regurgitate and modify the same thing we’ve all heard hundreds of times.

firsts – programming

Thursday, February 10th, 2011

I realized earlier this week that it’s been 19 years since I first started programming. Not my first exposure to computing, which was in about 1986 on my aunt’s Mac 512 .. but still a long time ago :)

My aunt gave me a Tandy 102 laptop that had a whole walloping 21446 bytes of storage. It had the capability to store up to 19 files, and the names had to be in a 6.2 form (ie, not the “standard” DOS 8.3 naming convention).

It shipped with MS BASIC somethingorother, and had a 40 character wide by 8 character tall screen. Oh, and don’t forget the built-in 300 bps modem (that ‘rotary’ dialed)!

I learned BASIC from Learning BASIC for the Tandy by David A Lien. I learned a LOT from that book – not the least of which was that color doesn’t work on a monochrome screen :)

I also learned how pseudorandom numbers can be “manipulated” to help you win games .. and that typos suck : mightily.

Some of my programming habits that I still carry (even in writing “throwaway” scripts), come from my time of writing programs on an extremely limited machine.

After playing with BASIC for a year or so, I started writing for my aunt’s old Mac iiVX (which had 5MB RAM and an 80MB hard disk!) using Microsoft QuickBASIC 1.0 (a compilable BASIC), then moved into Turbo Pascal for a couple months, and then into C++ in 1993. My introduction to C++ was in the form of working with a family friend from church who wanted to learn C++ (but knew C), and who wanted to try-out some ideas he had for work with finite element analysis software. So we (I built the mesh generator/parser, and acted as syntax fiend) built a FEA application using Borland C++ 4.0 on his 486 running Windows 3.11 for workgroups. That was a screamer compared to my little laptop: it ran at 66Mhz, and had 16MB RAM! Wow: those were the days :)

My cell phone has more RAM than that now, and a faster CPU, to boot!

I know I didn’t start as long ago, or as young, as some of my friends, colleagues, and cofiends – but there’s my story :)

wordpress plugins

Wednesday, August 11th, 2010

I’ve started writing [simple] plugins for WordPress – the blogging tool I use to manage antipaucity.com.

As I write more, if I think they’re worth sharing, I’ll write about them here. A full list will also be available at http://antipaucity.com/plugins.

shell scripting

Thursday, October 15th, 2009

I’ve been playing around with bash scripting quite a bit recently in relation to my current job.

Came up with one that’s really useful (imho) around chkconfig:

# mass set all services known to chkconfig to be `on` or `off` at given level
# written by warren myers - warren@warrenmyers.com
# 28 sep 2009

echo "USAGE:"
echo " $0 <level> [on|off]"
echo

# list all services, just the name, skip blank lines, do in order
SERVICES=`chkconfig --list | cut -f 1 | grep -v ^$ | grep -v ':' | sort`

for SERVICE in $SERVICES
do
  chkconfig --level $1 $SERVICE $2
  echo "$SERVICE has been altered for $1 to state $2"
done

Yes – there’s an evil you could perform:

for CS in `chkconfig --list | cut -f 1 | grep -v ^$ | grep -v ':'`
do
  chkconfig --level 12345 $CS off
done

So, if you wanted to stop all services from coming on at startup, you could – and not know you did it until you rebooted.

tiny code

Wednesday, September 2nd, 2009

I ran across the Tiny Code site recently, and was reminded of how many of us started programming on ancient machines that barely had enough horsepower to handle typing – yet we’d spend hours on end writing little games and whatnot that had to be small or they wouldn’t run.

I’d love to see a return to a minimalist approach to development – but I know it’s only a pipe dream.

gold medallion

Wednesday, July 22nd, 2009

While certainly not as exciting as Tarus’ achievement, I did just roll to Gold status with Delta – and had I never cashed-in flier miles in the past, I’d be sitting in the neighborhood of 250k instead of 150.

So yes, like him I’m in that group that everybody else hates – the folks who get on first if we want :)