Duck Typing Crosses the Road
Description
A two-panel black-and-white line drawing shows a road scene annotated with code-like labels about chickens crossing a road. In the top panel, text says "a duck??? in the chicken function?? i must give a compiler error!!!" while a C# logo stands near labels such as "void ChickenCrossRoad(Chicken ...chicken)", "new Chicken()", and "new Duck()". In the bottom panel, the same scene says "i guess the road is bussy" with a JavaScript logo allowing "new Chicken()", "new Truck()", "new Cat()", and "new ElonMusk()" into `function ChickenCrossRoad(Chicken)`. The meme contrasts nominal/static type checking and compiler enforcement in C# with JavaScript's looser runtime behavior and duck-typing-adjacent permissiveness.
Comments
58Comment deleted
JavaScript saw a parameter name and treated it as stakeholder guidance, not a contract.
Bussy🤯☠☠☠ (Stands for boy-pussy) Comment deleted
damn i was thinking the same Comment deleted
Typical dev meme user Comment deleted
What compile error C# is talking about? And it's a void method, not a function. Comment deleted
Method is just a function, bounded to a class. So it is a function Comment deleted
the thing is it is void how can it return anything ? Comment deleted
Appropriate username Comment deleted
:-) Comment deleted
Void function changes state of a program, it is basically a return value, but indirectly Comment deleted
yes, if it does something on the argument or the object it is called on Comment deleted
Function returns result, otherwise it's a procedure. But anyway, C# has Func as a Delegate (with result) Comment deleted
Procedure, function, method, it's all different names in different languages to the same thing, if we break down to a pure math - we have just functions Comment deleted
bussy Comment deleted
What's the problem to check in JS case, if the "chicken" argument is instance of Chicken, and not something else? Comment deleted
TS exists for 11 years, but people are still blaming pure JS while using BS languages like Python or Lua Comment deleted
BS - BadaSs? Comment deleted
Yes. "I need your memory, CPU and all the time you have"... Comment deleted
it’s a matter of picking the right tool for the right job Comment deleted
lua, for instance, is amazing at being a plugin language Comment deleted
easy to embed, fast enough (especially if you’re using luajit), and pretty watertight in terms of sandboxing Comment deleted
Nope Comment deleted
Name a better tool Comment deleted
Even JS is a better tool then Lua. No really, Lua is a disaster in every way, but when it comes to debugging it's beyond terrible Comment deleted
Nothing beats js in the ability to bring suffering into one's life Comment deleted
Lua is an excellent, lightweight embeddable interpreter with a dogshit language strapped on. It's a lazy cop-out way for a dev to create extendable and scriptable programs. I meant, four dogshit languages strapped on. Every minor* version breaks things both in the syntax and standard library (yes, even string.gsub behaviour changes between releases) so you need to support all of them separately. A good custom wrapper for the standard library can alleviate a ton of issues with the language, but even in the exceptional case of devs adding in one, you gotta learn it from the beginning because it's not, well, standard. *) When you point this out, the main defense they have is that Lua is not using semver. Comment deleted
From my perspective, Lua is annoying because: - It implements its own syntax for basic operations that is incompatible with any other language (like string concatenation) - It doesn't limit global access to variables (the "S" in Lua supposedly stands for "Safety" and "Stability") - Debugging is worse than even debugging pure C - Every time I need something, it's either not implemented in Lua or implemented in the most bizarre way possible Comment deleted
Like I said, you have to write your own wrappers on top of the abysmally quirky standard lib. 🤣 When you google how to do something in Lua and end up in lua-users.org it's most probably a benchmark with fifteen different ways to do a simple thing. You need to manually create local temporary variables for speed, which is ridiculous. Or not use, say pairs() but next, foo to get more perf. Comment deleted
Sounds better than wasting your whole life on investigating some bullshit error in js Comment deleted
Easily getting fixed by try...catch block and logging the stack of the error Comment deleted
Sometimes it's something stupid to the point when you start to question common sense Like, all the languages dump maps into json as objects, but js, the origin of json, dumps them into ... fucking nothing I ain't no expert, but I have never ever faced as much bullshitery, as I face it every time when coding in js, and I switch stacks oh so often Comment deleted
There are known issues in all the programming languages and frameworks. I can remember dozens for C#, especially when it comes to async. Comment deleted
Eventloop is busy figuring out your life that's why Comment deleted
Yeah another crazy shit Only two languages that I truly hate: C# and JS Never tried TS tho, maybe I should give it a try Comment deleted
*Transsexual, of course, not js's offspring Comment deleted
Oh, I can name even more for Perl. Classic C is a just one huge trap, you can shot your leg with a simple string operation Comment deleted
Yo, but C's so smol, you learn it in a week or two in a sandbox and never really shoot your leg on production I love this tiny thing Comment deleted
Implicit type conversion rules in JS can be learned in 5 minutes, they are simple AF. But ppl crying for decades because of them. Comment deleted
Because you offer them to eat shit, claiming: "it's only for five minutes, and then you'll get used to it" Comment deleted
"I dreamed for all my life how I add a number to an object and compare the result with an array, JS ruined my dreams"... Comment deleted
I miss static typing😔 Comment deleted
TS Comment deleted
Why would I do TS instead of a real girl Kotlin? Comment deleted
I'm not familiar with Kotlin, but isn't it related to Java? Comment deleted
It is, as a base version, but it can be compiled into JS And Kotlin Multiplatform is a thing Comment deleted
If it honks like a duck, has shitty hair plugs like a duck, it clearly must be a duck. Comment deleted
Or whatever else not connected to js Comment deleted
very unfortunate typo Comment deleted
also why the fuck Comment deleted
are people going on a full internet debate Comment deleted
Return times / Normalize long-form debates in Internet! Comment deleted
We have it and it was perfect! Comment deleted
This is also a meme Comment deleted
it's a meme Comment deleted
Bla bla bla… the first time I got into programming was with LUA (one of the few good things that Rio de Janeiro has to offer). Comment deleted
I got into programming by large degree thanks to lua in cheat engine Comment deleted
i got into the whole it stuff due to clabretro Comment deleted
I used LUA to learn how to work with a private Tibia server. Best time of my life 🥺 Comment deleted