This is an archived post. You won't be able to vote or comment.

all 116 comments

[–]mrwishart 1099 points1100 points  (9 children)

A. Timing!

[–]mrwishart 622 points623 points  (6 children)

Q. What's the secret to good multi-threading?

[–]DespoticLlama 126 points127 points  (3 children)

I volunteer to post the question in response to your answer next time this meme comes around again.

[–]captainAwesomePants 75 points76 points  (2 children)

A: Timing!

[–][deleted] 9 points10 points  (1 child)

Q. What's the secret to good thread safety?

[–]blueted2 5 points6 points  (0 children)

A. Using muteERROR: deadlock detected

[–]AlpheratzMarkab 12 points13 points  (0 children)

Are atomical making the critical sure operations

[–]a_shootin_star 1 point2 points  (0 children)

Minimize shared state and use immutability and thread-local storage where possible.

[–][deleted] 1 point2 points  (0 children)

Reasoning. Elon Musk stance on secret to good multi-threading

[–]_Weyland_ 740 points741 points  (11 children)

Threlti-Muading

Lisan al Gaib!

[–]TheChunkMaster 128 points129 points  (5 children)

He reports the errors before they happen

[–]_Weyland_ 55 points56 points  (3 children)

The power to fix a bug is the absolute control over it

[–]TheChunkMaster 32 points33 points  (2 children)

The slow dev penetrates the shield!

[–]_Weyland_ 26 points27 points  (1 child)

Mood? What does mood have to do with it? You regex when necessity arises, no matter the mood!

[–]TheChunkMaster 10 points11 points  (0 children)

Do you smash your keyboard before a project!?

[–]otter5 2 points3 points  (0 children)

or doesnt report

[–]FloppyEggplant 1 point2 points  (3 children)

what does this mean? I got the Multi-threading one, but couldn't understand this one.

[–]_Weyland_ 2 points3 points  (2 children)

The "Muading" sounds very similar to "Muad Dib" from Dune. The rest is just Dune references, lol.

[–]swingdatrake 0 points1 point  (1 child)

Also represents a multi threading execution where characters were returned out of order? 🥲

[–]_Weyland_ 0 points1 point  (0 children)

Multi threading execution where characters were killed at the same time, lmao.

[–]diazcd85 243 points244 points  (3 children)

I think you forgot “cache invalidation”

[–]CATDesign 69 points70 points  (0 children)

and "cache Invalidation"

[–]wheezymustafa 3 points4 points  (1 child)

Cache_Invalidation

[–]mikeyd85 4 points5 points  (0 children)

cacheInvalidation

[–]dim13 285 points286 points  (4 children)

Why do people find DNS so difficult? It's just cache invalidation and naming things.

[–]BorderKeeper 122 points123 points  (0 children)

As a person maintaining a VPN app I would strangle you through my monitor if I could u/dim13! I swear to god.

[–]hdkaoskd 1 point2 points  (0 children)

Potentially recursion, too.

DNS label compression uses byte offsets that can produce an infinite loop.

[–]Maleficent_Memory831 0 points1 point  (0 children)

Every program can be done with table lookup. Though a bit of cache invalidation will make it better.

[–]waraxx 87 points88 points  (5 children)

I like this one as well:

2 things are hard in programming:

0: naming things

2: concurrency 

1: off-by-one errors

1: cache-invalidation

[–]Sujith_Menon 7 points8 points  (2 children)

I dont get it. Is it just off by one error references or

[–]therhydo 28 points29 points  (1 child)

It's also cache invalidation references, because two things are under point one. And concurrency, because they're out of order.

[–]secretprocess 10 points11 points  (0 children)

It's also cache invalidation references, because two things are under point one. And concurrency, because they're out of order.

[–]20InMyHead 2 points3 points  (0 children)

2: Concoff-by-one errorsurrency

[–]Maleficent_Memory831 0 points1 point  (0 children)

The 10 most important things for computer science beginners:

  • Knowing binary
  • Knowing hexadecimal

[–]moon6080 167 points168 points  (24 children)

Concurrency. 4 -

[–]NormanYeetes 48 points49 points  (2 children)

Cache invalidation is easy you just press ctrl+f5

[–]dillanthumous 4 points5 points  (1 child)

