ProgrammerHumor

threeSimpleProblems

threeSimpleProblems
https://i.redd.it/hq74gzwv51df1.jpeg
Reddit

Discussion

mrwishart
:cs:

A. Timing!

10 hours ago
mrwishart
:cs:

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

10 hours ago
DespoticLlama

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

10 hours ago
captainAwesomePants

A: Timing!

7 hours ago
AlpheratzMarkab

Are atomical making the critical sure operations

6 hours ago
a_shootin_star

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

1 hour ago
Techno_Jargon

A. Timing!

6 hours ago
_Weyland_

Threlti-Muading

Lisan al Gaib!

9 hours ago
TheChunkMaster

He reports the errors before they happen

6 hours ago
_Weyland_

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

6 hours ago
TheChunkMaster

The slow dev penetrates the shield!

6 hours ago
_Weyland_

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

6 hours ago
TheChunkMaster

Do you smash your keyboard before a project!?

5 hours ago
otter5

or doesnt report

3 hours ago
diazcd85
:js:

I think you forgot “cache invalidation”

8 hours ago
CATDesign

and "cache Invalidation"

8 hours ago
wheezymustafa

Cache_Invalidation

26 minutes ago
mikeyd85

cacheInvalidation

7 minutes ago
moon6080

Concurrency. 4 -

10 hours ago
RiceBroad4552
:s:

This joke list is very old. It doesn't match reality since quite some time. imho.

Cache invalidation is actually not so difficult. (It's more that people forget it, but it's not difficult)

Naming things is a matter whether you're able to clearly communicate or not. But even for the people who can't, we have now brain prosthesis for that ("AI").

Off-by-one errors more or less can't happen in modern code. Who still writes naked loops instead of using at least iterators, or actually better, higher order combinators like map, filter, flatMap, etc. should better not touch any code at all.

The only really difficult thing here is in fact concurrency. Multi-threading is just a special case of that.

9 hours ago
xcookiekiller
:j:

What? No one who uses naked loops should touch any code at all? You know not everyone uses the same languages for the same purpose as you do, right?..

9 hours ago
RiceBroad4552
:s:

Which language doesn't have proper combinators, or at least iterators?

Even C++ has now "ranges"! Java has Streams. Any other usable language has something equal.

The only language that comes to mind which doesn't have such features is C. But using nowadays C in itself is almost always wrong anyway as there are almost no valid use-cases left.

7 hours ago
IloveBobbyFirmino

Damn this bait is so good it almost makes me want to type a legitimate response.

Do people practice ragebaiting or is this an inborn skill?

7 hours ago
RiceBroad4552
:s:

Just admit that you don't have anything meaningful to say. 😂

Especially no valid retribution.

---

It's again funny to see all the angry down-votes and at the same time having until now just one attempt to actually disprove the concrete claims, instead of some meaningless rhetoric.

