Bugs
Post #4399 · source on Telegram
The 'Works on My Machine' Defense
Description
This meme likely depicts the classic developer excuse, 'It works on my machine.' It probably contrasts a developer's pristine, controlled local environment with the chaotic, unpredictable reality of the production server. The humor stems from the universal experience of environment-specific bugs and the difficulty of reproducing issues that only appear in production. For senior engineers, it's a knowing nod to the importance of environment parity and the genesis of containerization technologies like Docker, which were created to solve this very problem
Use J and K for navigation
Comments
40Comment deleted
'It works on my machine' is the developer's version of a get-out-of-jail-free card, except the jail is a P1 incident call at 3 AM and the card is on fire
Corporate mandated 100% doc coverage, so the generator now proudly explains that valueOf() “returns a number as a number.” Next sprint we’ll clarify that our microservice “responds to HTTP as HTTP.”
After 20 years in the industry, I've learned that the most accurate documentation is often the one that tells you absolutely nothing useful - like valueOf() returning a number as a number, or that time our API docs explained that getUser() 'gets the user.' At least it's technically correct, which is the best kind of correct in enterprise documentation reviews
Docs like this are why seniors read the spec: valueOf() returns a number as a number, presumably as opposed to returning it as a disappointment
Ah yes, valueOf() - the method that perfectly encapsulates the JavaScript documentation experience: technically correct, completely unhelpful, and leaving you wondering if the real value was the type coercion confusion we made along the way. It's like explaining that parseInt() 'parses an integer into an integer' - sure, it's accurate if you squint and ignore boxing, unboxing, and the entire reason wrapper objects exist in the first place
valueOf(): returns a boxed Integer so your loop pays autoboxing tax - profound as floor being floor
Nothing screams autogenerated docs like explaining Number.prototype.valueOf - whose sole job is to help ToPrimitive unwrap new Number(42) to 42 - as 'returns a number as a number'
Translation for seniors: Number.prototype.valueOf just unwraps the boxed Number to a primitive - the silent ToPrimitive that makes == terrifying and === mandatory
toString() method Returns string as a string Comment deleted
Why there are new Number and new String? What are the use case? Comment deleted
for keeping garage collector busy Comment deleted
String s1="foo"; literal will go in StringPool and s1 will refer. String s2="foo"; this time it will check "foo" literal is already available in StringPool or not as now it exist so s2 will refer the same literal. String s3=new String("foo"); "foo" literal will be created in StringPool first then through string arg constructor String Object will be created i.e "foo" in the heap due to object creation through new operator then s3 will refer it. String s4=new String("foo"); same as s3 so System.out.println(s1==s2); //true due to literal comparison. and System.out.println(s3==s4);// false due to object comparison(s3 and s4 is created at different places in heap) So you are right. Comment deleted
I thought about constructors without arguments but this is funny too. Comment deleted
Well it's pretty standard logic for js, python and other pseudo programming languages Comment deleted
You have shown your pseudo genius, remarkable :) Comment deleted
I do not pretend that I'm genius. But python pretends that it is programming language Comment deleted
How do you define a "real" programming language? Is Assembler "true enough" for you to be a "real" programming language? Your point of view is as radical as the one's who claims html is a programming language. And, as you may already know, the truth is somewhere in the middle. Comment deleted
i am gay, and also python is the one real lang Comment deleted
Programming language has strict rules that allows you to understand compiler and vice versa. When you code in python, js or another dynamic shit there is nothing determined, anything can be anything. It reduces ability to show appropriate error message, make optimizations and so on. "Code" written with such assumptions can easily be broken just because unexpected type was inserted and funny thing, you probably will get no appropriate error message Comment deleted
How does typing affect the definition of a programming language or defines some programming language as real or not? If someone was as bad at making logical assumptions as you are now and if I were you, I'd say that anyone who makes such assumptions is a bad programmer - because you can't write a good program if you're making bad assumptions. But it won't be true. You may be very good at programming but you probably just had a bad experience with it and now you're trying to make some people feel uncomfortable just because you felt that way before and you want some revenge for these feelings. That said, I'm pretty sure there are millions of people working with dynamically typed languages and having almost no issues as in specific use cases dynamically types (and, also interpreted - another possible "falsey" language kind?) languages are just fine. People create useful programs using these languages, they are very popular, having great communities and are used not only in programming, but in other areas, like data science as well. People are happy to use them. It all comes down to you and, to be honest, it's really confusing. Why would one hate a hammer (simple tool) for not being able to produce cars properly? You can have it in almost every house and can do simple and useful things. Did you want to use just a hammer for building a skyscraper? Is that a problem of a tool or the one who selected it? Comment deleted
jeez you didn't have to destroy his point like that. I mean, you're right in ways I didn't even think of Comment deleted
my two cents in this debate is: you may like or dislike any programming language, but that doesn't make it less of one. JavaScript is as much a programming language as Rust, even though I would never voluntarily use the former if there's any way to avoid it. Comment deleted
Yeah so I was wondering when JavaScript became a programming language and what was the critical change to be a programming language instead of a scripting language Comment deleted
scripting languages are programming languages. Comment deleted
80% of your answer is water, but I like example with hammer, for some reason I find it as true. If we think of hammer as python or js it can be used in a lot of situations, but will be pretty stupid to use it with anything but nails. The reason why those languages are "bad" because people make technical debt using it for anything just prototyping, since in the end for having reliable code (if you can use that when talking about dynamic languages) you will do work that compiler in languages does, like checking the types or casting Comment deleted
For me its more like: either you hide the fact that everything runs as asm in the background so well that I doesn’t have to care about it and provide me proper logic and error messages OR you just tell me how the compiled stuff will behave when its finally asm Comment deleted
That's true for making some proof of concept rather than real apps Comment deleted
I would say it helps integrate Comment deleted
Apps should feel seemless Comment deleted
Is the python only language that does it ... Perfectly?) Comment deleted
Wat? I hate python Comment deleted
It was sarcasm, everything written in python could be replaced with more or less intuitive language. The reason why people use python is "i'm too stupid to write 'float a=0' I need something unoptimized with no checks to write 'a=0' ". But the funny thing, they end up with a=float(a) Comment deleted
🤣🤣🤣👌 Comment deleted
the reason why people use python is because it's easy as shit. e.g. I wrote myself a set of scripts that glue together gbsplay and corrscope so I can easily render oscilloscope videos directly from gbs files instead of doing all that manually. Things like this is the intended use of python, and for that it's really amazing. It's when soydevs try to use it for unintended things when it gets messy. Comment deleted
Actually this is standard logic in pretty much any programming language. It's an example of abstraction. Comment deleted
In this logic Excel is programming language and every finance manager is programmer) Comment deleted
... excel is turing complete (iirc) Comment deleted
Yeah, but excel is used only in it's financial sphere, not that much of people use it for servers, machine learning and other things Comment deleted
Naturally Comment deleted
I use it for statistics and planning :) Comment deleted