Programming Jokes: Lame, Science & Math Jokes!
- Thread starter Wrichik Basu
- Start date
-
- Tags
- Jokes Programming
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
500 replies · 50K views
Physics news on Phys.org
Science Advisor
Education Advisor
- 3,202
- 3,823
Where I worked we had a long, complicated program in FORTRAN that simulated the fluid flow and heat transfer in a nuclear steam supply system. Up at the very top of the FORTRAN there was a sort of Title Page written by the original author, giving the program name, his name, and the first "issue" date, day month and year 1967. We still use this today, though of course it has been modified, improved, extended, and rewritten in the subsequent versions of FORTRAN. I wasn't there in 1967 (still playing in treehouses), but the author was still there when I started working in 1980.
Homework Helper
Education Advisor
Gold Member
- 7,764
- 2,184
I believe that is not a joke, but something wonderfulgmax137 said:Where I worked we had a long, complicated program in FORTRAN that simulated the fluid flow and heat transfer in a nuclear steam supply system. Up at the very top of the FORTRAN there was a sort of Title Page written by the original author, giving the program name, his name, and the first "issue" date, day month and year 1967. We still use this today, though of course it has been modified, improved, extended, and rewritten in the subsequent versions of FORTRAN. I wasn't there in 1967 (still playing in treehouses), but the author was still there when I started working in 1980.
Staff Emeritus
Science Advisor
Gold Member
- 8,252
- 2,666
At times I have had to dive into code I wrote years ago. At first, I often end up thinking, who was the idiot who wrote this code?!?! OMG what was I doing?!?! Then I figure out what I was doing again. Oh. OH! Sometimes I even impress myself! LOL!Borg said:
Science Advisor
Gold Member
- 2,392
- 5,220
I was often called on to fix the disasters left by others. Code that I've written in past years is often filled with expletives in the comments.Ivan Seeking said:At times I have had to dive into code I wrote years ago. At first, I often end up thinking, who was the idiot who wrote this code?!?! OMG what was I doing?!?! Then I figure out what I was doing again. Oh. OH! Sometimes I even impress myself! LOL!
Staff Emeritus
Science Advisor
Gold Member
- 8,252
- 2,666
I've run a fair number of upgrades to large, automated industrial lines that might cover two football fields with many thousands of IO. One interesting problem that has come up is the speed of the new processors. Systems that ran well on 90s technology suddenly have all sorts of new problems. It turned out the old systems were too slow to see various sources of noise. But the new ones do see it.Borg said:I was often called on to fix the disasters left by others. Code that I've written in past years is often filled with expletives in the comments.
The first time this happened I was chasing my tail for days thinking there was a code problem.
Science Advisor
Gold Member
- 2,392
- 5,220
Here's an example of things that made me curse over the years.
The java command to convert a string to an Integer is this - Integer.parseInt("123");. You pass in the string and if it's valid, it will return the Integer. Otherwise, it will throw an error. Unlike an int type, Integers can have a null value. I once found a method being called in some code called something like getInteger(string). It seemed odd that there would need to be a method in the code for a one line command. When I looked up the method, I found this brilliant maneuver that covered all the numbers from 1 to 128.
The rest of the code was equally disastrous. The code base was mainly 6 Java files with one Java class file that was 10K lines long. It was used to control a web page with 10 input fields. Instead of creating a single method, they created 10 identical methods where each method used variables that were the same as its method number (method_1 had x1, y1, z1, etc. variable names). Of course they copied and pasted the method so there were errors like missed references in method 4 that still referenced random variables for method 1. This led to all kinds of odd bugs that the users could never clearly describe how and when they were occurring since not all fields had to have an entry. But, if they entered something in line 4, line 1 would break... I'm guessing that this occurred during the time when managers thought "code counting" was a good idea but it led to people performing lots of unnecessary copy and paste methods.
The methods in that file were also extremely long (200+ lines of code each) from later developers being terrified to touch anything for fear of breaking the house of cards further. So they would add new variables to the circus that did the exact same thing as other, existing variables.
Making this even more fun for users was the fact that every time that the user modified *anything* on the form like changing a dropdown box entry from = to >, the page would make a call to the server with the 'updated' information rather than waiting for them to actually hit a submit button. Of course the facility had a very slow connection so they would make a selection and have to go get a cup of coffee while they waited for the page to reload.
I created a single method, removed about half of the variables and turned off the auto-submit 'feature' on the web page. I also got the code down to about 2000 lines of code. I still didn't like the finished product but I only had about a month to work on it. There was a liberal amount of cursing in the comments and the repository check-ins for that one.
The java command to convert a string to an Integer is this - Integer.parseInt("123");. You pass in the string and if it's valid, it will return the Integer. Otherwise, it will throw an error. Unlike an int type, Integers can have a null value. I once found a method being called in some code called something like getInteger(string). It seemed odd that there would need to be a method in the code for a one line command. When I looked up the method, I found this brilliant maneuver that covered all the numbers from 1 to 128.
Java:
public Integer getInteger(String str) {
if (str.equals("1")) {
return Integer.parseInt("1");
} else if (str.equals("2")) {
return Integer.parseInt("2");
} else if (str.equals("3")) {
return Integer.parseInt("3");
} else if (str.equals("4")) {
return Integer.parseInt("4");
} else if (str.equals("5")) {
return Integer.parseInt("5");
} else if (str.equals("6")) {
return Integer.parseInt("6");
} else if (str.equals("7")) {
return Integer.parseInt("7");
} else if (str.equals("8")) {
return Integer.parseInt("8");
} else if (str.equals("9")) {
return Integer.parseInt("9");
} else if (str.equals("10")) {
return Integer.parseInt("10");
} else if {...}
The rest of the code was equally disastrous. The code base was mainly 6 Java files with one Java class file that was 10K lines long. It was used to control a web page with 10 input fields. Instead of creating a single method, they created 10 identical methods where each method used variables that were the same as its method number (method_1 had x1, y1, z1, etc. variable names). Of course they copied and pasted the method so there were errors like missed references in method 4 that still referenced random variables for method 1. This led to all kinds of odd bugs that the users could never clearly describe how and when they were occurring since not all fields had to have an entry. But, if they entered something in line 4, line 1 would break... I'm guessing that this occurred during the time when managers thought "code counting" was a good idea but it led to people performing lots of unnecessary copy and paste methods.
The methods in that file were also extremely long (200+ lines of code each) from later developers being terrified to touch anything for fear of breaking the house of cards further. So they would add new variables to the circus that did the exact same thing as other, existing variables.
Making this even more fun for users was the fact that every time that the user modified *anything* on the form like changing a dropdown box entry from = to >, the page would make a call to the server with the 'updated' information rather than waiting for them to actually hit a submit button. Of course the facility had a very slow connection so they would make a selection and have to go get a cup of coffee while they waited for the page to reload.
I created a single method, removed about half of the variables and turned off the auto-submit 'feature' on the web page. I also got the code down to about 2000 lines of code. I still didn't like the finished product but I only had about a month to work on it. There was a liberal amount of cursing in the comments and the repository check-ins for that one.
Last edited:
- 13,810
- 16,629
Damn straight.Borg said:
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
Just appeared on my feed.
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
A classic.berkeman said:
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
sbrothy
Gold Member
- 1,809
- 1,527
DaveE said:Actually not too different than the first computer I programmed.
View attachment 316903
And yes, BTW, this was the entire system. WYSIWYG.
Did you use it for playing Wargames?

DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
Mentor
- 38,144
- 10,740
Thus the importance of including useful and accurate comments, especially sections that were complicated to write. I have a lot of old assembly routines I've written over the years. Without the comments I included, the routines would be pretty much inscrutable.Ivan Seeking said:At times I have had to dive into code I wrote years ago. At first, I often end up thinking, who was the idiot who wrote this code?!?! OMG what was I doing?!?! Then I figure out what I was doing again.
Homework Helper
Education Advisor
Gold Member
- 7,764
- 2,184
Along the line of Mark44's comment, I wrote a linear interpolation program in BASIC, several years ago. When I rechecked it at a later time, I found some worthless code therein and spent some time rewriting it correctly. I can't give any details now, since I forgot them and long lost the code and program.
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
Homework Helper
Education Advisor
Gold Member
- 7,764
- 2,184
He left out the D. He also left out one of the E's.DaveC426913 said:
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
This was so lame I almost didn't post it.
sbrothy
Gold Member
- 1,809
- 1,527
I'm slowly going insane. I can't find the source of the 's' in the upper left corner on this page (just above the rotating 3d molecule) and it's driving me nuts! I'll be forced to stop for today as I seem to have stared myself blind on this "problem". One would think it would be obvious!
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
Found it. 

sbrothy
Gold Member
- 1,809
- 1,527
Hah! Thanks. I must've stared myself blind, as I said. I've been messing around with this almost the entire day.DaveC426913 said:
sbrothy
Gold Member
- 1,809
- 1,527
Gone it is. And now relax-time.....
DaveC426913
Gold Member
2025 Award
- 24,618
- 8,963
Similar threads
Collection of Science Fiction jokes
- DennisN
- · Replies 17 ·
- Science Fiction and Fantasy Media
- Replies
- 17
High School Math Jokes: 1-1=0, but 2=0? Impossible!
- Harsha Avinash Tanti
- · Replies 5 ·
- General Math
- Replies
- 5
Discuss here or in the Lame Jokes thread....?
- Johnny Yuma
- · Replies 13 ·
- General Discussion
- Replies
- 13
Math Non programming jobs for math majors
- Wanderer_
- · Replies 30 ·
- STEM Career Guidance
- Replies
- 30
Job Skills What Can I Do Science/Math Related While Working on Undergrad Degree?
- Ascendant0
- · Replies 4 ·
- STEM Career Guidance
- Replies
- 4
Math Joke: Constant & Exponential Meet Partial Derivative
- GTrax
- · Replies 5 ·
- General Discussion
- Replies
- 5
Why Do These Math Jokes Make You Groan?
- pakmingki
- · Replies 33 ·
- General Math
- Replies
- 33
Can You Solve This Equation? A Collection of Math Jokes and Sayings
- MC363A
- · Replies 3 ·
- Introductory Physics Homework Help
- Replies
- 3
Proofs and facts in science, math and life
- Greg Bernhardt
- · Replies 4 ·
- General Discussion
- Replies
- 4
Physics Jokes and Humor - Share Yours Here!
- Gamish
- · Replies 53 ·
- General Discussion
- Replies
- 53