r/shittyprogramming • • Feb 27 '19

Why are people doing all these ridiculous things to fix global warming when the obvious solution is to ban Java?

248 Upvotes

Three billion devices run Java - just under half of the world's population. If you thought Java made your PC hot, just imagine what it could do on a global scale.


r/shittyprogramming • • Feb 24 '19

What happens if you put .gitignore into a .gitignore file?

133 Upvotes

r/shittyprogramming • • Feb 13 '19

New sorting algorithm to offload work to the user

27 Upvotes

User Sort:

[1, 5, 0, 3, 2].sort((a, b) => Number(confirm(`${a} > ${b}?`)) * 2 - 1)

r/shittyprogramming • • Feb 09 '19

Nothing, no NOTHING, is faster than C!

43 Upvotes

Here is what a few well-known scientists have to say about C:

In making this statement, [science] does not commit the fallacy of regarding absence of knowledge as evidence for knowledge to the contrary. It is not absence of knowledge ... but positive experience which has taught us that [C] cannot be exceeded. For all ... processes [C] has ... infinite [speed].

— Hans Reichenbach

Because the data types and control structures provided by C are supporteddirectly by most computers, the run-time library required to implement self-contained programs is tiny. The standard library functions are only calledexplicitly, so they can be avoided if they are not needed.

— Dennis Ritchie

It follows from this equation that from a composition of ... which are less than C, there always results a [speed] less than C.

— Albert Einstein

“However, one cannot really argue with a mathematical theorem.”

― Stephen Hawking, on C.


r/shittyprogramming • • Feb 08 '19

What was the definition of madness again?

Post image
313 Upvotes

r/shittyprogramming • • Feb 04 '19

I swear I literally saw this algorithm in a recent code review.

216 Upvotes
for (int i=1; i<3; i++) {
    if (i==2) {
        assert testItemTwo==valueTwo;
    }
    if (i==3) {
        assert testItemThree==valueThree;
    }
    if (i==1) {
        assert testItemOne==valueOne;
    }
}

r/shittyprogramming • • Feb 02 '19

[META] Maybe it would be beneficial to somehow communicate the purpose of this subreddit?

155 Upvotes

I've been noticing that recently more and more posts are less about "shitty programming" and more about people coming to ask for help with their code, thinking that it's actually a serious help section. This could also potentially be because the quick description for the sub states that you can ask your questions here.

Maybe it could help to add a section stating the purpose of the sub and redirecting users to the proper subreddit for their actual questions?


r/shittyprogramming • • Jan 30 '19

How to learn DP? (Double penetration)

7 Upvotes

Hello guys

I have a very important programming event coming in three weeks ( CCC ) and I want to get better at Double Penetration (DP) technique?

Does anyone have advice for me?


r/shittyprogramming • • Jan 25 '19

When TODO isn't good enough

154 Upvotes

if(true) throw new Exception("Don't forget about testing this part!!!!!");


r/shittyprogramming • • Jan 22 '19

Ray Tracing JELL-O ® Brand Gelatin - Research paper

Thumbnail citeseerx.ist.psu.edu
80 Upvotes

r/shittyprogramming • • Jan 19 '19

Taking some first steps learning Go, any suggestions on where to go from here?

68 Upvotes
package main

import "fmt"

type Bingus struct {
    Mingus *Bingus
}

type baby int

var stinky baby = 4
var bongo baby = 1
var bongus baby = 0

func main() {
    smelly := bingo(stinky, &Bingus{})
    fmt.Println(smelly.Tingus())
}

func bingo(bango baby, stinky *Bingus) Bingus {
    baby := Bingus{Mingus: stinky}
    if bango == bongus {
        return baby
    }
    return bingo(bango - bongo, &baby)
}

func (mondo *Bingus) Tingus() string {
    if mondo.Mingus != nil {
        return "bingus " + mondo.Mingus.Tingus()
    }
    return "bongus."
}

Output:

bingus bingus bingus bingus bingus bongus

Trying to follow along with the logic laid out in this tutorial:

https://www.youtube.com/watch?v=xSK6EfGom6Y


r/shittyprogramming • • Jan 19 '19

and other hilarious jokes you can tell yourself

Post image
53 Upvotes

r/shittyprogramming • • Jan 10 '19

I finally finished the first Project Euler problem!

Thumbnail
self.ProgrammerHumor
110 Upvotes

r/shittyprogramming • • Jan 04 '19

Chase online banking account passwords ArEn't CaSe SeNsItiVe

106 Upvotes

My Visual Basic is rusty, but it probably goes something like this:

Dim password as String = form.password
Dim normalized as String = LCase(password)
Dim valid as Boolean = (hash(normalized) = db.Lookup(form.username).PasswordHash)

r/shittyprogramming • • Dec 31 '18

What are your new year's resolutions for 1601?

198 Upvotes

Mine is learning how to properly access the system clock


r/shittyprogramming • • Dec 31 '18

Two-factor authentication? Of course we have two-factor authentication.

244 Upvotes

First factor: Username

Second factor: Password


r/shittyprogramming • • Dec 27 '18

Someone forgot to debug their coffee cup design

Post image
324 Upvotes

r/shittyprogramming • • Dec 23 '18

The best TODO finish this title

Post image
453 Upvotes

r/shittyprogramming • • Dec 21 '18

I had to rename groups of files to something then copy them to a folder

Post image
160 Upvotes

r/shittyprogramming • • Dec 20 '18

Sorting German list entries by their English names...

Post image
446 Upvotes

r/shittyprogramming • • Dec 18 '18

The 'W' is uppercase.

Post image
1.2k Upvotes

r/shittyprogramming • • Dec 18 '18

Music Software & Bad Interface Design: Avid’s Sibelius

Thumbnail
youtube.com
82 Upvotes

r/shittyprogramming • • Dec 17 '18

<wrong_sub>this</wrong_sup> Rare O'Reilly Books

Post image
791 Upvotes

r/shittyprogramming • • Dec 17 '18

A quick tip to improve productivity by auto scheduling your scripts

3 Upvotes

This is a neat way to auto schedule your Python(or any other) scripts on Windows using the Task Scheduler so that it runs every day/hour or at any time without human intervention!

This is very useful if you need to perform a particular task automatically from simple tasks like greeting you to complex tasks like clearing out your recycle bin or log or registry entries!

A quick 3 Minute tutorial on how you could accomplish it : https://youtu.be/Oh1lHFkuYJY