top | item 585324

Old-school programming techniques you probably don't miss

20 points| vorador | 17 years ago |computerworld.com | reply

31 comments

order
[+] javanix|17 years ago|reply
I think most CS degrees still do (and should) require the algorithms and data structures programming.

They are useful skills, and, I think the reason that the section seems "old-school" comes from the proliferation of Java in early CS courses.

Java has most of the algorithms and structures implemented already, and there's no point in anyone redoing it once they find those implementations, so the skills fall out of use.

[+] gaius|17 years ago|reply
The point of teaching sorting isn't to teach sorting but to teach big-O notation and how to understand complexity. That will never be obsolete.
[+] schtog|17 years ago|reply
Just because you don't need to write your own sorting algorithms don't mean you don't have to know how to write one. First of all it is a good introduction to algorithms, analysis and construction and you still have to know the complexity of each to choose the correct one in some cases.
[+] swolchok|17 years ago|reply
there's no point in anyone redoing it once they find those implementations, so the skills fall out of use

Yes, that's why all general-purpose languages' standard libraries use the same implementation of the same sorting algorithm for the default sort().

[+] sachmanb|17 years ago|reply
Ah yes, I remember one of my favorite assets being my mouse driver so that I could have mouse support in my applications...and then the happiness of porting it to Pascal from C and having it work in there too...nice big binary arrays to define what cursors look like...I'm glad I don't write mouse drivers or having to double buffer graphics anymore -- but on the other hand, figuring out everyone else's APIs, languages, frameworks, each with their own style, is a pain too.

Sometimes I find a really awesome javascript library that does exactly what I need it to do, but I find configuring it is a pain, or it is missing just one or two things that I need and I'm reading the source code and I really don't want to edit it...so I just write my own.

Oh while I'm ranting -- all you people that are making your ridiculous number of JQuery add-ons that do almost the same thing as tons of other add-ons, or your CSS+JQuery image slide that has been done a hundred times before just so that you can prove you have figured out how to write basic javascript and so you wrote something you've already seen a hundred times before to get some more traffic to your blog that hasn't said anything new for months now....please, stop it...stop it, stop it....your ruining the quality of my google searches. Really, you don't need to post all the time, we have readers now, we don't have to individually check back on your blog all the time, write when you have something to say, not to hit a quota. Ramble complete.

[+] bcl|17 years ago|reply
Some of these techniques are still very useful. For example when developing for embedded systems you don't have the luxury of infinite cpu cycles and ram, you need to understand the algorithms you are using, implement your own, and be able to optimize for performance.

Another way to look at it is this -- how can having more knowledge, more tools in your toolbox, hurt?

[+] Hexstream|17 years ago|reply
I sometimes try to acquire too much knowledge at once and don't really get anything done of what should be priorities as a result.
[+] biohacker42|17 years ago|reply
What the hell kinda crap is that article. You don't need to know sorting algorithms?

You may never write one to use in a production environment, but you better damn well understand them and then some.

And no need for memory management? I don't care if you're coding in a garbage collected language you STILL better understand how computer memory works.

This article is literally below coding horror standards.

[+] iroach|17 years ago|reply
I'm so glad I don't have to worry about these things anymore! Now what do I do with all this legacy code our company depends on?
[+] visitor4rmindia|17 years ago|reply
Hmmm...I just realized I am a pretty old-fashioned programmer. But I guess that comes with working in C++ (as a better C).

- One of my recent tasks was to implement a B-Tree and a Binary Tree. Also, I implemented merge-sort for another project.

- Our company does create it's GUI from scratch. No drag-and-drop magic there either.

- We use GOTO (sparingly). Mostly for error handling.

- We have our own memory managers and do malloc/free (+new/delete). So manual memory management as well.

- We have our own date conversion routines as well.

- We use NULL terminated C-strings everywhere!

- We do lots of things to make our code run faster. Some of these are probably strange!

I don't know if the article is poor or I am out of date! Anyone else out there feel the same?

In any case I would miss most of the above if I didn't have to do them.

[+] rjprins|17 years ago|reply
Oh thank god we don't need to implement those darn complicated linked lists anymore!

Link { Link next; Object value; }

[+] greyhat|17 years ago|reply
It's really jarring how this article switches between talking about linked lists and then explaining what multitasking is... is this for technical people or not? Reminds me of mainstream news coverage of any technology subject...
[+] gaius|17 years ago|reply
This kinda misses the point of Hungarian. I don't care that two variables are both floats, the compiler will keep track of types for me. I do care very much that I'm not trying to add a width to a height, for example. Hungarian can help with that in languages like C and Python.
[+] silentbicycle|17 years ago|reply
Indeed. That's also one of the biggest cases where static typing (especially inferred static typing) comes in handy. Mixing up those (or mistaking unit conversions!) can lead to particularly subtle bugs.

I'm haven't decided whether it's a net gain, but that's something it catches especially well.

[+] nradov|17 years ago|reply
In principle we ought to be able to treat width and height as two separate subtypes of some numeric type and have the compiler generate an error if we add them together. But unfortunately today's common languages like C and Java don't support that.

Here is the original Hungarian notation article by Charles Simonyi. http://msdn.microsoft.com/en-us/library/aa260976.aspx

[+] jws|17 years ago|reply
Perimeter.
[+] nradov|17 years ago|reply
OO languages have not eliminated the need for structured programming. It's still just as important as ever for code within class methods to be properly structured.

Of course that mainly only applies to OO languages which also follow the imperative and procedural paradigms. Structured programming is (mostly) irrelevant for functional languages since they don't have the same control flow constructs.

[+] lacker|17 years ago|reply
The article refers to vi and emacs as "non-WYSIWYG". Huh?
[+] edw519|17 years ago|reply
No, I don't miss them, but I'm sure glad I had to suffer through them. It has helped me to understand "what's happening under the hood" when I make a call with one line of code.

I used to screen programmers by having them code a bubble sort in 20 minutes. After about 1000 of these, I think the results were:

    Pct Result
  ----- ---------------------------------------
   50.0 Why would anyone ever want to to that?
   25.0 Tried but couldn't do it
   24.9 Did it in 2 loops
     .1 Did it in 1 loop (Yes, I hired him.)
[+] nradov|17 years ago|reply
OK, I'll bite. How do you do it in one loop?