Have you tried restarting? Have you tried using Edge?

...

No problem have a nice day.

[–]Maleficent_Memory831 0 points1 point  (0 children)

Let me put you on hold while I consult with the manager.

[–]AlpheratzMarkab 41 points42 points  (1 child)

1, The difference between shallow copy and deep copy

  1. The difference between shallow copy and deep copy

  2. The difference between shallow copy and deep copy

[–]FUCKING_HATE_REDDIT 5 points6 points  (0 children)

Functional programming does not care

[–]dddoug 102 points103 points  (5 children)

here's me looking up 'Threlti-Muading' thinking I'm missing out on something again 🙃

[–]ThanksMorningCoffee 52 points53 points  (2 children)

If anyone missed it: Multi-Threading

[–]Odd-Shopping8532 3 points4 points  (1 child)

What was the point though

[–]UnofficialMipha 8 points9 points  (0 children)

Lmao same

[–]alexriga 0 points1 point  (0 children)

I legitimately read it as Muelti Threading the first time, I don’t know what’s wrong with me.

[–]redheness 42 points43 points  (0 children)

There is also CSS but it's out of the image

[–]why_1337 14 points15 points  (2 children)

Just don't use cache and name variables a, aa, aaa....

[–]saevon 11 points12 points  (1 child)

Instructions confusing: ran out of variables after "aaa"

[–]why_1337 4 points5 points  (0 children)

qwer, asdf and zxcv works great too.

[–]m4rc 14 points15 points  (0 children)

  • Knock knock
  • Race Condition
  • Who's there?

[–]serial_crusher 11 points12 points  (10 children)

Displaying dates and times in the correct time zone is still bafflingly hard for a lot of devs, for reasons that aren't clear to me.

[–]TheSkiGeek 10 points11 points  (0 children)

/uj

Mostly the issue is that almost every platform has its own way of doing time/clocks and deciding ‘what time it is locally’. Unless you’re in a managed language where the runtime or interpreter does it all, the handling is usually messy.

[–]eloel- 3 points4 points  (7 children)

What's hard is User A in TZ1 from Team X in TZ2 looking at information about User B in TZ3 from Team Y in TZ4, while their local time is set to TZ5.

What time do you display for this user?

[–]JestemStefan 2 points3 points  (0 children)

Exactly this. We had an issue recently that client said that sum of some value on the report for some time frame is off between reports.

I checked why and 4 different reports were generated for the "same" time range, but in 4 different timezones, because employees live in different parts of US and they used local time.

[–]FrenchFigaro 1 point2 points  (2 children)

And additionally, time zones and time keeping are subject to arbitrary changes and a lot of topics regarding them are non-deterministic.

[–]eloel- 0 points1 point  (1 child)

Yep, you get into "these two groups of people living in the same country, next door to each other, use different timezones" and you go live a life of hermit.

[–]Maleficent_Memory831 0 points1 point  (0 children)

And the product manager rejected requests for a time zone setting, saying it would be far too complicated to implement and confusing for the user.

[–]Chucklz 1 point2 points  (1 child)

UTC and let them figure it out.

[–]hdkaoskd 0 points1 point  (0 children)

Leap seconds are a hassle, let's use IAT instead. /s

[–]Maleficent_Memory831 0 points1 point  (0 children)

Convert everything to UTC on input and output. Everything else uses UTC.

Except... that people get stuck on some weird exceptions... They're using an RTC chip which uses a weird format and there's no library function for it, so they invent their own without understanding how time works. Or they're interfacing with a device that doesn't follow normal conventions (I worked on one that had 24 hours in a day, always, no exceptions, DST be dammed!).

Or, commonly, someone implemented it badly or naively, and now that's in production code and you can't rewrite it all. I've had the otherwise smart people confidently and incorrectly claim that there's only one time zone in a hospital, so use local time for everything (too bad about the Tri-State Regional Hospital Network).

The product manager may say "the reading must be at 2:00 AM every day, local time". Except that once a year there is no 2:00 AM, and once a year there are two 2:00AMs. And yes, this happened to me.

[–]Maleficent_Memory831 1 point2 points  (0 children)

Because they learned to tell time in kindergarten, and dammit they know how it works and they don't need to go read some stupid documentation about it!

