permaculture playing cards*
The moose likes Meaningless Drivel and the fly likes Old-school programming techniques you probably don't miss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Old-school programming techniques you probably don Watch "Old-school programming techniques you probably don New topic
Author

Old-school programming techniques you probably don't miss

fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11160
    
  16

Came across this article today. While I have not had to do all the things on the list, many of them do make me cringe.

Have you ever:

1) written your own sort method?
2) debugged code with tons of 'goto' statements?
3) managed memory with 'malloc' and 'free' statements?
4) Dropped a box of punch cards and spilled them all over the floor?

What coding 'techniques' do you not miss the most?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

I've only been doing this for around 10 years, so I did not experience many of the techniques in the article. However, I do not miss this:

fred rosenberger wrote:
3) managed memory with 'malloc' and 'free' statements?


or trying to figure out who didn't null-terminate a C string and is clobbering code somewhere in the build, then writing a StringBuffer-esque library to eradicate that problem.
I also don't miss the lack of information. If one ran into a problem that wasn't in the manual or in one of the guru's minds, it was hack-and-pray until one got something to work. Now, the solution to pretty much any problem is just a quick Google away.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Having been writing code for over 30 years, yeah, I've done it all. Including the anguish of the dropped box of cards (a multi-thousand line FORTRAN programs to simulate the stock market).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

I have been coding seriously for only about 25 years. I have hand-written hashtable-like things that are currently in production. I've written many sort routines. I've written "malloc" and "free" and friends, and had them go into production.

I wrote DOS TSRs. I wrote Windows 3.1 TSRs. I wrote a boatload of INITs for early Mac systems.

I wrote printer drivers for a TWENEX system.

I wrote plenty of self-modifying code back in the day. I've hot-patched software.

I wrote a virtual machine and an associated interpreter for ANSI C: then Java came out.

I've written code that writes code that writes code. That's not exactly "old school", but it's the thing I've done that most nearly caused my brain to explode.

But I never dropped a box of cards.


[Jess in Action][AskingGoodQuestions]
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

fred rosenberger wrote:
2) debugged code with tons of 'goto' statements?
4) Dropped a box of punch cards and spilled them all over the floor?


For a while, the preferred way to write Fortran was to use FLECS or ratfor, each of which used millions of goto to make Fortran look like a nice structured langiuage. You would get two goto per indented block of code which if you look at typical C/Java is every line or two of source.

On the dropping a box of Hollerith cards, you bet. For the hard core, columns 73 to 80 were unread, so you could punch in sequence numbers. If your box had sequence numbers, it was trivial to go over to the card sorting machine, do a pass, and get them back in order. The problem was that you had to leave "sufficient" sized gaps in the sequence so you could insert new cards as you debugged. Guess too small, and you had a real problem.

My biggest mental brain breaker was single step debugging of DDT. DDT was the machine instruction level debugger on Twenex machines. Debugging user programs with DDT was a standard skill. But debugging DDT itself was a challenge, single stepping into DDT as it single stepped through machine code.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1


>>1) written your own sort method?

You mean, have I implemented the Comparator interface, right? I mean, that's as hard as it gets, isn't it?

-Cameron McKenzie
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1006
    
    3

Wrote a sorter that looked at the number of elements and used either a heap sort, a quick sort or a bubble sort.

Wrote a memory allocation/usage library that accessed main memory, extended memory, expanded memory and a disk cache transparently. It wasn't quite a malloc()/free() drop in.

Wrote DOS TSRs. No Mac inits.

Wrote a couple programs (but not device drivers) for a TENEX system.

Wrote a PDP-11 linker. ...in machine code. Not assembly... machine.

Wrote some self modifying code that output a DOS .BAT file.

Written in COBOL, SNOBOL, Lisp, APL and Pascal. Mmm... APL nothing better than domino character/operator to do linear regression (if I recall correctly).

Never dropped a box of cards.
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
I once wrote a program that changed the color and text shown on a button. In Visual Basic.

With less than 2 gigs of ram.


Man, that was rough.


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
You guys are old.

That said, I have used DDT.


Ping & DNS - my free Android networking tools app
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

W. Joe Smith wrote:
Man, that was rough.


Don Solomon
Ranch Hand

Joined: Jul 20, 2008
Posts: 48
IBM 3270 DataStream w/TPUT and TGET (SVC 93).


Software development is an exercise in thinking not coding.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

This thread should be deleted...immediately.
Reading it is giving us greenhorns an inferiority complex.

On a more serious note, what is "self modifying code" and "code that writes code"? This sounds positively interesting. Is this some AI stuff?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Ah yes, self-modifying code.

My first work project was a PDP-11/44 memory diagnostic. Because the code had to test the memory in which it itself resided, the code would copy itself into registers a piece at a time while patterns were tested in the memory where it used to reside.

That was almost as much fun as the micro-code firmware diagnostics for the VAX-11/750 processor.

After working in diagnostics for 5 years, I transitioned into "true software" development (DECforms project, to be specific) and the code got much less, er, "interesting".

