Details
-
AboutHi, im John.
-
SkillsGo, C/++, JS. React, OpenGL, Django, Qt. Linux/Mac/Windows.
-
LocationMichigan
Joined devRant on 2/11/2017
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
-
Python. Changed a function to return a tuple instead of one value in some database code. Tests pass, gets deployed, everything works. End of the month comes. Suddenly, we get a report that we're draining people's bank accounts and credit cards.
It turns out there was an untested bit of code inside the billing process that used this function. It used the function that was changed. To make matters worse, when the exception was thrown, the billing had already completed successfully, and due to another unrelated bug it would retry despite this.
So, needless to say, type safety and good unit tests are things I prioritize nowadays.7 -
Where n is the number of USB-C cables you need, n-1 is the number of USB-C cables you have.
Seriously, how does this always happen? I finally have an excess of Micro USB cables and now nothing fucking uses it. I'm already nearing as many devices using USB-C as I had Micro USB before!3 -
To me, the single biggest coding distraction is other coding, i.e. When there are more things to work on than there are developers and priority changes on a whim. My runner's up would be people who come to you directly for non-urgent matters disregarding that you're busy. The third would be meetings, but I consider meetings to be a necessary evil. Almost nothing is worse than too little communication and the resulting mismatch in expectations.
-
In Django code, looking at a class for caching REST calls. The cache is using Redis via Django's cache layer. In order to store different sets of parameters, each endpoint gets a "master" cache, that lists the other Redis keys, so they can be deleted when evicting the cache. Something isn't right, though. The cache has steadily increased in size and slowed down since 2014 even though many events clear the whole thing!
... And then it hit me. Nothing empties the list of cache keys. Nothing. So it has been growing endlessly since 2014. And everytime it grows, cache eviction gets a little more expensive, network traffic increases a little more, and cache evictions get a little slower.
Fixing this bug took things that were taking routinely an entire minute to complete and made them take a couple seconds. -
Sometimes I deploy to production without actually testing the changes. At least I have my unit tests!
-
Today I learned if you ack a message twice, RabbitMQ shits the bed. Dang. Another day wasted on a dumb refactoring regression.2
-
Hey frontend developers. If you do THIS:
z-index: 1000;
...expecting that it will ensure your div will be on top no matter what, I'm about to fuck your world up. Check this shit out:
z-index: 1001;7 -
setInterval(() => {throw new Error("April fools!"}, 100);
Time to make the front end team hate me.4 -
Not sure what Linux Desktop to use? Use this handy guide:
- GNOME: when you want no tray icons, themes that break every minor GTK release, and extensions for basic features (that are buggy.)
- KDE: pretty go-Segmentation Fault
- DWM/Awesome/i3/etc.: when you feel like the time you spent learning Vim wasn't wasteful enough
- XFCE: when you want one update per decade and poor Systemd support.
- LXQt: the biggest positive is that it doesn't use GTK.
- Cinnamon: when you like GNOME 3 but you want a different menu
- Deepin: when you want a desktop with the build quality of an HP laptop.
Aren't sure whether to use Xorg or Wayland?
- Xorg: if you want to absurdly fuck up your touchscreen, pick this one.
- Wayland: if you want to screw up most of your apps, too bad; this won't work with your proprietary drivers. If only it did.
What distro to use?
- Ubuntu: if you want to break your system with PPAs, check out this one.
- Debian: when you want Ubuntu except with more out of date packages
- Redhat: when you want Debian except with more out of date packages
- ElementaryOS: wait, someone actually made a properly designed Linux UI?
- Arch Linux: the only thing that doesn't make me sick anymore.
- Slackware: "that exists still really?"
- Gentoo: when you hate systemd more than waiting 4 days to compile Firefox on every release.
... I love Linux. I do. But it is very taxing to get things comfortable for me anymore. I feel like the Linux Desktop is in a period of flux and it's painful to be a part of right now.25 -
If you're too lazy to do things right, then I'm too apathetic to help you when things don't work.
One thing to not know any better. Another thing to 100% know better then disregard that knowledge because you don't feel like it. -
HOW TO KILL A DEVELOPER
Coworker: Hey, is http://website down for you?
Me: yeah. What's up?
Coworker: Ah, that explains why my tests are failing.
Me, internally fuming: It would be good test practice to not depend directly on external services.
Coworker: I know, but this is easier.
This makes my blood boil. I'm not a huge fan of mocking and stubbing everything, but when it's actually very easy to mock something and you're too lazy, that makes me fucking angry.
Remember kids: doing it right takes longer than doing it wrong. But doing it wrong will eventually take significantly more of your time. Just wait until your shitty assumptions fail and you don't have any recourse.6 -
Git is way too complicated, but even then I still get painfully annoyed when someone needs assistance with using it. Especially when they're using some GUI I don't know. You mean this thing can't rebase??2
-
I hate it when I accidentally gitlab my changes by running "git checkout ." instead of "git checkout master." It happens very infrequent when I decide to trust my shell history more than I need to.
-
By always striving to do better each time. Making code less sloppy every time I write GL code. Better performance everytime I write an algorithm. Lower memory usage every time I write application state. Learning a new trick for an old problem, one at a time.
Learning best practice in one go is impossible, but taking it a bit at a time makes things more reasonable.3 -
My favorite thing is when I had a debate before, won, decision made, all good, then other people do whatever they want, new people get involved, and suddenly I'm having to argue the exact same things over again from scratch. Meanwhile others just do what they want.
-
How hard it is percieved by management to do something in code is proportional to whether or not it's a task that sales or the CEO wants, versus what the developers need. Developers want to rewrite something, or fix infrastructure? Too much work can't justify it. Sales wants to clone Google Search? We'll expect it by next month.1
-
"Don't look down" is good programming advice. Do you really want to know why the engineer that has been here for three years is shaking constantly and always irritable? It's because he knows that beneath the surface it's all held together with toothpicks and glue. Stay blissfully unaware for as long as possible.
-
!rant.
Here's some useful git tricks. Use with care and remember to be careful to only rewrite history when noones looking.
- git rebase: powerful history rewriting. Combine commits, delete commits, reorder commits, etc.
- git reflog: unfuck yourself. Move back to where you were even if where you were was destroyed by rebasing or deleting. Git never deletes commits that you've seen within at least the last 50 HEAD changes, and not at all until a GC happens, so you can save yourself quite often.
- git cherry-pick: steal a commit into another branch. Useful for pulling things out of larger changesets.
- git worktree: checkout a different branch into a different folder using the same git repository.
- git fetch: get latest commits and origin HEADs without impacting local braches.
- git push --force-with-lease: force push without overwriting other's changes5 -
Personally, I am fine with Windows and I run it on a couple boxes. Just don't be the Ignorant Windows Guy at work who needs constant help when there's not a GUI for something. Not as annoying as Elitist Linux Guy or Pompous Mac Guy, but still annoying.1
-
Open office plans are a GREAT idea. Nothing says productivity like hearing a pin drop from across the building. Who needs good acoustics anyways? And you bet your ass the moment anything sensitive to background noise is going on you're no longer allowed to communicate at all, because even a potato plugged into an audio jack can hear you whisper from 50 feet away. Good thing we don't do that often - only on days that end in Y, I assume.2
-
Hmmm.. Google Pixel battery just died in a split second from like 50%. On one hand, im concerned about what just happened. On the other hand I hope it happens again so I can sleep in and go to work late without the associated guilt 😉2
-
Everytime you use OpenGL in a brand new project you have to go through the ceremonial blindfolded obstacle course that is getting the first damn triangle to show up. Is the shader code right? Did I forget to check an error on this buffer upload? Is my texture incomplete? Am I bad at matrix math? (Spoiler alert: usually yes) Did I not GL enable something? Is my context setup wrong? Did Nvidia release drivers that grep for my window title and refuse to display any geometry in it?
Oh. Needed to glViewport. OK.4