(But I don't care as this mass forums are anyway not rational. You can say the exact same thing, sometimes even in the same (!) thread, and get complete opposite voting behavior.)

6 hours ago
IloveBobbyFirmino

The problem with baiting on the internet is that you will almost certainly hurt some people who are not as initiated in the space as you are.

For any students going through college right now please don't take comments like this seriously. If your curriculum has C in it, IT IS DEFINITELY NOT WASTED KNOWLEDGE and you should not despair learning a "useless language".

In the real world the goal is to produce as high quality software as fast as possible. The biggest constraint for this is knowledge of the language. The worst language in the world is fine if it allows you to solve your problem the fastest/best way possible.

However the statement above is especially ludicrous because it picks on C, the literal interface of the programming world..

Almost all devices from microcontrollers to supercomputers provide apis to interact with them using C. The language your operating system interfaces with hardware is written in C. C has a function call for every posix api call that is defined. Other languages often extern call in to C to achieve these things, knowing C will definitely never be a waste if you at all touch metal or anything concrete outside of academia where this notion of C being useless is propagated.

C has better performance than any non-natively compiled language. And before someone claims Rust is the same perf but safer, this is not true, C still outperform Rust because this safety is not always free.

C even has reasons to be used ahead of C++ (read about these differences and preferences from programming legends like Linus for example..)

5 hours ago
Zefrem23
:p:

The REAL problem with baiting on the internet is that even if you master it you're still just a master baiter.

1 hour ago
SphericalGoldfish
:cp:

Ha, nice try old man, but I see right through you. Everybody knows JavaScript does what C does but better!

1 hour ago
Qwertycube10

Not everyone loves in a utopia where they get to use the latest cpp version

7 hours ago
RiceBroad4552
:s:

OK, point taken! That's true.

It's not really the latest version, but one which is over half a decade old, but the time flows differently in C++ land…

But really, besides the infamous duo C/C++, there are almost no languages left without proper collection methods.

6 hours ago
Qwertycube10

Soon I will be able to use c++17, but stuck on 11 for now.

4 hours ago
saevon

Laughs in lua… or the dumbness of JS (one of the largest languages you'll likely interact with, often written by people who wouldn't know much programming).

Or when you're working with pointers for specific data structures, or kernel work, drivers, etc… where I see tons of off by ones in the code I worked with! The amount of circular buffers that I've seen skip an element in a specific edge case.…

Also to be clear, even if you have those features that doesn't mean you're using them correctly. So much of the code I've seen is in a transition period to using the newest features any day now… aaaaany day! Old code is just a given.

5 hours ago
RiceBroad4552
:s:

Lua has iterators with for ... in ... like Python. Of course there are also nice libs for more high level functionality.

JS has the usual basic collection operations OOTB, and quite some lib solutions for higher level constructs.

Embedded is still C/C++ land mostly. Here C is the exception I've already mentioned.

C++ has now generic ranges (even it's true that "just" 5 year old features are too new for quite some code-bases).

The newcomers in that corner, Rust and Zig, have both iterators, and Rust comes also with the typical collection methods out of the box.

I still don't know how you could create some of-by-one errors using this features, and not using them is just stupid, imho. In Rust, Zig, C++ it's literally zero cost, prevents bugs, and results in better readable code; it's a pure win!

4 hours ago
saevon

Lua is used in game mods in places, so you see lack of libraries and off by ones everywhere is what I mean. And as I said the issue with is the variance in skill of the users and projects not the literal languages.

a lot of the embedded work is maintaining older drivers too, so you can't just update. Often you have to be even big compatible. Good luck selling a rewrite just to update code

25 minutes ago
Techno_Jargon

Peepeepoopoo

6 hours ago
Mynameismikek

No. Accurate cache invalidation is pretty much impossible (at least in distributed systems). Any means of determining if a cache line SHOULD be invalidated takes as much time as just not having a cache.

Naming things is a form of compression. A very, very lossy form. By its nature a name cannot accurately describe what a complex thing is.

9 hours ago
RiceBroad4552
:s:

Accurate cache invalidation is pretty much impossible (at least in distributed systems).

If you add "distributed systems" one stops to be able to do anything reliably, actually. So this is just an empty statement.

The thing meant here is also usually not distributed systems…

Any means of determining if a cache line SHOULD be invalidated takes as much time as just not having a cache.

That's obvious nonsense, as otherwise using caches wouldn't make any sense at all.

In fact it's usually like: Building the cache is very expensive. (That's why you don't want to invalidate it more often than needed!) Using the cache is extremely cheap in comparison to not using the cache. Checking validity is reasonably cheap, so using the cache and doing the check is still cheaper than not using the cache. That are exactly the rules when to use a caching system. (Source: I've worked on such systems)

By its nature a name cannot accurately describe what a complex thing is.

At this point we're deep in philosophical territory, and at this point I could just claim that it's impossible to know anything at all (maybe besides that oneself exist somehow).

Such a line of reasoning left the field of engineering long ago…

7 hours ago
BigOnLogn

Invalidating a cache is not hard, but, by its nature, you will always get it wrong.

Same thing for naming things, no matter how good of a "communicator" you are, you will always lose something in the name.

Off-by-one can definitely still happen using iterators and functors.

I would argue cache invalidation is a concurrency problem. You are holding a value concurrent to it changing.

These problems are hard, not in their execution, but in their correctness. They are all, by nature, impossible to get "correct." Meaning you will always trade or lose something in their implementation.

Edit: I should clarify that the only "joke" problem here is the off-by-one error. It's entirely possible to get correct. It's just very easy to get distracted and make this mistake.

8 hours ago
RiceBroad4552
:s:

Invalidating a cache is not hard, but, by its nature, you will always get it wrong.

This must be the reason why no caching system in history ever worked… 🙄

Same thing for naming things, no matter how good of a "communicator" you are, you will always lose something in the name.

"Losing something" is not the problem. Words are compressed information, and information can't be arbitrary compressed. (Even we can't know the exact amount of maximal compression.)

