DEV Community

Roger Zanoni
Roger Zanoni

Posted on

What's the oldest code you have?

Some time ago a friend sent me a backup of our code from when we were starting to learn pascal. It was very nice to see some of my first attempts at programming.

This one is from November of 2004, it's not the first thing I coded but it's the oldest backup I have:

program cor;

uses crt;

var x,y :byte;
i:byte;

BEGIN
    randomize;
    repeat
        y:=random(45);
        if y = 0 then begin
            y:=1
        end;

        repeat
            x:=random(80);
        until x <> 0;

        i:=random(10);
        gotoxy(x,y); textcolor(i); write('Û');
    until keypressed
END.
Enter fullscreen mode Exit fullscreen mode

It's a small loop to print small colored blocks in the console ("cor" means "color" in portuguese); It's written in pascal to run in DOS and looks like this running in DOSBox:

COR.PAS

I created a gist with all my old sources sources so I don't lose them again. No indenting as I wasn't even aware of what this "indenting" thing was.

Looks like I was pretty "visual" when I started learning, creating small samples to work with colors in DOS and trying to make small games like this small (and broken) Tower of Hanoi implementation (I named it with an "Y" in the original file), it's probably the first game I tried to code:

Hanoi

What about you? What's the oldest thing you have stored or remember you did?

Top comments (20)

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Oldest thing I can remember writing was a guessing game in BASIC for the ZX Spectrum 48K back in 1983 when I was 7 years old. You had to guess who would win in a fight between Batman, Superman, and Wonderwoman. If I remember correctly it was always Superman! Pretty simple stuff, but it started me onto the path of being a fully self taught developer.

Collapse
 
rogerzanoni profile image
Roger Zanoni

Nice! The first I can remember is also a basic program, I was trying to do a countdown for a rocket launch (just counting from 10 to 0) and trying to make the lines stay in the screen for 1 sec by doing empty loops on a CP-500 (I think I was around 11 years old, a teacher where I was studying made a "computer lab" out of some old machines and was teaching us how to code).

Collapse
 
ben profile image
Ben Halpern

Not stored per se, but the oldest copy of my first website in the Internet Archive contains this code...

<body>
  This website is currently not in service.  Email Benjihalpern@yahoo.ca if you have any questions.
</body>
Collapse
 
rogerzanoni profile image
Roger Zanoni

I might have something in the internet archive as well, I tried to start a blog that didn't last long, I'll try to find it

Collapse
 
griffinator76 profile image
Nathan Griffiths

Although I don't technically have the original code any more my first program was on a BBC micro in the early 80s and was basically copied by hand out the Usborne book "Write Your Own Fantasy Games For Your Microcomputer". I was pleasantly surprised to find that Usborne have released all these 1980s books as free PDFs (link to PDF for those interested). Maybe a new project for me to recreate this!

Collapse
 
rogerzanoni profile image
Roger Zanoni

I like the approach of making games to learn how to code, when I decided to learn some lisp I went with Land of Lisp(never finished it, but I'd like to get back to it). I might give the book you mentioned a try as well, it looks like a gem

Collapse
 
gpeto91 profile image
Gabriel Azevedo

Your start was pretty good! Mine is a (very) unfinished text based game written in C around 2012 during my IT bacharelor. A bit before I joined the world of front end. I've never liked that much of C and since then I never did any other thing in this language. But I have the source in my GDrive and from time to time I take a look, although I can't understand anything is going on there anymore lol

Collapse
 
rogerzanoni profile image
Roger Zanoni

I also didn't try to understand this hanoi impl I posted :P and I had to indent this code sample from the post, because the original was madness

Collapse
 
nombrekeff profile image
Keff

Cool start!
My oldest project would be an FTP server/client I made back in 2015 when starting out. I didn't get a grasp of how they work internally and made one. Now I know!

Collapse
 
rogerzanoni profile image
Roger Zanoni

Nice! When I moved from pascal to C I also started playing around with sockets and made some irc bots/mail readers, I wish I kept those sources (it was really fun to play around with this stuff)

Collapse
 
mrrcollins profile image
Ryan Collins

Oldest code written or oldest in production? I have some old PHP code I first wrote in 2000-2001 in production. Oldest code would be some TRS-80 Color Computer code from the summer of '83.

Collapse
 
rogerzanoni profile image
Roger Zanoni

My oldest code in production is maybe some finance application modules written on dataflex in my first job. I have both curiosity and fear of seeing what they look like

Collapse
 
slimcoder profile image
Slim Coder • Edited

My oldest code is Hello World in C++ 😂😂

Collapse
 
rhymes profile image
rhymes

That I can easily find I think some C# code from 2004 but I think somewhere there's earlier Delphi code on some disk 😂

Collapse
 
rogerzanoni profile image
Roger Zanoni

I with I had saved code I made in college, I think I made a lot of stuff in C# and Java, I'll try to find some stuff I made there :)

Collapse
 
tinywook profile image
Jon Stephenson

I have a full backup of a classic ASP eCommerce app that I worked on in 2001. The sad part is the huge pieces of this code is still in production.

Collapse
 
rogerzanoni profile image
Roger Zanoni

I think some code I wrote around 2006 is still in production as well -_-

Collapse
 
ludamillion profile image
Luke Inglis

Oldest code I might still have would be from when I was in school 15 or so years ago. The oldest thing I remember writing was some LOGO and BASIC on the C64 when I was a wee lad in the mid 80s.

Collapse
 
francescobianco profile image
Francesco Bianco • Edited

Retro-gaming is my passion, please take a look to Vintage Package Manager
github.com/francescobianco/vintage

Collapse
 
rogerzanoni profile image
Roger Zanoni

I can imagine, I worked with some legacy code around 2010 that was compiling by some miracle back then and I can't imagine it compiling in any modern os today