Programming Jokes: Lame, Science & Math Jokes!

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
  • Tags Tags
    Jokes Programming
Click For Summary
SUMMARY

This forum discussion centers around programming jokes, highlighting various humorous anecdotes related to coding, syntax, and developer experiences. Participants share classic jokes, such as the confusion between Halloween and Christmas due to programming logic, and the challenges of using CSS properties like font-size. The conversation also touches on the importance of syntax in programming languages, with references to C and Java, and the humorous implications of coding errors and misunderstandings.

PREREQUISITES
  • Understanding of CSS properties and units (e.g., px, em)
  • Basic knowledge of programming languages such as C and Java
  • Familiarity with common programming concepts like syntax and debugging
  • Awareness of programming humor and its cultural significance in developer communities
NEXT STEPS
  • Explore advanced CSS techniques for responsive design
  • Learn about debugging tools in JavaScript
  • Research the history and evolution of programming languages like C and Java
  • Investigate the role of humor in software development and team dynamics
USEFUL FOR

Software developers, programmers, and anyone interested in the lighter side of coding and programming culture.

  • #451
Older developers will appreciate this one.

Sr.Developers.webp
 
Physics news on Phys.org
  • #452
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.
 
  • Like
Likes   Reactions: symbolipoint and Borg
  • #453
gmax137 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.
I believe that is not a joke, but something wonderful
 
  • #454
Borg said:
Older developers will appreciate this one.

View attachment 366977
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!
 
  • Like
Likes   Reactions: Borg
  • #455
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!
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.
 
  • Like
  • Haha
Likes   Reactions: BillTre, berkeman and Ivan Seeking
  • #456
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.
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.

The first time this happened I was chasing my tail for days thinking there was a code problem.
 
  • Informative
  • Like
Likes   Reactions: Borg and berkeman
  • #457
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.

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:
  • Like
Likes   Reactions: Ibix and Ivan Seeking
  • #458
1762160708975.webp
 
  • Like
Likes   Reactions: collinsmark and Ibix
  • #460
1762254398666.webp
 
  • Like
Likes   Reactions: sbrothy and DaveC426913
  • #461
1763332133630.webp
 
  • Like
  • Haha
Likes   Reactions: sbrothy, Borg, phinds and 4 others
  • #462
Just appeared on my feed.
1763478423156.webp
 
  • Agree
  • Like
Likes   Reactions: BillTre, berkeman and jack action
  • #463
1763587261357.webp
 
  • Care
  • Like
Likes   Reactions: collinsmark and DaveC426913
  • #464
  • Like
Likes   Reactions: berkeman
  • #465
1763736160965.webp
 
  • Like
  • Haha
Likes   Reactions: Ibix, collinsmark, jack action and 2 others
  • #466
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? :woot:
 
  • #467
1765856007538.webp
 
  • Like
Likes   Reactions: jack action, Ibix and BillTre
  • #468
1767990423626.webp
 
  • Like
  • Haha
Likes   Reactions: collinsmark, jack action, Ibix and 2 others
  • #469
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.
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.
 
  • Agree
Likes   Reactions: berkeman and symbolipoint
  • #470
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.
 

Similar threads

  • · Replies 416 ·
14
Replies
416
Views
42K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 11 ·
Replies
11
Views
4K