this post was submitted on 15 Nov 2024
55 points (95.1% liked)

Programming Horror

2231 readers
1 users here now

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there's also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @Ategon@programming.dev

Rules

Credits

founded 2 years ago
MODERATORS
all 9 comments
sorted by: hot top controversial new old
[โ€“] python@programming.dev 19 points 1 year ago (1 children)

smh, could have used the short form ()=>{ instead of function ๐Ÿ˜ค

[โ€“] Deebster@programming.dev 12 points 1 year ago

I've been coding long enough that I still think of that as a fairly new thing in JS.

[โ€“] GBU_28@lemm.ee 10 points 1 year ago (1 children)

I WILL NOT USE ANOTHER LINE. I DON'T NEED IT

[โ€“] SpicyLizards@reddthat.com 5 points 1 year ago (1 children)

The best code has the fewest lines.

[โ€“] HelloHotel@lemmy.world 1 points 11 months ago* (last edited 11 months ago)

This is just as easy to write, just as sloppy but hopefully way easier to read.

Game.onload = (data)=>{
let a = data;
a = JSON.decode(a)["saveGame"][0];
a = JSON.decode(a)["SaveGame"];
return a;
}

Why settle on cammel case ("saveGame") or upper cammel case ("SaveGame") when you can have one of each?

[โ€“] Kissaki@programming.dev 10 points 1 year ago

In German we say "doppelt hรคlt besser". Is there an English saying like that? "Twice is stronger/more stable/holds better."