Skip to content
DevMeme
5081 of 7435
JavaScript Trauma Fuels Static Typing Obsession
Languages Post #5561, on Oct 5, 2023 in TG

JavaScript Trauma Fuels Static Typing Obsession

Why is this Languages meme funny?

Level 1: Once Burned, Twice Shy

Imagine you touched a hot stove when you were little and burned your hand. Ouch! 😢 That probably scared you quite a bit. After that one bad experience, you might decide “Stoves are dangerous, I never want to go near a stove again. In fact, all hot things are bad!” Now, is that really true? Not all hot things will hurt you – a warm cup of cocoa won’t burn if you’re careful, and stoves, when used properly, help cook yummy food. But because you got hurt once, you feel a big fear of anything similar. You insist on eating only cold sandwiches and ice cream, because you think heat = bad no matter what.

That’s basically what’s happening in this joke. A developer once got “burned” by a programming experience (it was painful, like the stove burn). In their case, the “hot stove” was writing code in a language where the computer didn’t warn about certain mistakes (so the mistakes caused problems later, which was scary for them). Now they’ve become afraid and say, “anything like that must be bad!” It’s a funny exaggeration – we know not every situation will be like that first bad time, but the person’s fear makes them overreact and declare “never again!” just like someone avoiding all stoves after a burn. We find it humorous because we understand the feeling of being once bitten and then overly cautious, even if it’s a bit silly to paint everything with the same brush. The meme makes us smile, because we see a little of ourselves being comically over-protective after a bad surprise.

Level 2: Safety vs Flexibility

Let’s break down the technical bits here. The meme is contrasting static typing and dynamic typing, so it helps to know what those terms mean. In a statically typed language, the type of each variable or expression is known at compile time (before the program runs). For example, in a statically typed language like Java, C#, or TypeScript, you might declare a variable and its type explicitly:

int count = 5;

Here the compiler knows count is an integer, and it won’t let you treat count as, say, a string later on. If somewhere in your code you try to do something that doesn’t make sense for an integer, like count.toUpperCase(), the compiler will throw an error before you even run the program. This acts as a safeguard – many mistakes are caught early by the compiler’s type checker. It’s like having a strict teacher grading your homework (the code) and marking mistakes in red pen so you can fix them before the final presentation (running the program). This can greatly improve CodeQuality for large projects, because it’s harder to accidentally mix up data types or call functions with the wrong kind of data.

On the other side, dynamically typed languages (like JavaScript, Python, Ruby, or PHP) determine types at runtime, meaning you don’t declare them upfront and the language figures it out on the fly as the program runs. You could have a variable that starts as a number and later you assign a string to it, and that’s generally fine by the language. There’s no compile-time type check to stop you. The flexibility is great – you can prototype quickly without dealing with a compiler yelling about mismatched types – but the downside is you might only discover type-related bugs when the program is actually running (sometimes in production, eek!). It’s as if the teacher isn’t looking at your homework at all; you only find out you did something wrong during the final presentation itself, potentially in front of everyone.

Now, what about JavaScript (JS) specifically? JavaScript is a dynamically typed language, and also a weakly (loosely) typed one. Weakly typed means the language will implicitly convert types in certain operations instead of stopping you. This is a source of many “WAT?!” moments in JS. For example:

console.log("5" + 5);    // "55"  (JS converts the number 5 to string "5", then concatenates)
console.log("5" - 2);    // 3    (JS converts the string "5" to number 5, then subtracts 2)
console.log(5 == "5");   // true (loose equality `==` allows type coercion, so "5" becomes 5)
console.log(5 === "5");  // false (strict equality `===` checks type too, so number vs string is false)

Weird, right? Depending on the operator, JS sometimes treats strings as numbers or vice versa. If you’re not aware of these rules, you can get very confused why "5" + 5 didn’t yield 10. This kind of behavior can cause bugs that are hard to catch because the language won’t flag it as an error – it will just do something, and that something might not be what you intended. Developers jokingly refer to these quirks as part of “JS madness” or js_trauma in meme-speak. It’s the gotchas that bite you when you least expect it.

