Live data from Hacker News

Old-school programming techniques you probably don't miss

computerworld.com

21–30 of 33 posts

Re: Old-school programming techniques you probably don't miss

#21
post #2

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 us…

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.

Re: Old-school programming techniques you probably don't miss

#22
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.)

Re: Old-school programming techniques you probably don't miss

#23
post #8

Earlier quoted context omitted.

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.

And the point to teaching binary trees and linked lists is to teach you how things are structured under the hood...

Well, the point of binary trees and linked lists is also more of what gaius said.

Yes, it definitely helps to be able to visualize how things are structured, but I think the biggest thing you learn comes from understanding the asymptotic performance of various operations on those data structures.

Without understanding these structures, the fact that one provides much faster lookup, but slower deletes seems totally arbitrary and magical.

(Not sure I'm so much disagreeing with you as elaborating here.)

Re: Old-school programming techniques you probably don't miss

#24
post #22

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…

OK, I'll bite. How do you do it in one loop?

Re: Old-school programming techniques you probably don't miss

#25
post #2

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 us…

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().

Re: Old-school programming techniques you probably don't miss

#26
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.

Re: Old-school programming techniques you probably don't miss

#27
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.

Re: Old-school programming techniques you probably don't miss

#28
post #24
post #22

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…

OK, I'll bite. How do you do it in one loop?

Two loops: (I'm sure I'll get this wrong.)

  for (int ii = 0; ii  arr[jj+1]) {
         swap(arr[jj], arr[jj+1]);
      }
    }
  }
One loop:

  int ii, jj;
  for (ii = 0, jj = 0; ii 
Unreadable, but it's one loop.

EDIT: use code formatting, oops. EDIT 2: add proper conditional for jj update instead of jj = jj + 1.

Re: Old-school programming techniques you probably don't miss

#29

Earlier quoted context omitted.

And the point to teaching binary trees and linked lists is to teach you how things are structured under the hood...

Well, the point of binary trees and linked lists is also more of what gaius said. Yes, it definitely helps to be able to visualize how things are structured, but I think the biggest thing you learn comes from understanding the asymptotic performance of various operations on those data structures. Without understanding these structures, the fact that one provides much faster lookup, but slower deletes seems totally ar…

Thanks - I should have elaborated more. I was meaning more of the way memory is structured and accessed. Yes, it's all abstracted now - but it's still important to know and understand.
Post reply on HN