Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "undefined life"
-
Damn, Natasha Bedingfield's Unwritten accurately describes the start of my workday coding sessions.1
-
Life of dev
birth();
while(alive()) {
....code();
....debug();
....insertRandomBugRant();
}
while(dead())
{
....ThereWasBugInMyCode();
}
Fatal error: Call to undefined function birth(); on line 11 -
I want to explain to people like ostream (aka aviophille) why JS is a crap language. Because they apparently don't know (lol).
First I want to say that JS is fine for small things like gluing some parts togeter. Like, you know, the exact thing it was intended for when it was invented: scripting.
So why is it bad as a programming language for whole apps or projects?
No type checks (dynamic typing). This is typical for scripting languages and not neccesarily bad for such a language but it's certainly bad for a programming language.
"truthy" everything. It's bad for readability and it's dangerous because you can accidentaly make unwanted behavior.
The existence of == and ===. The rule for many real life JS projects is to always use === to be more safe.
In general: The correct thing should be the default thing. JS violates that.
Automatic semicolon insertion can cause funny surprises.
If semicolons aren't truly optional, then they should not be allowed to be omitted.
No enums. Do I need to say more?
No generics (of course, lol).
Fucked up implicit type conversions that violate the principle of least surprise (you know those from all the memes).
No integer data types (only floating point). BigInt obviously doesn't count.
No value types and no real concept for immutability. "Const" doesn't count because it only makes the reference immutale (see lack of value types). "Freeze" doesn't count since it's a runtime enforcement and therefore pretty useless.
No algebraic types. That one can be forgiven though, because it's only common in the most modern languages.
The need for null AND undefined.
No concept of non-nullability (values that can not be null).
JS embraces the "fail silently" approach, which means that many bugs remain unnoticed and will be a PITA to find and debug.
Some of the problems can and have been adressed with TypeScript, but most of them are unfixable because it would break backward compatibility.
So JS is truly rotten at the core and can not be fixed in principle.
That doesn't mean that I also hate JS devs. I pity your poor souls for having to deal with this abomination of a language.
It's likely that I fogot to mention many other problems with JS, so feel free to extend the list in the comments :)
Marry Christmas!34 -
> Am writing code
> Life is good
> Add debugger keyword
> Script pauses
> Type in var name... Undefined.
> ...What?
> Check out local scope. It's there. What the fuck?
> Add console.log(myVariable)
> Refresh
> Logs variable no problem. Cool.
> Type in my var name
> Undefined
FFFUUUUUUU-7 -
So.. I'm giving one of my employers webapps a visual refresher, new company branding and whatnot.
And then I stumbled onto a check that is not returning what anybody expects, and, well , I'm busy fixing things, yeah..? so I go digging.. 🤔
```
function isDefined(obj) {
return !(typeof obj === "undefined") || obj !== null;
}
```
Here's the fun part, these particular lines have been in the code base since before 2017, which is when my Git history starts, because that's when we migrated projects from Visual SourceSafe 6 over to Git. Yes, you read that right. They were still using VSS in 2017.
I've begged and pleaded with my last 3 bosses to let us thrown this piece of shit out our second story window and rewrite it properly. But no, we don't have time to rewrite, so we must fix what we have instead.
I lost 4 hours of my life earlier today, tracking down another error that has been silently swallowed by a handler with its "console.log" call commented out, only to find that it's always been like that, and it's an "expected error". 🤦
Please, just fucking kill me now... I just, I can't deal with this shit anymore.5 -
Most of my time coding in Javascript goes to handling null checks and fixing crashes caused due to missed null checks.
`"abc" is undefined` is an error which I must have seen more number of times than any other bug in console and even in real life.2 -
I created an undefined rant. And it never received any attention. I shouldn't be surprised, but I'm a little surprised. Kinda cool. I could create entirely public but unnoticeable rants.
Kind of like my life
/s9 -
This is something that I hadn't done or that directly impacted me, but that had an effect in my life several years after it happened.
It's one of those stories that you think "this only happens to others", and then someday you're the "others".
So when I was born, I was, naturally, registered on the health care system. My parents chose an uncommon name for me (uncommon in my country) so I think I wasn't registered by the time of my birth, but 4 months later when all the bureaucratic crap came to an end (long story short, the guy that was there when it started died and my parents had to wait 4 months for another person to be appointed). So, when my parents finally went to register me, apparently, for some reason, the computer took my name and assumed it was a male name. As I've said, my name is uncommon in my country, there're probably 3 or 4 people with the same name here in Portugal.
Why did the computer assume it was a male name AND why didn't nobody check that? Since my parents had to ask to government entities to let them name me that name, I'm assuming it wasn't in their db. So why did it assume male? Was it purposely programmed that, by default, all "newly-registered" names were to be male? Was it random? Who the hell knows.
And how did nobody check that, every time I went to take vaccines? I don't think anyone told my mom that everytime we went there that the data was wrong, otherwise the situation wouldn't have lasted for 14 years.
We only knew about that mishap when it was time I had to take vaccines specifically for women and that I wasn't being noticed of it even though a friend 1y younger than me had already taken hers.
I find this story amusing but now that I started thinking about how it came to life (no pun intended) I'm actually a bit pissed off about how they didn't think of uncommon names and that how that could affect their registry in the system. They could have - IDK - placed "undefined" in that field so that it would caught the register's attention.
Moral of the story: don't assume stuff :v1 -
Why did I go broke?
Because every time I tried to cash in my promises, I’d end up nullifying my income with undefined deductions! I thought I could get by on short functions and quick closures, but in the end, I found myself callbacked into a corner with no scope for improvement.
I tried to debug my financial situation, but my stack overflowed with deferred payments, and I couldn’t even parse where all my money was going. The compiler of my life just kept throwing unexpected "expenses" errors.
In a final attempt, I refactored my entire approach, renaming myself Async to buy some time, but it was too late. My funds were hoisted to the global scope, and before I knew it, I was reduced to Boolean poverty.
Now, I live my life in strict mode, always awaiting the day I’ll finally get a return on my investment... but deep down, I know I’m just an object in a mutable state.
P.S : I'm a JS DEV1 -
I opened this app after few years.
It is something that needs many updates.
But opening it after 4-5 years, there are many tags which are showing up as undefined.
This app needs some UI updates.
Something related to coding, algorithms and something related to open source can also be implemented.
UX is already good.
This app could be a key part of developer's life.10