So what do developers do after being bitten a few times by such issues? Many turn to TypeScript (TS), which is basically JavaScript with static typing added. TypeScript lets you annotate your code with types and will check them at compile time, just like a statically typed language. For example, consider a simple JavaScript function:

// JavaScript (dynamic typing example)
function greet(name) {
  return "Hello, " + name.toUpperCase();
}

console.log(greet(42)); 
// This will run, but at runtime you'll get a TypeError: name.toUpperCase is not a function
// because 42 is a Number, and we tried to call a string method on it.

In pure JavaScript, the above code is totally legal to write. You won’t find out anything’s wrong until you actually run greet(42) and the program crashes or throws an error, because 42 (a number) doesn’t have a toUpperCase() method. Now, here’s how it looks in TypeScript:

// TypeScript (static typing example)
function greet(name: string): string {
  return "Hello, " + name.toUpperCase();
}

greet(42);
// Error: Argument of type 'number' is not assignable to parameter of type 'string'.

In TypeScript, we declared that name must be a string, and that the function will return a string. When we try to call greet(42), the TypeScript compiler immediately complains: we passed a number where a string is expected. Boom, caught at compile time! That’s a win for static typing — the bug is stopped before the code ever runs. This is the “safety” aspect static-type enthusiasts love. We avoided a potential runtime failure with a simple type check upfront.

Now, the meme jokes that this love of static typing can become an obsession, especially if it’s born from JavaScript trauma. It’s like after debugging countless unpredictable issues, a developer might say, “I’m never going back, static types only for me, thank you very much!” They might start dismissing DynamicTyping languages as inferior or “unsafe.” This attitude is what the meme highlights: "All dynamic typing must be bad." Of course, in reality dynamic typing isn’t inherently bad – it’s all about using the right tool for the job and managing its risks. A lot of experienced programmers actually use both kinds in different scenarios. For quick scripts or when doing data analysis, Python (dynamic) is fantastic because you can write less code and iterate faster. For huge, mission-critical software, something like Java or Rust (static) can provide that extra confidence in correctness and maintainability.

The “knee-jerk reaction” mentioned in the meme text refers to an automatic, emotional response. Here it implies the developer’s preference for static typing might not come purely from rational comparison, but from an emotional place – being fed up with JavaScript’s loosey-goosey nature. We have a term “strong opinions, loosely held” in tech, but sometimes after a bad experience those opinions become strongly held, period 😅. The meme laughs at the idea that instead of calmly saying “Well, maybe I prefer static typing because it suits large projects better and I had some bad bugs in JS,” the person jumps straight to “Dynamic typing = bad, full stop!” That’s a big generalization. It’s funny because it’s like someone declaring a LanguageWar based on personal scars. And indeed, if you’ve ever browsed programming forums or Twitter, you’ll see folks heatedly debating TypeSafety in exactly this black-and-white manner. One side says, “If you’re not using static types, you’re writing bug-ridden code and you don’t even know it!” The other side might retort, “Static types are a straitjacket; I can achieve the same reliability with tests, and I can move faster.” Round and round it goes. These are the classic LanguageWars the tags mention — passionate debates often fueled more by pride and anecdotes than objective data.

The meme is squarely poking fun at the static-type side when taken to an extreme. It doesn’t say static typing is bad (indeed, the scenario assumes static typing feels like salvation to that dev). Rather, it’s the dismissal of the other side that’s the joke. We see this kind of sentiment in tech a lot: e.g., a developer had a nightmare with PHP, so now they claim “PHP is the worst language ever” and refuse to touch it or any similar dynamically typed, interpreted language. The truth is, any language can cause pain if used in the wrong context or without proper discipline, and any language can also be made to work with enough effort. But it’s way funnier to exaggerate it — hence "NO, all dynamic typing must be bad." It’s a hyperbolic way to say, “I refuse to even consider that my stance might be influenced by past pain; I’m just going to label the entire category as bad.”

