Programming Jokes: Lame, Science & Math Jokes!

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
  • Tags Tags
    Jokes Programming
Click For Summary
The discussion revolves around the idea of creating a dedicated thread for programming jokes, building on existing threads for lame and science jokes. Participants share various programming-related jokes, highlighting the humor found in coding mishaps and the quirks of programming languages. Jokes include puns about common programming scenarios, such as confusing Halloween with Christmas due to coding syntax and humorous takes on debugging. The conversation also touches on the challenges of programming, with anecdotes about the complexities of coding languages and the frustrations of working with outdated or poorly written code. Additionally, there are discussions about the importance of clear communication in programming and the humorous misunderstandings that can arise in tech environments. Overall, the thread serves as a lighthearted space for programmers to share laughs while reflecting on their experiences in the field.
  • #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 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!
 
  • #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 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 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 Ibix and Ivan Seeking
  • #458
1762160708975.webp
 
  • Like
Likes collinsmark and Ibix
  • #460
1762254398666.webp
 
  • Like
Likes DaveC426913

Similar threads

9
Replies
402
Views
39K
Replies
7
Views
3K
Replies
17
Views
5K
Replies
1
Views
6K
Replies
14
Views
13K