Details
-
Aboutbig hikes I like
Joined devRant on 11/9/2020
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
-
Every once in a while the flexibility of dynamic types comes back and bites you in the ars:
So I created method that returns the date significance (day, month, year) or null when no date is set.
I chose a class constant DAY with the value 0.
This is not a problem in if statements as I always use === but in this case a switch made more sense. And as you can guess no date set (NULL) was handled in the self::DAY (0) case... 😐😑😶 Silently resulting in wrong results when no date is given! #£#@$& (and other comic swearing symbols)
Even though php7 finally has decent type hinting resulting in much clearer defined API's we can still go very wrong.
More love to Go for less verbose static typing! To bad we can rarely use it at the office 😥2 -
I have just thought of the perfect solution when support for fucking ancient IE versions creaps in the requirements (and asking the assholes to produce numbers to support the crazy does not help)
Just do browser detection and if IE < 9 Replace body with one of those winXP alert boxes that tell them there Computer is infected and that they can get a free scan (it's what they are used to anyway). Put a link to the installer of your favourite browser over the entire image.😎
Good news is 100℅ code reuse! Works on every outdated IE and every website that requires IE support.4 -
So yesterday I said to my private laptop update and shutdown...
Fast forward to this morning. Hell breaks loose. Have to fix it asap! We have downtime. But fucking windows update!!!
You fucking peace of shit should have done this yesterday. And why does it have to take so long.11 -
For me Jetbrains idea based IDE/editor in part does just about everything right. Only need to really change the redo shortcut. They provide a warning now so you don't lose your undo history on ctrl+y.
On console both Emacs and vim work for me. These days I prefer vim. Nano will work when I'm a pinch but the lack of undo is really annoying. Especially when the cat walks over the keyboard. You just need start all over unless you can see what he did.
Vim has vertical block so you comment/uncommented stuff real fast. The cange word and change till are also real time savers. Vi is to basic and annoying for me, rather use nano than.
Gedit works great for me when viewing or editting a file real quick.
So yeah the situation dictates what tool suites the best.
Idea is where I can spend my time the entire day so if I had to choice one that would be it. -
The JavaScript everywhere trend.
Sure it's possible and the language develops at a fast pace since ES6 but JS like any other language just is not suited for everything. I think JS will stay in server side automation and as scripting language for customisation but not how it is abused now in electron or even node.js.
There will be better solutions if they are not already there.10 -
TL;DR I'm fucking sick and tired of Devs cutting corners on security! Things can't be simply hidden a bit; security needs to be integral to your entire process and solution. Please learn from my story and be one of the good guys!
As I mentioned before my company used plain text passwords in a legacy app (was not allowed to fix it) and that we finally moved away from it. A big win! However not the end of our issues.
Those Idiot still use hardcoded passwords in code. A practice that almost resulted in a leak of the DB admin password when we had to publish a repo for deployment purposes. Luckily I didn't search and there is something like BFG repo cleaner.
I have tried to remedy this by providing a nice library to handle all kinds of config (easy config injection) and a default json file that is always ignored by git. Although this helped a lot they still remain idiots.
The first project in another language and boom hardcoded password. Dev said I'll just remove before going live. First of all I don't believe him. Second of all I asked from history? "No a commit will be good enough..."
Last week we had to fix a leak of copyrighted contend.
How did this happen you ask? Well the secure upload field was not used because they thought that the normal one was good enough. "It's fine as long the URL to the file is not published. Besides now we can also use it to upload files that need to be published here"
This is so fucking stupid on so many levels. NEVER MIX SECURE AND INSECURE CONTENT it is confusing and hard to maintain. Hiding behind a URL that thousands of people have access to is also not going to work. We have the proof now...
Will they learn? Maybe for a short while but I remain sceptic. I hope a few DevrRanters do!7 -
Not sure if it's the worst code review but it's a recent one.
We don't really do code reviews where I work unfortunately but my coworker used my framework for the first time (build some nice composer libraries for cmdline projects) and asked if I could make them do autoloading.
He never used namespaces before so I was glad to help him out.
What I saw was a dreadful mess. His project was called "scripts" so good luck picking a namespace...
Than it was all lose functions in the executable file. All those functions are however called by a class in another file (if they where not calling eachother as a cascading mess). That class was extending an abstract class from my library as instructed. However I never imagined my lib being raped like that.
The functions themselves are a horrible mess. Nothing uniform completely different style (our documentation states PSR's should be used).
Parameters counts higher than 5.
Variable names like Object and Dobject (in calling function Dobject is Object but it needs a fresh one.
If statements on parameters that need basically split it in two (should simply be to functions)
If else statement with return of same variable as a single line (sane people use ternary for that)
Note that I said functions. All of it should have been OO and methods. Would have saved at least some of the parameter hell.
I could go on and on. Do I think the programmer is bad yes (does not even grasp interfaces, dep injection, foreach loops). Is this his best work no. He said that for a one of script like this it just has to work. Not going to be used elsewhere. I disagree as it is a few thousand lines of code that others have to read too.2 -
I was messing with my Ubuntu setup, and somehow, I broke it
Since I didn't have a recent backup, I decided to switch to Manjaro
I'm in love16 -
The most tedious thing known to man is rewriting your css for mobile after you just spend 3 hours perfecting it for landscape devices8
-
The other day, I accidentally broke the R key on my laptop keyboard. The mechanism still works, but the keycap no longer locks in
I go to buy a replacement, since it's really messing with my typing flow, and I find out it costs 7 USD per keycap, plus shipping. That means that to replace every key on my keyboard, it would cost me about $680!!
I only paid about $500 for the ENTIRE FUCKING LAPTOP AND YOU'RE GONNA CHARGE ME $7 FOR A SINGLE FUCKING KEY!!! FUCK YOU ASUS!!!4 -
Parents: You want anything for your birthday?
Me: yeah, can I have a newer PC
Parents: Cool
Me: Also, can I spend a majority of my time alone messing with it?
Parents: Sure
My parents were really laid back and basically let me do what I wanted -
Call me crazy all you want, but I love my tangled mess of cords
Yeah yeah, I know, I know, wouldn't I just love a cordless setup and workspace ...
NO
Bluetooth devices are at best unreliable and at worst don't even work with Linux
I want to just be able to plug my shit in and work, not wait for everything to sync and hope I don't have connectivity issues
Call it living in the past all you want, I don't care. I love my cords
Fuck you and your bluetooth shit2 -
I SWEAR TO GOD IF I SEE ONE MORE BUGGY AS HELL SHITTY SNAP PACKAGE I GONNA LOSE MY SHIT AND KILL SOMEONE11
-
!dev
Me: I have a shit ton of schoolwork to do
*Opens a google doc and start working on it*
*spends 20 minutes reformatting it because they way it was laid out annoys me*
Fuck this4 -
One of my classmates was working on a login form, and the fucker handtyped a 100+ character email validation regex but forgot to add a check to make sure no fields were blank.
It was funny when I was able to create an account with no username, breaking his website, and even funnier when I told him html forms have a built-in email pattern5 -
Is the term for some who uses Linux spelled Linuxer, Linuxxer, egotistical fucker, or something else?8
-
My mom’s not too great with tech
she’s the kind of person who thinks I’m hacking when I use a terminal
My brother is teaching her to play among us, and it’s the best thing I’ve ever seen4 -
FUCK PRINTERS
WERE ALL PRINTERS DESIGNED BY INCOMPETENT MONKEYS WHO HAVEN'T EVER TOUCHED AN ACTUAL PIECE OF PAPER IN THEIR LIVES?!
WERE THEY PAID SPECIFICALLY TO MAKE SURE THEY WOULD NEVER WORK WHEN YOU NEED THEM TO?!?
IT REALLY SHOULDN'T BE SUCH A FUCKING PAIN TO DO A GODDAMN SIMPLE THING LIKE PRINT A BLACK AND WHITE JPEG!
I'M NOT ASKING FOR MUCH, JUST A FUCKING EVEN HALFWAY FUNCTIONAL MACHINE THAT DOES AS ADVERTISED AND DOESN'T REQUIRE SACRIFICING A GOAT TO CONNECT TO
FUCK ALL PRINTERS EVERYWHERE30 -
It's currently 11:21 pm were I am, and I just finished working
I decided to deploy on a Friday
Those two things are related9 -
I kinda hate how even if people submit good and useful code to OSS repositories, you need to act like a salesperson if you want anyone to notice/care about it
-
I started using vim today
Not sure if I'm gonna ditch GUI IDEs and editors completely, but I think I'll try using only vim for a day or two, see how it goes8 -
VS Code stories are here.
I'm not making this up, there is now an extension for VS Code that brings instagram-style stories to your editor
https://marketplace.visualstudio.com/...15 -
CAN SOMEONE PLEASE EXPLAIN TO ME WHAT THE FUCK LAMBDA CALCULUS IS??!?!?!
I swear to fuck, nothing makes you feel more like an idiot than trying to understand functional programming after living all your life in the oop world.
Fucking meta-functions and alligator games.
Fuck this, I'm going back to my happy little Java world11 -
LPT: Name your branch after your user name.
If you select the branch in your IDE the status bar shows "Checking out dbx12". So at least someboddy is checking you out.