The problem is that some people are incapable to name something correctly even remotely.

But as a mater of fact, I've seen properly named things in the past. So it's not impossible.

It's imho also not sooo hard, if you're able to clearly express your thoughts. Someone who writes computer programs should be able to do that, otherwise they're in the wrong business. And that's what makes the statement that "naming things is difficult" in the context of SW dev quite ridiculous. If you can't even do that, please just go away. Nobody will understand your code anyway if things aren't expressed clearly.

Off-by-one can definitely still happen using iterators and functors.

Maybe my fantasy is just too limited, but how can this happen?

Do you have some (realistic!) examples?

I would argue cache invalidation is a concurrency problem.

Depends. Only if concurrency is actually involved it's a concurrency problem. Otherwise not.

They are all, by nature, impossible to get "correct."

Depends on the definition of "correct".

If correct means "fulfills all requirement" it's very well possible to get things correct!

If you aim at some philosophical definition, well, that's out of the scope of engineering.

6 hours ago
BigOnLogn

If you aim at some philosophical definition, well, that's out of the scope of engineering.

That's what I said, friend. These problems aren't hard, in practical terms ("engineering"). They aren't "correct" either. They are just trade-offs (acceptable or otherwise).

The "hard problem" as mentioned in the original post isn't saying, "I can't make a business decision about these." They are hard theoretically and philosophically. They are "hard" because there is no one right answer.

You can't offer up a false premise and declare everyone else wrong.

5 hours ago
Murky-Type-5421

Damn bro, you wrote 5 paragraphs when you could have said "I have no real-world programming experience".

2 hours ago
BedlamiteSeer

Oh honey.

2 hours ago
dim13
:g::c::terraform:

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

9 hours ago
BorderKeeper

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

7 hours ago
Scared_Astronaut9377

What a cruel joke.

4 hours ago
dddoug

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

9 hours ago
ThanksMorningCoffee

If anyone missed it: Multi-Threading

7 hours ago
UnofficialMipha

Lmao same

6 hours ago
NormanYeetes

Cache invalidation is easy you just press ctrl+f5

8 hours ago
waraxx

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

8 hours ago
Sujith_Menon

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

4 hours ago
therhydo

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

2 hours ago
AlpheratzMarkab

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

6 hours ago
redheness
:p:

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

6 hours ago
why_1337
:cs:

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

7 hours ago
saevon

Instructions confusing: ran out of variables after "aaa"

5 hours ago
why_1337
:cs:

qwer, asdf and zxcv works great too.

5 hours ago
serial_crusher

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.

7 hours ago
TheSkiGeek

/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.

6 hours ago
m4rc
  • Knock knock
  • Race Condition
  • Who's there?
2 hours ago
LordFokas
:js::ts::j:

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

6 hours ago
metaglot

React dev?

5 hours ago
LordFokas
:js::ts::j:

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".

2 hours ago
ThoseThingsAreWeird
:js: :py:

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

3 hours ago
calisthenics_bEAst21

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

4 hours ago
Yeah-Its-Me-777

Yeah, caching stuff is the easy part...

4 hours ago
LeoRidesHisBike
:cs::ts::re::bash::c:

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

22 minutes ago
billccn

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

4 hours ago
DenormalHuman
:asm: :c: :cp: :j: :py: :unity:

things I hate:

1 lists

2 irony

3 repetition

4 lists

6 inconsistency

3 hours ago
JetScootr
:asm::c::ftn::bash::snoo_feelsgoodman:

I've got two sore spots:

  1. Random number generation on purpose.
  2. Random address generation on accident.
6 hours ago
mothzilla

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

1 hour ago
aurora2k7

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.

2 hours ago
ztbwl

Legacy

6 hours ago
InspectorGreen4547

I think the list has more humor when the items are numbered starting with 0.

3 hours ago
the_geekeree

That gave a good chuckle.

3 hours ago