Also, a quick note on the Simpsons Skinner meme format: It’s visually a two-panel scene from The Simpsons cartoon. Principal Skinner is shown thinking in the first panel (with the text overlay of his inner monologue), and then looking resolute in the second (with the text of his conclusion). Meme-makers love this format to depict someone rejecting a moment of self-reflection in favor of denial. Here, the trauma from JS is the cause for self-reflection, and the denial is writing off dynamic typing entirely. The bright blue sky and cartoon city in the background make it instantly recognizable and add to the comedic contrast: a serious confession of “trauma” on a silly cartoon image. It’s classic DeveloperHumor to take an emotional truth and package it in a lighthearted way. So even if you’re a junior dev, now you know: static vs dynamic typing is a hot topic, and this meme is a playful jab at how emotionally attached we programmers can get to our favorite tools, sometimes for reasons we don't admit openly (like that gnawing memory of a particularly nasty JavaScript bug 🙃). The takeaway: JavaScript (as a dynamic language) is fine and very powerful in capable hands (yes, even without TypeScript – hence the post message “JS is fine even without TS”), but our meme character is too scarred to agree, and that’s what makes it funny.

Level 3: Knee-Jerk Typecasting

This meme hits home for many seasoned devs because it satirizes a familiar character in the ongoing LanguageWars: the ex-JavaScript programmer who has swung to the extreme end of StaticTyping advocacy. Picture a developer who spent years wrestling with untyped JavaScript code – late-night debugging sessions chasing down undefined is not a function errors, data type mix-ups causing weird bugs, and a general feeling that their code was a fragile Jenga tower ready to collapse. That kind of experience can indeed be traumatic in a developer sense. We jokingly call it "JS PTSD" (with a wink to real PTSD, though of course it's an exaggeration in this context) when someone has been burned so many times by JavaScript’s dynamic quirks that they develop a reflexive aversion to anything without a compiler-enforced type system. This meme’s first panel captures that flicker of introspection: “Could it be that my obsession with static typing is actually a knee-jerk reaction to trauma caused by JS?” – it’s Principal Skinner (from The Simpsons) momentarily considering that maybe he’s the one out of touch (a riff on the classic scene where he asks, “Am I so out of touch? No, it's the children who are wrong.”). Here, Principal Skinner personifies the stubborn developer archetype. He almost realizes, “Hmm, perhaps my zealous love of static types isn’t purely objective truth, but rather trauma talking.” That’s a pretty mature self-assessment… which he immediately throws out the window in the next panel.

In the second half, Skinner stands firm and declares, “No, all dynamic typing must be bad.” 😂 This punchline is funny because we recognize the exaggeration: instead of acknowledging any nuance, he doubles down on an over-simplified conviction. It’s the equivalent of someone saying, “I had a terrible experience with one JavaScript project, therefore all dynamically-typed languages are garbage.” It lampoons that black-and-white mentality. Developers with some battle scars often fall into this trap. For instance, a programmer might spend months untangling a messy untyped Python or JS codebase (perhaps dealing with mysterious runtime crashes because an API returned {} instead of the expected array, and nothing in the code explicitly said what type to expect). Exhausted and frustrated, they emerge from the ordeal swearing allegiance to the strictest compiler they can find. Suddenly TypeSafety becomes their holy grail for CodeQuality: they start evangelizing languages like TypeScript, Java, Rust, or Kotlin – anything that will yell at them at compile time if they even think of mixing up types. The meme pokes fun at this almost religious conversion experience. It’s the “I’ve seen things, man, horrible things in JavaScript… never again!” energy.

The humor also lies in the dismissal of dynamic typing as an overreaction. Anyone who has been around different languages knows that dynamic typing isn’t “all bad.” In fact, many developers enjoy dynamically typed languages for their DeveloperExperience (DX): they can be more flexible and faster for prototyping. Think about why JavaScript became so popular in the first place – it was easy to write small scripts without a lot of ceremony. No compiling, no worrying about strict type definitions for every little variable – just write and run. That immediate feedback loop and agility is great for certain tasks. But scale that up to a huge application with dozens of developers, and the lack of upfront structure can lead to the infamous “JavaScript jungle,” where you’re unsure what type of data is flowing through functions, and one misuse can crash the whole app at runtime. The meme zeroes in on a developer who has lived through that jungle and made it out alive, albeit a bit scarred.

