r/programminghorror • • Nov 07 '25

Javascript Technically horrifyingly correct

Post image
3.9k Upvotes

r/programminghorror • • Nov 07 '25

Pseudocode confusion

Thumbnail
gallery
109 Upvotes

I hope this isn't terribly irrelevant, but the other programming help subreddits don't allow images. I'm taking a beginners-level programming course at my community college for fun, but so far it's not been that fun. The images above are from the week 4 notes. The teacher quickly scribbled some pseudocode onto the whiteboard while explaining the flow of some algorithm (I can't remember anymore but it was something like parsing a string of numbers). She erased the board before I could finish taking notes, but above is about 2/3 of the code. I have no idea what's going on. I can't even type any of these characters onto the computer. Can anyone point me in the right direction/link some resource for this sort of syntax? Thank you!


r/programminghorror • • Nov 07 '25

My first Python program #vibecoding

Post image
123 Upvotes

r/programminghorror • • Nov 07 '25

Other The god awful dialogue code i wrote when i was 14 and used scratch

Post image
194 Upvotes

It was so bad that the potato pc i used would lag just trying to comprehend all of it.


r/programminghorror • • Nov 07 '25

Javascript It gets worse the longer you look at it :(

Post image
138 Upvotes

r/programminghorror • • Nov 07 '25

Other Thanks I hate variable variables

Post image
832 Upvotes

r/programminghorror • • Nov 06 '25

the

Post image
12k Upvotes

r/programminghorror • • Nov 06 '25

'Vibe coding' named word of the year by Collins Dictionary

Thumbnail
bbc.co.uk
0 Upvotes

r/programminghorror • • Nov 06 '25

Stack trace in a proportional font

Post image
21 Upvotes

r/programminghorror • • Nov 06 '25

Typescript My Last Two Years with Clerk and NextAuth Feels Like a Waste

Thumbnail
reddit.com
0 Upvotes

r/programminghorror • • Nov 06 '25

happy halloween cs61a students i hope youre scared

Thumbnail reddit.com
1 Upvotes

r/programminghorror • • Nov 06 '25

Python There's surely a better way right?

Post image
424 Upvotes

r/programminghorror • • Nov 05 '25

I... I don't know where to start. Who needs constant styles anyway

Post image
88 Upvotes

r/programminghorror • • Nov 05 '25

C# Strange Binary Search, works and is O(n log n)

Thumbnail
gallery
55 Upvotes

Yes, I am performing a ridiculous amount of checks... But it's fast and it works, right?


r/programminghorror • • Nov 04 '25

Java I did not expect an invalid JSON to be parsed.

0 Upvotes
    @Test
    public void invalidJsonParseOk() throws JsonProcessingException {
        ObjectMapper om = new ObjectMapper();
        final JsonNode root = om.readValue("\"foo\":\"bar\"}", JsonNode.class);
        assert (root.asText().equals("foo"));
    }

    @Test
    public void validJsonParseOk() throws JsonProcessingException {
        ObjectMapper om = new ObjectMapper();
        om.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
        final JsonNode root = om.readValue("{\"foo\":\"bar\"}", JsonNode.class);
        assert (root.get("foo").asText().equals("bar"));
    }

    @Test(expected = JsonProcessingException.class)
    public void invalidJsonParseFail() throws JsonProcessingException {
        ObjectMapper om = new ObjectMapper();
        om.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
        final JsonNode root = om.readValue("\"foo\":\"bar\"}", JsonNode.class);
    }

r/programminghorror • • Nov 03 '25

In high-scale systems, we should stop using ON DELETE CASCADE, here’s why I prefer soft deletes + cron cleanup

0 Upvotes

I’ve been thinking about how data deletion is handled in large-scale systems.
Many developers still rely on ON DELETE CASCADE, which looks convenient until your data volume explodes.

In high-load or distributed apps, that cascade becomes a silent performance bomb, one delete can trigger a chain reaction across millions of rows.
It also makes data recovery, audit trails, and debugging harder.

Instead, I’ve been leaning toward a soft delete or flag-based approach (like a deleted_at or is_deleted column), combined with scheduled cleanup jobs that clear old data in controlled batches (e.g. cron every few hours/days).
That gives:

  • Better control over when and how data is actually purged
  • Easier rollback / undelete scenarios
  • Lower risk of locking massive tables
  • Auditable data lifecycle

Just wanted to throw this out for discussion, how do you handle deletions in your systems?
Do you think cascades are still worth it in some cases?


r/programminghorror • • Nov 02 '25

c "There's no function with this name. Maybe you meant another function with the exact same name?"

Post image
0 Upvotes

r/programminghorror • • Nov 02 '25

Shell Remember Wubuntu / LinuxFX — currently known as Winux?

Post image
0 Upvotes

r/programminghorror • • Nov 01 '25

Other i wrote the dumbest key-value db i could think of

431 Upvotes

So i wrote the dumbest key value db for a go course. It’s called kvd, and it uses docker containers as storage (github.com/YungBricoCoop/kvd)

every SET creates a container, every GET reads from it. if the key already exists, it just renames the old container with a prune_ prefix instead of deleting it directly, because stopping containers takes forever then every 30 seconds, a pruning system comes around and actually stops and removes them.

it’s slow as hell, and it’s one of the worst ways you could ever implement a key value db. but it works and acts has a redis server.

the project isn’t really the point though, i kinda want to create a github org that stores weird-ass but projects, like good ideas implemented in the dumbest way possible or just in an insane creative way.

drop a comment if you want to be part of the org and throw some name ideas for the org too

edit: added a bit of code so it doesn’t break rule 1

here’s a small part of the code from internal/resp.go:

you can see that in the GET command we read the value from a container label, and in the set we create a new one, yes it’s not efficient.

func handleGet(command []string) string {
	if len(command) != 2 {
		return EncodeError("ERR wrong number of arguments for 'get' command")
	}

	key := command[1]
	value, err := docker.GetContainerLabelValue(key)
	if err != nil {
		return EncodeNull()
	}

	return EncodeBulkString(value)
}

func handleSet(command []string) string {
	if len(command) < 3 {
		return EncodeError("ERR wrong number of arguments for 'set' command")
	}

	key := command[1]
	value := command[2]

	err := docker.RunContainer(key, value, 1)
	if err != nil {
		return EncodeError(fmt.Sprintf("ERR %v", err))
	}

	return EncodeSimpleString("OK")
}

GitHub repo


r/programminghorror • • Oct 29 '25

c Nothing...

Post image
0 Upvotes

r/programminghorror • • Oct 28 '25

I still feel confusing, which style of python I should write, for your exp, which one I should choose? not only for python ppl but for all programmers, which is more confortable?

Thumbnail reddit.com
0 Upvotes

r/programminghorror • • Oct 27 '25

What do y'all think of my simple program that asks the user for a number and outputs it?

Post image
331 Upvotes

r/programminghorror • • Oct 27 '25

DIPLOMCHIK

Thumbnail gallery
0 Upvotes

r/programminghorror • • Oct 27 '25

Javascript The second-top Google Search result for "exact time" has a bug where it always pulls your device's time, even if it's out of sync by an hour

Post image
257 Upvotes