Edit: Good lord! In poking around the DECforms pages (now owned by HP through Compaq which bought most of DEC) I found this manual which is relatively unchanged from when I first wrote it over twenty years ago (a design guide for GUI interfaces on character cell terminals that predates HTML by a number of years).
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Maneesh Godbole wrote:On a more serious note, what is "self modifying code" and "code that writes code"? This sounds positively interesting. Is this some AI stuff?

Not really AI. Any compiler is at one level code that writes code. But the point is generally code that modifies itself to do something better.

It makes debugging the code a real bear, as what is executed isn't what the source code looks like. It was popular when hardware was expensive and programmers were cheap. That's completely gone (except in very special areas) so for the past twenty years, and for sure since Java and other interpreted languages, computers are cheap, and programmers are very expensive, so easier to write and easier to debug code is valued.

There was a time when programmers would reuse the same instruction space. Or jump into data structures.

Fortran's computed goto is a simple variant on it. And the classic spoof of it is the Datamation article on the

COME FROM DEPENDING UPON varible.

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Caution: This thread contents are NOT human readable.

Ryan McGuire wrote:Wrote a PDP-11 linker. ...in machine code. Not assembly... machine.

You mean, 10000110011101.. I remember calling assembly language as a foreign language during my graduation days. Those codes are like a airy shots.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
On a more serious note, what is ... "code that writes code"?

The most common form are probably code generators. One example would be tools like lex/yacc that generate code to parse text files from a specification. In the pre-ORM days I wrote an application that would generate Java source code to access DB tables, based on all the table and attribute information available through JDBC, with all the additional code we needed our DAOs to have.

XDoclet was a popular Java tool for doing this kind of stuff. See http://www.codegeneration.net/ for some more information on the topic in general.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I don't miss 'compile parties' where everyone would compile code at the same time and then go to the shop to buy a drink.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

fred rosenberger wrote:1) written your own sort method?

Ofcourse, in a course about algorithms and data structures at university.
fred rosenberger wrote:2) debugged code with tons of 'goto' statements?

Yes, when I was programming in BASIC on the Commodore 64.
fred rosenberger wrote:3) managed memory with 'malloc' and 'free' statements?

Yes, when I was programming in C on the Amiga.
fred rosenberger wrote:4) Dropped a box of punch cards and spilled them all over the floor?

No, I'm too young for that.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Sagar Rohankar wrote:You mean, 10000110011101..


I can remember when you booted a system by toggling the machine code for the loader into the system with a series of switches (the pink and purple ones) on the front of the system. It only took doing it a couple of hundred times before you memorized the sequence.

Note that the switches are organized (by color) in threes because, of course, you thought of everything in octal.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11160
    
  16

Boy, I remember those machines. My dad's office had 3-4 cabinets like that. I thought they were the coolest looking things ever.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6



Eric
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

fred rosenberger wrote:Boy, I remember those machines. My dad's office had 3-4 cabinets like that. I thought they were the coolest looking things ever.

The DEC PDP-10 KI had the coolest console of any machine I used. This was the next to last PDP-10 model, it had zillions of buttons, lights and switches. When DEC designed the KL model, they discovered that the price of the buttons, lights, switches and wiring them up cost more than a PDP-11/40. So they used a PDP-11 as the console. No more blinking lights. It was the end of an era.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Maneesh Godbole wrote:This thread should be deleted...immediately.
Reading it is giving us greenhorns an inferiority complex.


Oh, I don't know... 10 years from now people are going to be talking about EJBs in exactly this way.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8803
    
    5
We had a PDP-8 (I think it was an 8), in high school. Our programs were stored on 9-hole ticker tape - sometimes we could edit a program by cutting the tape, removing or rearranging a piece or two, scotch-taping the pieces back together again, and punching holes thru the taped areas where holes had been covered by tape. I actually kind-of miss that

I remember thinking that "gosub" was pretty cool!

I remember the "cold-start" h-card for an IBM-1130 had so many holes in it, it would frequently get mangled when it was read.

I remember swapping 15 lb., 15" inch diameter, 8 inch high, 10 megabyte hard drives.

I remember opening up the 1130's cabinet and seeing actual "core"... and then upgrading from 24k to 32k of core.

I remember hating when your program started with line numbers like: 10, 20, 30, 40... and ended up: 10, 20, 31, 32, 33, 34, 35, 36, 40...

Okay, last one, I remember when I was learning C my boss told all of us programmers that using a goto could be grounds for firing!



Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
Bert Bates wrote:I remember hating when your program started with line numbers like: 10, 20, 30, 40... and ended up: 10, 20, 31, 32, 33, 34, 35, 36, 40...

Okay, last one, I remember when I was learning C my boss told all of us programmers that using a goto could be grounds for firing!


In Basic my programs always ended up like: 100, 200, 250, 255, 260, etc.... (always left plenty of room )

Your boss was a smart man Bert

