Details
-
Aboutstudent
-
LocationGermany
Joined devRant on 11/7/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
-
Most satisfying bug I've fixed?
Fixed a n+1 issue with a web service retrieving price information. I initially wrote the service, but it was taken over by a couple of 'world class' monday-morning-quarterbacks.
The "Worst code I've ever seen" ... "I can't believe this crap compiles" types that never met anyone else's code that was any good.
After a few months (yes months) and heavy refactoring, the service still returned price information for a product. Pass the service a list of product numbers, service returns the price, availability, etc, that was it.
After a very proud and boisterous deployment, over the next couple of days the service seemed to get slower and slower. DBAs started to complain that the service was causing unusually high wait times, locks, and CPU spikes causing problems for other applications. The usual finger pointing began which ended up with "If PaperTrail had written the service 'correctly' the first time, we wouldn't be in this mess."
Only mattered that I initially wrote the service and no one seemed to care about the two geniuses that took months changing the code.
The dev manager was able to justify a complete re-write of the service using 'proper development methodologies' including budgeting devs, DBAs, server resources, etc..etc. with a projected year+ completion date.
My 'BS Meter' goes off, so I open up the code, maybe 5 minutes...tada...found it. The corresponding stored procedure accepts a list of product numbers and a price type (1=Retail, 2=Dealer, and so on). If you pass 0, the stored procedure returns all the prices.
Code basically looked like this..
public List<Prices> GetPrices(List<Product> products, int priceTypeId)
{
foreach (var item in products)
{
List<int> productIdsParameter = new List<int>();
productIdsParameter.Add(item.ProductID);
List<Price> prices = dataProvider.GetPrices(productIdsParameter, 0);
foreach (var price in prices)
{
if (price.PriceTypeID == priceTypeId)
{
prices = dataProvider.GetPrices(productIdsParameter, price.PriceTypeID);
return prices;
}
* Omitting the other 'WTF?' code to handle the zero price type
}
}
}
I removed the double stored procedure call, updated the method signature to only accept the list of product numbers (which it was before the 'major refactor'), deployed the service to dev (the issue was reproducible in our dev environment) and had the DBA monitor.
The two devs and the manager are grumbling and mocking the changes (they never looked, they assumed I wrote some threading monstrosity) then the DBA walks up..
DBA: "We're good. You hit the database pretty hard and the CPU never moved. Execution plans, locks, all good to go."
<dba starts to walk away>
DevMgr: "No fucking way! Putting that code in a thread wouldn't have fix it"
Me: "Um, I didn't use threads"
Dev1: "You had to. There was no way you made that code run faster without threads"
Dev2: "It runs fine in dev, but there is no way that level of threading will work in production with thousands of requests. I've got unit tests that prove our design is perfect."
Me: "I looked at what the code was doing and removed what it shouldn't be doing. That's it."
DBA: "If the database is happy with the changes, I'm happy. Good job. Get that service deployed tomorrow and lets move on"
Me: "You'll remove the recommendation for a complete re-write of the service?"
DevMgr: "Hell no! The re-write moves forward. This, whatever you did, changes nothing."
DBA: "Hell yes it does!! I've got too much on my plate already to play babysitter with you assholes. I'm done and no one on my team will waste any more time on this. Am I clear?"
Seeing the dev manager face turn red and the other two devs look completely dumbfounded was the most satisfying bug I've fixed.5 -
This one was probably last week of my highschool education so everyone including myself were drunk as fuck like 90% of the time.
Came home drunk one evening and woke up in the morning with a working keylogger waiting to be deployed on school computers. Apparently I've even implemented FTP upload, some basic firewall bypasses and autostart feature. Everything was actually quite good, excluding my stupidness to upload captured data on server through FTP, but there was anyways no-one smart enough in that school to decompile a Windows executable binary.
What's more interesting is until that moment I've never written anything remotely so complicated - I was doing examples from the book and didn't think I have enough knowledge to make program that has any real life application.
After that day it started coming to me that one day I could actually earn for life with programming.2 -
Website: We care about your privacy and don't sell your information to third parties.
*inspects Privacy Badger*
*notices a truckload of Google/facebook trackers/ad thingies*
Yeah why don't you go fuck yourself.12 -
Trend of the day:
1. Facebook is really compromising user privacy, will delete my account!
2. Post about deleting Fb account to twitter, instagram, etc
3. "Ok google, what is privacy?"
4. Find a random app in play store and allow access regardless20 -
GROW SOME FUCKING BALLS AND TAKE RESPONSIBILITY YOU FUCKWIT!
I can't even count how many times I've heard people excuse themselves with sentences like:
"It's not my fault I only got a C, our teacher was shit"
"How can I finish this assignment when the teacher haven't learned me this?"
"I'll be late to work because my dick was stuck in the sink"
(This is a real one I've experienced myself. A teacher said this last week)
"I wasn't able to put up your material for your assignment before now because we're busy with exams" - The day before the assignment was due. Gj.
"He doesn't deserve to get fired, it's not his not at fault for being incompetent"
Then who the fuck is? The government? Your neighbor? My dog? A stray dog?
STFU! I'm so fucking tired of all these excuses! Grow some hair and take responsibility.
The only thing you achieve by not doing so is making everyone else drown in your disgusting vomit your constantly letting out of your mouth.rant students teachers kinda wk92 everyone wk92 responsibility counts all says of the year fuck people8 -
oh it’s a little bit old ...
now everything is firefox quantum! the best browser ever
download firefox quantum is your purpose :)))6 -
Can we make the devRant gang sign into a thing? Can it be a secret way of recognizing other devranters, say, at conferences? Please?
\||/_18 -
Alright so im a highschool student and I just got sent down to the office for using putty to push to git because it's hacking. Wtf.31
-
*opens camera*
*permission popup asking for contacts/telephone permissions*
*installs Open Camera*
Really, fucking phone/contact permissions to take pictures?!
Yeah fuck right off.27 -
So, my wife sends me this picture because our car had 111,111 miles on it. Of course she called me a nerd when I told her, "That is awesome because if you ignore the .3 on the trip odometer it is 63 and that in binary is 111111"8