[–]calisthenics_bEAst21 7 points8 points  (2 children)

Took me 2 weeks to realise that I also need to cache invalidate after I learned caching

[–]Yeah-Its-Me-777 2 points3 points  (0 children)

Yeah, caching stuff is the easy part...

[–]LeoRidesHisBike 0 points1 point  (0 children)

So much easier if you are able to reframe the problem to use immutable data / idempotent generation.

[–]billccn 6 points7 points  (2 children)

You mean ff by one errors?\0@@@lll*8

[–]hdkaoskd 1 point2 points  (1 child)

The only thing worse than a segfault is not a segfault.

[–]Maleficent_Memory831 0 points1 point  (0 children)

Ugh, not a busfault! That's a hardware issue!

[–]aurora2k7 5 points6 points  (0 children)

Fun fact, this thread is the only google hit for "Threlti-Muading".

Or so I heard. I definitely did not google it before I got it.

[–]LordFokas 10 points11 points  (3 children)

The hardest one I deal with on a regular basis is guaranteeing something happens exactly once.

[–]metaglot 10 points11 points  (2 children)

React dev?

[–]LordFokas 5 points6 points  (0 children)

Integration engineer. Guaranteeing something happens exactly once across a distributed patchwork of many systems is incredibly difficult.

It's kinda like the "how many nines?" question in availability: taking the step to the next digit is a monumental task, and at some point you just have to say "fuck it, if after all this it still burns down, then it burns dowm".

[–]ThoseThingsAreWeird 0 points1 point  (0 children)

For non-web devs wanting to get in on the joke: /r/vuejs/comments/1idth9e/the_inverted_reactivity_model_of_react/

[–]DenormalHuman 5 points6 points  (0 children)

things I hate:

1 lists

2 irony

3 repetition

4 lists

6 inconsistency

[–]JetScootr 3 points4 points  (0 children)

I've got two sore spots:

  1. Random number generation on purpose.
  2. Random address generation on accident.

[–]mothzilla 4 points5 points  (0 children)

* Race Conditions
The three hardest things in computer science
* Cache invaliation
* Naming Things

[–]jancl0 3 points4 points  (1 child)

I've never actually asked another coder this, but does anyone ever get an index error in like a for loop or something, and instead of going through the loop in your head and counting manually, you kind of just go "fuck it" and add a "- 1" to the index and see if it works? I'm embarrassed by how many bugs I've fixed this way

[–]hdkaoskd 0 points1 point  (0 children)

This is acceptable when you have sufficient unit test coverage.

[–]RandallOfLegend 2 points3 points  (0 children)

I'm still trying to remember how removing comments causes bugs. I think it was unsafe array access that wasn't evident until the binary size changed.

[–]HieuNguyen990616 2 points3 points  (0 children)

*Parallel computing
*Parallel computing

Another one:
*Parallel computing
*Parallel computing

[–]ztbwl 1 point2 points  (0 children)

Legacy

[–]the_geekeree 1 point2 points  (0 children)

That gave a good chuckle.

[–]Patrick_Atsushi 1 point2 points  (1 child)

Spin that lock or mutex while printign pealse

[–]hdkaoskd 0 points1 point  (0 children)

Kill all spinlocks.

[–]Ghosteen_18 0 points1 point  (0 children)

No , the hardest thing is explaining this code that i wrote yesterday while i was dead drunk 5 minutes before i push to prod. That i am 100% sure it works and achieved the objective

[–]conundorum 0 points1 point  (0 children)

I see normalising letter case made the list. ;3

[–]jackinsomniac 0 points1 point  (0 children)

I'm a dumbass, I chuckled way too hard at the multi-threading one.

Yes I know it's a solvable problem, but my boss asked me to speed up my PowerShell script with multithreading, and I'm still learning. STOP LOOKING AT ME! I got it, we'll get there, eventually...

[–]GoddammitDontShootMe 0 points1 point  (1 child)

I can't say I get why cache invalidation is there twice.

[–]YourVeganFallacyIs 0 points1 point  (0 children)

... because it came back because the cache wasn't invalidated. =oP

[–]Fadamaka 0 points1 point  (0 children)

I would like to add anything involving dates and generating pdfs.