I don't think I can compete with any of you.. I started playing with IT with my first pc. I don't remember what it was but it had win 3.1 that you had to run from the DOS prompt. I started coding in QBasic with line numbers and goto statements and my freshman year of high school I bought my first laptop, a very heavy, hot, Toshiba with 8MB HD and less RAM then it takes me to open calculator on my current pc. I bought it so I could type code into notepad for later instead of having to hand write it in a notebook.


SCJA
~Currently preparing for SCJP6
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Bear Bibeault wrote:
Sagar Rohankar wrote:You mean, 10000110011101..



Ok, that's How PDP 11/20 looks like and that was a computer, but for me, it more like an stereo tape with more than required play/pause buttons
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Bert Bates wrote:I remember swapping 15 lb., 15" inch diameter, 8 inch high, 10 megabyte hard drives.

You forgot to mention how the drive that the disk was placed in was the size of a washing machine.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8803
    
    5
Bear!

I thought I remembered seeing you there!

Oh, and one more thing, when you wanted to print something you had to bring along a loop of paper to tell the printer when to do a page break.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18531
    
  40


On the topic of "self modifying code" -- this was commonplace with programmers working in assembly. I used it when I worked in assembly too. However, I was never really a fan of it. I have friends (then colleagues) that used it for *everything*.

I still remember one of them coming into my office, asking for help in debugging an issue -- he had a routine that works fine on the 8088, but didn't work on the new 80286.

It was basically a graphics routine that calculated a pixel and drew it. It has a parameter that specified how to draw it -- whether you wanted the pixel AND, OR, or XOR with the background. But this parameter wasn't like "set ax to 1 for OR, set ax to 2 for AND, etc". It was wierd. Set ax to a very specific number for OR, etc. I looked at my friend, without having to scroll down to the code yet, and said... let me guess. that's the op code for OR. that's the op code for AND....

Anyway, after an hour of debugging, the issue was... the fetch cache for the 286 was longer than for the 8088. So, when he self modified the code, it didn't take at certain locations, because those locations were already fetched into the cache.

Henry

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Here's what I don't miss.

Having a language with an actual finite number of commands usually about 300 at most, that after a year you would have fully memorized.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18531
    
  40

Mark Spritzler wrote:Here's what I don't miss.

Having a language with an actual finite number of commands usually about 300 at most, that after a year you would have fully memorized.

Mark


There is a bit of nostalgia here. With smaller number of commands, you have to write a lot more "commands" (functions), in order to do something useful. Obviously, it is much easier to remember these functions, because you wrote them. But when you change jobs, and use someone else's lib, you have to relearn everything.

Of course, this is moot, as it's unlikely that your new job will be using the same programming language...

Henry
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

I actually fondly remember BLISS.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Having a language with an actual finite number of commands usually about 300 at most, that after a year you would have fully memorized.

I don't follow this at all. What are commands in a language? Java has maybe 10 verbs: if, while, switch, etc. Very few high level languages have many more.
I've never seen a language constrain the number of variables you can name (altho embedded systems may not have the RAM to use them). When programming in a macro or assembly language, you might have 300 opcodes, but they are fairly easy to remember.

Bear Bibeault wrote:I actually fondly remember BLISS.

I loved BLISS. It was a much better language than C (IMHO), but it fell from favor.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8803
    
    5
Anyone ever hear of TIRS? (The Integrated Reasoning Shell).

Back in the early 90's TIRS was one of IBM's expert systems languages, it ran on OS/2, AIX, and some 360 OS.

It was clean, "reduced instruction", powerful, and fast, fast, fast. I wrote a bunch of systems using TIRS, including the piece of software I'm most proud of in my career.
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
I spent 3 years coding in Euphoria, which was actually a pretty good language. Too bad it has/had about 0% usability in the real world.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1615
    
  13

fred rosenberger wrote:What coding 'techniques' do you not miss the most?


**Pointers!


No more Blub for me, thank you, Vicar.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Bert Bates wrote:I remember hating when your program started with line numbers like: 10, 20, 30, 40... and ended up: 10, 20, 31, 32, 33, 34, 35, 36, 40...

On the Commodore 64 there were programs that could automatically renumber all the lines (and all the references to the line numbers ofcourse) in your BASIC program, so that you could get it back to 10, 20, 30, 40, ... again after adding lines in between.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Paul Clapham wrote:
Maneesh Godbole wrote:This thread should be deleted...immediately.
Reading it is giving us greenhorns an inferiority complex.


Oh, I don't know... 10 years from now people are going to be talking about EJBs in exactly this way.


Assuming I manage to figure out EJBs within the next 10 years.


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Tomita Militaru
Ranch Hand

Joined: Jan 16, 2009
Posts: 37
Commenting the code so the teacher understands it


Poor is the man whose pleasures depend on the permission of another.
 
wood burning stoves
 
subject: Old-school programming techniques you probably don't miss
 
Similar Threads
Package statement and Import statement
a simple counter 1 to 100
how to get your website listed on search engines
Domain Re-registration Question
AspectJ and EJB