The “static-typing obsession” mentioned is something like an engineer’s coping mechanism. Having a compiler as a safety net can feel like finally getting a sturdy leash on a hyperactive dog that used to yank you all over the park. Suddenly that chaos is under control – the code won’t even compile if something doesn’t match the expected types. It’s a relief! Developers often describe moving from JavaScript to TypeScript (or to a language like C# or Go) as a kind of stress reduction: “Now I can sleep at night, the compiler has my back.” The meme character clearly felt this relief and then some – he’s become dismissive of any code that doesn’t have those guarantees. It’s like someone who had a bad experience with raw pointers in C and runs screaming to a garbage-collected language, then proclaims all manual memory management is evil incarnate. There’s a kernel of truth (manual memory is hard and risky), but the all-or-nothing stance is humorous because of its absolutism.

Within developer culture, this rigid stance is a known trope. We joke about the person who responds to any JavaScript problem with “just use TypeScript, problem solved,” or the ones who call Python “a toy” because it doesn’t force static types at compile time. It’s a form of confirmation bias – after suffering failures in one paradigm, they attribute all those problems solely to the lack of static types, and then see static typing as the silver bullet for any future problem. Realistically, that’s an oversimplification. Plenty of dynamic language projects succeed, and conversely, static languages have their own pitfalls (ever debug a NullPointerException in Java or fight the compiler because your use-case doesn’t fit its strict type rules? It’s not always sunshine and rainbows). Senior developers tend to learn that each approach has trade-offs: for example, static typing can indeed catch a lot of bugs early and make code maintenance safer (and provide awesome IDE auto-complete, which improves DX), but it can also make simple tasks more verbose and rigid. Dynamic typing gives you quick iteration and simplicity at the cost of possibly more bugs slipping through if you’re not careful with testing. The meme is funny because Skinner’s character blatantly ignores this nuance even when it’s staring him in the face (literally, his own thought was admitting it might be a knee-jerk reaction!). Instead, he personifies the stubborner side of the tech community that loves to declare, “my way is the One True Way.” We laugh because many of us have encountered that person – or have even been that person at some stage in our careers – and we recognize the mix of truth and exaggeration.

Another layer of humor is the Simpsons meme format itself. The scene is a direct parody of Skinner’s famous quote, “No, it’s the children who are wrong,” which has become an internet shorthand for someone refusing to accept they might be the problem. In this developer twist, Skinner (the dev) contemplates if his fanatic love of static typing is out of touch, then immediately rejects that idea, effectively saying, “No, it’s dynamic typing that’s the problem, not me.” It’s a perfect fit because it shows the irrational denial. The bright cartoon backdrop and Skinner’s exaggerated pose accentuate the comedic tone. We as viewers understand that the rational conclusion would be “hmm, maybe I overdid the static typing thing because of bad experiences,” but seeing him defiantly conclude the opposite gives us that ironic laugh. It’s lampooning the ego and emotional baggage that developers sometimes carry with their tooling choices.

In practice, I’ve heard conversations that mirror this meme almost verbatim. Imagine a team discussion: someone suggests using Python for a quick script, and a battle-hardened colleague immediately interjects, “Python? No way, dynamic types will come back to bite us. We need Java/Go/TypeScript, something with a compiler!” If you probe a bit, you find out that colleague once spent days tracking down a bug caused by a wrong type in a JavaScript app, and now they’re extremely wary. Their experience is valid, but the resulting stance can be a little extreme. The meme playfully calls out that bias – it’s basically saying, “Hey, you might want to examine why you’re so averse to dynamic typing… could it be feelings rather than pure facts?” Then it shows the answer: “Nope! Must be that all dynamic typing is inherently bad.” That jump to conclusion is what makes it DeveloperHumor gold, especially for those of us who’ve been in the industry long enough to see this pattern recur. We laugh, and maybe we also cringe a tiny bit, because it hits on a real tendency to let past pain dictate our technology prejudices. In short, the meme uses a classic cartoon moment to roast the knee-jerk static typing purist in all of us, highlighting how easily a rough stint with JavaScript (JS) can flip someone from “JavaScript is fine” to “never again without TypeScript!” faster than you can say console.log("Hello, world");.

Level 4: Type Soundness Under Fire

In the world of programming language theory, static typing vs dynamic typing is a fundamental design trade-off often framed in terms of type soundness. A statically typed language enforces type rules at compile-time, aiming to guarantee that certain type errors cannot occur at runtime. There's an academic mantra: "well-typed programs can't go wrong" – originally quipped in a 1974 paper by Robin Milner – meaning if your code passes the compiler's strict type checks, it won’t hit type mismatches when running. This slogan is a bit tongue-in-cheek (programs can still go wrong in other ways, like logic bugs or runtime exceptions outside type checking), but it captures the essence: static types provide a mathematical safety net. Under the hood, compilers for static languages (from C++ to Haskell) use formal rules to ensure type safety (often proved via the Progress and Preservation theorems in type theory). In simple terms, Progress means a well-typed program can always take a step (it won’t suddenly get stuck on a type error), and Preservation means those steps never break the type rules (types of values are preserved as execution proceeds). These guarantees are like armor – ensuring that certain classes of bugs (like calling a string method on a number) are statically impossible. No matter how large the codebase, if it compiles, you have a proof (of sorts) that those type errors won’t bite you in production.

On the flip side, dynamically typed languages perform type checks at runtime, or sometimes not at all until an operation fails. They correspond more closely to the untyped λ-calculus (with values carrying runtime type tags) where any operation is allowed and you only find out if it was valid when you run the code. This gives a great deal of flexibility – you can compose functions and data structures in more ad-hoc ways – but you don’t get the compile-time guarantees. Academically, you might say dynamic languages maximize expressiveness and completeness: they’ll try to run any program you throw at them (they’re complete in the sense that they don’t reject programs that might actually be okay), but they sacrifice static soundness (nothing stops you from writing something type-risky). A static type system, in contrast, is intentionally conservative – it rejects some programs that would work at runtime, in order to guarantee that all the programs it does accept won’t encounter type errors. This is a classic completeness vs. soundness trade-off. The developer in this meme has clearly been burned by the unsoundness side of the bargain: JavaScript, being dynamically (and loosely) typed, let them write code that blew up later. Their trauma, viewed through a theoretical lens, is essentially a reaction to the absence of a strong static guarantee in JavaScript.

From an academic perspective, this scenario could also be seen as encountering the limits of an unsound type system. JavaScript will cheerfully perform bizarre implicit type conversions (like treating [] as 0 in numeric contexts, or turning the number 5 and string "5" into "55" when using the + operator) due to its weak typing (loose coercion rules). This can violate a programmer’s mental model of type consistency, creating a cognitive dissonance that is – in a lighthearted sense – “traumatic.” The knee-jerk retreat to strictly typed languages is like seeking refuge in a fortress of formal rules. After all, languages with strong static type systems (think of Rust, Haskell, or adopting TypeScript in the JavaScript ecosystem) act like meticulous gatekeepers: they refuse to even run your program if something as small as a type mismatch is detected. The meme humorously exposes a common over-correction: fleeing to the utmost end of the static spectrum as a remedy for the wild freedom of dynamic typing.

From a programming language evolution standpoint, this pendulum swing has happened before. In the early days, languages like Lisp (dynamic) and Algol or Pascal (static) offered starkly different developer experiences. Through the decades, we’ve seen cycles: the flexibility of dynamic scripting (Perl, Ruby, vanilla JavaScript) becoming popular for rapid development, then a swing back as large codebases provoke demand for better tooling and reliability (enter Java in the enterprise 90s, or TypeScript for JavaScript in the 2010s). There’s even a field of research on gradual typing – finding a middle ground by allowing optional type annotations, so you can mix static and dynamic approaches. TypeScript is a prime real-world example: it lets you add types to JavaScript incrementally, effectively treating static typing as a trauma therapy for big JS codebases. (Funnily, it’s like giving JavaScript a comforting blanket of types to calm its erratic runtime behavior.) The meme’s protagonist, however, has taken an absolutist stance – rejecting dynamic typing outright – which reflects a kind of binary thinking not uncommon in tech, but at odds with the nuanced continuum that language theory recognizes. In truth, both static and dynamic typing have their theoretical merits and intrinsic limitations. The humor at this deep level comes from the developer’s logical fallacy: a form of overgeneralization (one might say post hoc ergo propter hoc in fancy terms) where they conclude “dynamic bad” from “JavaScript hurt me,” without acknowledging the broader context or the possibility of a more balanced middle ground. It’s a reminder of the almost philosophical debates underpinning everyday coding – a battle between the certainty of types and the freedom of untyped code, playing out not just in systems and proofs but in the hearts of developers too.

Description

This is a two-panel meme using the 'Principal Skinner's Pathetic Fallacy' format from The Simpsons. In the first panel, Principal Skinner is looking thoughtfully out a window with the text: 'COULD IT BE THAT MY OBSESSION WITH STATIC TYPING IS ACTUALLY A KNEE-JERK REACTION TO TRAUMA CAUSED BY JS?'. In the second panel, he has a moment of realization and quickly dismisses the thought, saying, 'NO, ALL DYNAMIC TYPING MUST BE BAD'. The meme humorously captures the sentiment of developers who have experienced the pitfalls of JavaScript's dynamic and loosely-typed nature, such as unexpected runtime errors. It suggests that their strong preference for static typing (found in languages like TypeScript) is less a purely objective choice and more of an emotional overcorrection born from the 'trauma' of debugging JavaScript

Comments

98
Anonymous ★ Top Pick The five stages of JS grief: denial, anger, bargaining for a lodash function, depression when you see '[] + {}', and finally, acceptance... of TypeScript
  1. Anonymous ★ Top Pick

    The five stages of JS grief: denial, anger, bargaining for a lodash function, depression when you see '[] + {}', and finally, acceptance... of TypeScript

  2. Anonymous

    I swear I’m not anti-dynamic… it’s just that every time I remember chasing “undefined is not a function” at 2 a.m. on Node 0.12, my fight-or-flight response autogenerates 300 lines of TypeScript generics

  3. Anonymous

    After spending three days debugging a production issue caused by '[] + {} === '[object Object]', you too would start treating every untyped variable like it's carrying a ticking time bomb. The real trauma isn't the dynamic typing - it's explaining to the CTO why a simple equality check brought down the payment service

  4. Anonymous

    After years of debugging 'undefined is not a function' at 3 AM in production, many senior engineers develop what psychologists call 'JavaScript PTSD' - a condition where the mere sight of 'any' in TypeScript triggers fight-or-flight responses. The real irony? We've now created type systems so complex that the type errors are harder to debug than the runtime errors we were trying to avoid. Perhaps the real trauma was the friends we made along the way... in the #typescript-help channel

  5. Anonymous

    JS trauma so real, static typing feels like compile-time bail bondsman for your runtime felonies

  6. Anonymous

    After enough JS, you realize static types are prepaid incident credits: a compiler screaming “Type ‘never’ is not assignable” beats prod screaming “undefined is not a function.”

  7. Anonymous

    Policy update: after double-equals took prod down, we encode invariants in the type system - and politely ignore that TypeScript erases them at runtime

  8. @JManray 2y

    JS is disgusting

  9. @JManray 2y

    Full stop

  10. @deadgnom32 2y

    it's trauma caused by Java

    1. @dsmagikswsa 2y

      Java-Script

    2. @JManray 2y

      I'm a Java dev and I fucking hate Java. I would still rather be in Java than JS. Shits gross

      1. @RiedleroD 2y

        as a dev who (forcibly) uses java and javascript, yea

      2. @deadgnom32 2y

        it depends on the use case. I preach often, that JS is like mathematics, you must take care yourself, to not apply some operator to a wrong entity.

        1. @JManray 2y

          Imma be real chief, there is no use case for JS to me. It's cringe and should be eradicated

          1. @deadgnom32 2y

            let's say matrix multiplication. it's meaningless by itself it gains a meaning depending on case with square matrices, aka. linear operators, multiplication works like function composition. with adjacency matrices it shows common neighbors of two systems. but a diablo 1 map can also be displayed as 2D array, aka. matrix. if you multiply 2 maps you will get trash in result, even though interface can be applied. the same is with JS. you need to think what you do. not all can do it, many programmers can only scroll through hundreds of methods looking for one doing exactly the task they want to solve.

          2. @callofvoid0 2y

            then how would html5 games work ?

            1. @RiedleroD 2y

              wasm

          3. Deleted Account 2y

            for scripting it's better then lua

  11. @qwnick 2y

    They are all bad, tho

    1. Yuri 2y

      If they are all bad, maybe the problem is not with them...

      1. @qwnick 2y

        with them, cause static type PLs are not all bad

        1. @deadgnom32 2y

          ofc are they not. but you need static typing, where you need static typing, and you need dynamic typing, where you need dynamic. you don't need to generate hundreds of temlated classes where you just could use dynamic types.

          1. Deleted Account 2y

            just use agda haskell

            1. @deadgnom32 2y

              yes

            2. @deadgnom32 2y

              they help you do your work at least, instead of punching you in the stomach telling you something like "I know what you meant to do, but write it more explicit with more bloat code" oh yeah, great, the compiler understands me, but don't wanna be friends with meee

              1. @qwnick 2y

                Lol, and also you have to make sure that each method that accept string(or any other data type) will cut all other possible data types. gl with that

                1. @deadgnom32 2y

                  what?

                  1. @qwnick 2y

                    you wrote a method that compare 2 strings, user sent a integer and class into it, how will you handle it?

                    1. @deadgnom32 2y

                      throw an error. dude

                      1. @qwnick 2y

                        throw an error for what case?

                        1. @deadgnom32 2y

                          just fail fast ever heard of it?

                          1. @qwnick 2y

                            how much code do you need to write to decide is this error or not, and can it be casted in the string correctly?

                            1. @deadgnom32 2y

                              0

                              1. @qwnick 2y

                                bullshit XD

                                1. @deadgnom32 2y

                                  you just don't get how to do it

                                  1. @qwnick 2y

                                    tell me then

                2. @deadgnom32 2y

                  you misplaced it with Java

  12. @RiedleroD 2y

    …there's autocompletion for regular js too, yknow

    1. @x4erem6a 2y

      Yeah, powered by the typescript language server

      1. @RiedleroD 2y

        yep, but that doesn't mean you have to use ts

        1. @x4erem6a 2y

          You don't have to but if you're still relying on ts tooling there's little difference. The only advantage of using js is not having a build step, which is probably pointless because you will still use some kind of bundler/transpiler most of the time.

          1. @RiedleroD 2y

            will I though? what for. My php+nginx website runs good as is

  13. @RiedleroD 2y

    still exists for regular js, in my experience

  14. @RiedleroD 2y

    odd

  15. @Araalith 2y

    I use static typing because 'dynamic' is a type.

  16. @x4erem6a 2y

    Typescript compiler can typecheck js just as good as ts, it supports special jsdoc syntax for type annotations in comments.

  17. @RiedleroD 2y

    again, odd. It does work for me 🤷‍♂️

  18. @x4erem6a 2y

    Just create a tsconfig and set it to something like allowJS: true checkJS: true strict: true

    1. @RiedleroD 2y

      I don't have a tsconfig…

  19. @RiedleroD 2y

    kate with the regular ts LSP

    1. @RiedleroD 2y

      it's preconfigured, you just gotta get it to find your project root

  20. @x4erem6a 2y

    Your data is any, there's nothing to suggest. You should give it a type, just like in ts.

  21. @RiedleroD 2y

    because data is of type any here, obv you won't get far with js here. I get what you mean now, but that's not really a problem for me because of how I usually program js

  22. @RiedleroD 2y

    fair

  23. @pwnzkk 2y

    Both js and ts are cool. There are cases though when typing becomes too overcomplicated for some tricky functions and it doesn’t work, so I would say it’s cool to use typescript when typing and fighting with compilation errors is not 90% of your coding. Personally I love ts for its type system and js for flexibility, so just choose your poison :)

    1. @Araalith 2y

      For 'overcomplicated' cases (lets pretend they are real) you can resort to 'any'.

      1. @pwnzkk 2y

        right, you can always rely on any as a last resort

    2. @NaNmber 2y

      as unknown, then pass to typeguards / inline checks to narrow down type (without making runtime vulnerable)

  24. @anilakar 2y

    My coworker can't open other people's Python code without spending four hours writing type hints

  25. @deadgnom32 2y

    don't put number where string is expected

  26. @deadgnom32 2y

    let the service die in such case

  27. @deadgnom32 2y

    easy

  28. @deadgnom32 2y

    I did already

    1. @qwnick 2y

      you did not, you said that you will write 0 code to handle other data types

      1. @deadgnom32 2y

        you just don't handle them. you will get a compile error a forehead, and fix it, by not putting other data types into a function expecting string

        1. @qwnick 2y

          why would you get compile error?

          1. @deadgnom32 2y

            bc you put a number where none belongs to

  29. @deadgnom32 2y

    you just don't get it

  30. @qwnick 2y

    which is obviously bs

  31. @deadgnom32 2y

    that's it

  32. @qwnick 2y

    you don't have types to get compile error

    1. @deadgnom32 2y

      in haskell?

      1. @qwnick 2y

        no, I was talking about js

        1. @deadgnom32 2y

          https://t.me/dev_meme/5561?comment=93488

    2. @deadgnom32 2y

      dude. that's just funny

  33. @qwnick 2y

    or any other dynamic type in function definition language

  34. @deadgnom32 2y

    look precisely

  35. @deadgnom32 2y

    it's about haskell

    1. @qwnick 2y

      sry than, I meant that js suck, not haskell

      1. @deadgnom32 2y

        well. according JS why the hell should user do anything with code?

      2. @deadgnom32 2y

        it still can by weakly casted to something and executed somehow, but result will be trash if you dont put strings into it. the problem is not JS, it's a programmer

        1. @qwnick 2y

          There is bugs in any programmers code. Difference that it is much easier to catch if it's static typed language, compile error is much more comfortable to work with, unlike runtime error in prod

          1. @deadgnom32 2y

            this is pointless. yeah. you are right. that's why all the data scientists and engineers use pandas. they are just masochistic bastards who love to suffer. I get it.

          2. @deadgnom32 2y

            your cumfort is just bent to your use cases, until you run into one, where you will need to handle hundreds of types by hand, where just a generic Anything type is needed

            1. @qwnick 2y

              -> handle hundreds of types by hand what do you mean?

              1. @deadgnom32 2y

                if your interface is so abstract, that it can handle every or nearly every type in statically typed language you just use workarounds like upcast to a generic object or templating sugar, which generates every version of statically typed function bloating the binary. just take a dynamically typed language instead

                1. @qwnick 2y

                  took, you still have to handle hundreds of types by hand, but now you don't have compile error if you made a mistake somewhere XD

                  1. @deadgnom32 2y

                    no you don't

                  2. @deadgnom32 2y

                    you know, what invariants are for?

              2. @deadgnom32 2y

                ima data engineer, I do work with hella a lot of types on very few interfaces. static typing is just a lot of needless work. because oftentimes I just need the layout of the data independently of the type. I just don't care

                1. @deadgnom32 2y

                  if I do care, I can explicitly cast it to some type ensuring it invariantness, and then I just know, a string is a string. and never a number or anything. what can't be converted either makes the service instance die, that it intended and handled elsewhere, or just left out of the data set with a warning

          3. @deadgnom32 2y

            just use right tools for the right purpose

          4. @deadgnom32 2y

            and lastly, no. not every program has bugs there are methods to write mathematically probable algorithms. they always work correctly.

  36. @deadgnom32 2y

    you write function to compare 2 strings and put a number there well, why?

  37. @deadgnom32 2y

    if you don't, then let it be the end of the conversation, bc it's just pointless without knowing how to use invariants

  38. @ColonelPhantom 2y

    I never used JS and I'm still obsessed with static typing, checkmate atheists

  39. @golergka 2y

    It’s love caused by Haskell

Use J and K for navigation