Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "debug"
I am working on my passion project, on my own vacation days because my advisor did not approve it and I can't take no for an answer.
But I had 3 amazing days working with my friend and research partner, full of stupid bugs, moody hardware and a lot of nutella-covered food.
I think I am going to document some of the progress on Twitter, because it supports uploading videos. If anyone is interested in failing robots, I can share the link/handle :)10
I was only seventeen back then and I was a Java Developer Intern, not knowing much about enterprise oriented coding.
The project leader in our dev team saw a lot of potential and passion in my work, but was convinced I wasn't taught enough to do the right thing.
I was mainly doing shitty mappers and services back then, which were somewhat used but never lasted long and were ditched a few months later, which always bummed me out. I wanted to make an impact on REAL projects that would deploy into production.
So Mister Mentor (GDPR forbid to use the actual name), who was always first to come and last to leave the office, taught me what it means to code for real.
We stayed after 5pm until 7-8pm multiple times a week and he taught me in a deeply understanding and calm way how to:
- Git (SVN)
- Unit Test
And most importantly:
- How to debug like an absolute BOSS
(We even debugged native Java Libraries just for fun to see if we could break them)
Fast-forward a month later and little intern me made his first commit on production.
Without Mister Mentor, I wouldn't be half as good of a developer as I am today.3
Devs: Hey, what should we do?
provide our SDKs for download as easily as possible so that any potential customer can try it out and see how much better we are compared to our competitors?
Should we lock our SDKs behind a login where the customer needs to create an account and enter the most amount of private information possible, just in case, then also require to create some security access tokens that he needs to configure in his app to have access to our service via the sdk and also hide all of the documentation behind a login which requires some permission based roles to access and also make the sdks closed source so that it’s a pain in the ass to debug and understand?
B! Definitely B! Make sure to piss off and annoy our customers as much as humanly possible!
It only took us 5 hours to debug. It's fine. I'm not mad that it was just rate limiting. I'm fine. We're fine. It's fine.11
The joys of using overpriced enterprise software...
Me: Hey, I tried connect to the server, but I'm getting a "connection refused" error. Is it really running.
Other: hmm, I'll check
Other: The host restarted, but I'll get the software up again, no problemo
Other: I started the server again, but there's, but it's throwing errors while initializing. Time to write customer support
And then you get that premium customer support that think we don't know how to use their software at times. And once they realize we do, they don't know much better either. And once they realize we know how to use it there are 3 possibilities:
* They need our help to debug stuff before knowing what is going on
* They need to release a new version and accidentally break backwards compatibility and create enough work for us to burn through the clients contact hours
* They provide helpful advice (secret ending)
These fuck don't even release a proper changelog for their software nor their manuals.1
Why I love Salesforce 👀
- Run a test method
- failure: no field found
- checks test, queries field
- checks field security (access permissions) visible to user
- runs test again
- failure: no field found
- adds debug log of queried field
- runs test again
Thanks, thanks for fucking with me today 🥲6
Rule number 1 in performances debug :
It's always I/O.
If it's not IO, then the code should be REALLY bad.12
Two big moments today:
1. Holy hell, how did I ever get on without a proper debugger? Was debugging some old code by eye (following along and keeping track mentally, of what the variables should be and what each step did). That didn't work because the code isn't intuitive. Tried the print() method, old reliable as it were. Kinda worked but didn't give me enough fine-grain control.
Bit the bullet and installed Wing IDE for python. And bam, it hit me. How did I ever live without step-through, and breakpoints before now?
2. Remember that non-sieve prime generator I wrote a while back? (well maybe some of you do). The one that generated quasi lucas carmichael (QLC) numbers? Well thats what I managed to debug. I figured out why it wasn't working. Last time I released it, I included two core methods, genprimes() and nextPrime(). The first generates a list of primes accurately, up to some n, and only needs a small handful of QLC numbers filtered out after the fact (because the set of primes generated and the set of QLC numbers overlap. Well I think they call it an embedding, as in QLC is included in the series generated by genprimes, but not the converse, but I digress).
nextPrime() was supposed to take any arbitrary n above zero, and accurately return the nearest prime number above the argument. But for some reason when it started, it would return 2,3,5,6...but genprimes() would work fine for some reason.
So genprimes loops over an index, i, and tests it for primality. It begins by entering the loop, and doing "result = gffi(i)".
This calls into something a function that runs four tests on the argument passed to it. I won't go into detail here about what those are because I don't even remember how I came up with them (I'll make a separate post when the code is fully fixed).
If the number fails any of these tests then gffi would just return the value of i that was passed to it, unaltered. Otherwise, if it did pass all of them, it would return i+1.
And once back in genPrimes() we would check if the variable 'result' was greater than the loop index. And if it was, then it was either prime (comparatively plentiful) or a QLC number (comparatively rare)--these two types and no others.
nextPrime() was only taking n, and didn't have this index to compare to, so the prior steps in genprimes were acting as a filter that nextPrime() didn't have, while internally gffi() was returning not only primes, and QLCs, but also plenty of composite numbers.
Now *why* that last step in genPrimes() was filtering out all the composites, idk.
But now that I understand whats going on I can fix it and hypothetically it should be possible to enter a positive n of any size, and without additional primality checks (such as is done with sieves, where you have to check off multiples of n), get the nearest prime numbers. Of course I'm not familiar enough with prime number generation to know if thats an achievement or worthwhile mentioning, so if anyone *is* familiar, and how something like that holds up compared to other linear generators (O(n)?), I'd be interested to hear about it.
I also am working on filtering out the intersection of the sets (QLC numbers), which I'm pretty sure I figured out how to incorporate into the prime generator itself.
I also think it may be possible to generator primes even faster, using the carmichael numbers or related set--or even derive a function that maps one set of upper-and-lower bounds around a semiprime, and map those same bounds to carmichael numbers that act as the upper and lower bound numbers on the factors of a semiprime.
Meanwhile I'm also looking into testing the prime generator on a larger set of numbers (to make sure it doesn't fail at large values of n) and so I'm looking for more computing power if anyone has it on hand, or is willing to test it at sufficiently large bit lengths (512, 1024, etc).
Lastly, the earlier work I posted (linked below), I realized could be applied with ECM to greatly reduce the smallest factor of a large number.
If ECM, being one of the best methods available, only handles 50-60 digit numbers, & your factors are 70+ digits, then being able to transform your semiprime product into another product tree thats non-semiprime, with factors that ARE in range of ECM, and which *does* contain either of the original factors, means products that *were not* formally factorable by ECM, *could* be now.
That wouldn't have been possible though withput enormous help from many others such as hitko who took the time to explain the solution was a form of modular exponentiation, Fast-Nop who contributed on other threads, Voxera who did as well, and support from Scor in particular, and many others.
Thank you all. And more to come.
Links mentioned (because DR wouldn't accept them as they were):
1) Read the wiki on git. I probably have enough shorthands and test methods that you won't need much other shit to debug issues.
2) when debugging, remember that if it is there, there's a good reason why I put it there.
3) commented-out code is probably useful for maintenance. I left it there for a good reason. 😛
4) chances are whatever I wrote, was the state of the art at the time I wrote it. There might be better ways to do it now tho.
5) I always work modular. First, understand the structure. (probably also documented on wiki) DO NOT fuck up the structure. If you change it, you document it.
6) If you feel I wrote shit, it's probably because management annoyed the living shit out of me. Pun intended.
7) Your confusion is normal. I don't do dumb shit.4
i was helping a friend who just started learning how to code and i realized that tutorials don't teach you how to read error messages and how to debug. that's stuff we learn from people, it's tacit knowledge. that's crazy to me, because those are such essential skills to a dev and i think just self learning is not enough. maybe coding is even more of a socially dependent skill than i ever thought. looking at it that way, stackoverflow is a good example of that, I can't really imagine being a dev without the dev community7
The IT guy my parents had often at their home.
This guy thought me how to manage our network, how to create mobile apps. How to debug problems and so on. He sparked so much interest for computers in me and now i can't stop fiddleing around with computers.
Also this "electrician" who worked for my parents.
Basically he fixxed old keyboards, loudspeakers and stuff like that. He thought me about resistors, transistors, blue prints and how to solder stuff.
They both started my journey into the rabbit hole of technology.1
Never write at the limit of your talents! Remember: debugging is always twice as hard as writing code. And if you write as cleverly as you can, you won't be able to debug it anymore.🧠7
I was assigned to maintain the website as full stack dev but the code from backend is horrible previous devs didn't use SOLID principle, DRY, KISS, or Design patterns. I had to adjust from OOP mindset to Procedural its hard to debug in this state.3
HOLY GARBAGE UNTESTABLE DIFFICULT TO DEBUG JFC SHIT.
FUNCTIONS DO ONE THING AND DO ONE THING WELL. LEARN IT, LIVE IT, LOVE IT, OR JUMP INTO A LAKE
that is all.5
senior: i'm going to read the code changes of the PR that caused this bug, many files , lots of lines of code to see if i can suss out this issue
me: skimmed the PR, i give up, unga bunga time, time to compare the variables in the debugger between the different implementations, found the difference
due credit, the unga bunga approach worked this time, might nto always work3
I’m trying to explain the theory behind ‘Rubber Duck Debugging’ and to be honest, they don’t believe me 😂 they say I’m drunk. Help me out here, who else uses a rubber duck or something similar to help debug code?8
After 10 fucking wasted hours Im still up trying to figure out how to configure the motherfucking IDE to debug the fucking hideous PHP shit fuck code. Fuck PHP right in the ass.16
This is not joke but fact
More than a year ago I write code without tests, I must confess its frustrating trying to debug without proper testing. testing is painful I must admit but you can't compare the confident you have on your code with the pains when writing tests.
About a year ago I wrote a whole software without tests and this words from a friend hunted me everyday till date he said, what cannot be tested cannot be trusted. Wise words.7
Ahh, Unity’s “Wheel Joint.” Who knew it had “polarity.” I spent good several f*<king hours debugging this $h!+ just to find out I just placed them backwards on a 2-D car. Instead of the joint turning the wheels, they were trying to “turn the chassis.”
This meant the chassis received an impossible force which would rip it in half in real life. Of course, this was a unity game, so what happened instead was the physics engine flipping out which sent the car into the air!
I guess it was good for some lulz, but it took way too long to debug. I guess it’s time to take a little time off of that project.4
Records Person: Can you look at this member renewal issue for system A? It’s happening on the website you maintain. Here are some recent errors to debug.
Me (web developer): I can’t reproduce the error your reporting. Is there something I’m missing? And is there an example for the staging environment?
RP: There’s another team that will manually reconcile the records in system A if they don’t match what’s in system B. So this gives users two active memberships when it should only be one.
Me: 😑 So you already know the issue is human intervention messing with the records and causing the renewal issue. This is not a website issue. It’s a data issue.1
Software runs fine on several in-house instances. First time customers hosting it themselves. Runs fine. Users start using. Server need absurdly high processing power and fucks up. I can not access customers Server to debug. Only hope, get copy of their images to reproduce their setup. And have *** one single fucking hour *** to go into it before having to tell in emergency meeting if we can fix it or they would blew the project.
I didn't expect, but found the cause, a single very badly written query. Written by myself years ago I have to admit.
They also gave me one hour to produce a patch. I did but but lost so many hair.4
Your code will probably take 10x longer to debug and write.
But hey, now all your segfaults will be exceptional!24
docker, Dockerfiles - devops tools - amount of shell commands inside them and mangled && to make everything running in one file layer makes those unreadable mess that you need to think twice to understand, there is no debugger for it, you do everything with try and see what happens, there is actually no real dev toolset for devops and that sucks, since you got builder images that makes things more mangled than before, it’s clearly missing some external officially approved scripting language or at least
WITH LAYER and indentation / parentheses syntax and they still trying to make it flat, why are you doing that ?
as a result next to Dockerfile cause you can’t import multiple ones you get bunch bash scripts with mangled syntax and other crap that is glued together to make a monster - and this runs most of current software on this planet2
That moment when you find a function called with faulty arguments or a referece mistaken and fix it and code actually works now aaaaand you wake up.. i started to dream about the same code cause i keep rewriting it for different reasons.. what a life
If not understanding code, read the documentation or debug the code. When trying to modify...
1. Follow proper indentation.
2. Don't make spelling mistakes and follow naming convention.
3. Don't try to write all the code in one line (based on line length set)
4. Simplify if else statements if possible.
5. If value of method call need to be used once, don't store it in a variable. Directly use where ever it is needed.
6. If there is duplicated code, put it in separate method and re-use it if possible.1
try to debug by using your knowledge and understanding, i failed and waste time
give up and compare against something similar that works, difference found1
Everytime I have to work on some old Asp.Net shit. WebForms/WinForms etc.
Everything with that bullshitass designer. You wanna open a file you've just created? Sorry, error. Restart IDE and maybe...
Restarted website? Sorry. Old instance still hangs somewhere in IIS, so the port is taken...
Seeing code light up red when cleaning the project. Compiler being like "What the fuck is 'void'?"
Or - I know you didnt make any changes, but Im gonna build AppCode folder anyway... Its only gonna take a minute or two, no worries.
Or - You have XML template file to this class (codebehind)? You wanna open the XML? Would be shame if it was opened in the designer view and your entire IDE crashed 'cuz of some unsuported third party UI element.
Or - just unexpected debug session crashes.
And dont make me start on Xamarin...1
Spent 4 fucking weeks trying to implement this motherfucking feature and in the end after 15 failed implementations it turns out that my first implementation was good. Turns out this other devs fucking feature had a bug (he forgot to add two lines to clear current state and to update current state again). Motherfucker.
Took me over 100 hours to debug that piece of shiet spaghetti codebase and I had to go through grief stages few times to the point where I started questioning my own damn ability
Sometimes it sucks not being able to go step by steap and think in a linear way. I guess if I followed the breadcrumbs I would have solved it sooner. But poking around things and trying out random solutions was like going through a maze blindfolded until I got it right but I guess thats how my brain works.1
"Most memorable bug you fixed?"
A recent instance happened in one of my Scratch projects, and the bug involved "Infinities."
I had an opportunity to teach kids programming, and it involved Scratch. So, to have something to show those kids at least, I decided to make a small game.
In that game, I had an object that takes some time before appearing after being cloned (i.e., instantiated.) The duration was calculated by dividing a constant with a variable:
[Wait for ((3) / (variable)) seconds]
The bug is that I forgot about the case where 'variable' can be 0, which is classic and insignificant.
Well, the thing is that I learned two things the hard way:
1: Scratch is very flexible about integers and floats (e.g., at one second, it looks like an integer, but one operation later, it's a float.)
2: Scratch does not provide any 'runtime errors' that can crash the project.
In other languages, similar "wait" methods take "milliseconds" in an integer, so it would have barfed out a "DivideByZeroException" or something. But Scratch was so robust against project-crashing behavior that it literally waited for f*<king "infinity seconds," effectively hanging that clone without warning or runtime errors. This masked my bug. It took way too long to debug that s#!+.
Don't blanket-mask any errors.
Just ended a 4 hour debugging session trying to work out dlv debugger for golang, only to know that "dlv doesn't work on wsl".
Movies depiction of us was so wrong :'(1
I had a pretty good year! I've gone from being a totally unknown passionate web dev to a respected full stack dev. This will be a bit lengthy rant...
- Got my first full time employment dev role at a company after being self-taught for 8+ years at the start of the year. Finally got someone to take the risk of hiring someone who's "untested" and only done small and odd jobs professionally. This kickstarted my career, super grateful for that!
- Started my own programming consulting company.
- Gained enough confidence to apply to other jobs, snatched a few consulting jobs, nailed the interviews even though I never practiced any leet code.
- Currently work as a 99% remote dev (only meet up in person during the initialization of some projects.) I never thought working remotely could actually work this well. I am able to stay productive and actually focus on the work instead of living up to the 9-5 standard. If I want to go for a walk to think I can do that, I can be as social and asocial as I want. I like to sleep in and work during the night with a cup of tea in the dark and it's not an issue! I really like the freedom and I feel like I've never been more productive.
- Ended up with very happy customers and now got a steady amount of jobs rolling in and contracts are being extended.
- I learned a lot, specialized in graph databases, no more db modelling hell. Loving it!
- Got a job where I can use my favorite tools and actually create something from scratch which includes a lot of different fields. I am really happy I can use all my skills and learn new things along the way, like data analysis, databricks, hadoop, data ingesting, centralised auth like promerium and centralised logging.
- I also learned how important softskills are, I've learned to understand my clients needs and how to both communicate both as a developer and an entrepeneur.
- First job had a manager which just gave me the specifications solo project and didn't check in or meet me for 8 weeks with vague specifications. Turns out the manager was super biased on how to write code and wanted to micromanage every aspect while still being totally absent. They got mad that I had used AJAX for requests as that was a "waste of time".
- I learned the harsh reality of working as a contractor in the US from a foreign country. Worked on an "indefinite" contract, suddenly got a 2 day notification to sum up my work (not related to my performance) after being there for 7+ months.
- I really don't like the current industry standard when it comes to developing websites (I mostly work in node.js), I like working with static websites (with static website generators like what the Svelte.js driver) and use a REST API for dynamic content. When working on the backend there's a library for everything and I've wasted so many hours this year to fix bugs and create workarounds related to dependencies. You need to dive into a rabbit hole for every tool and do something which may work or break something later. I've had so many issues with CICD and deployment to the cloud. There's a library for everything but there's so many that it's impossible to learn about the edge cases of everything. Doesn't help that everything is abstracted away, which works 90% of the time but I use 15 times the time to debug things when a bug appears. I work against a black box which may or may not have an up to date documentation and it's so complex that it will require you to yell incantations from the F#$K
era and sacrifice a goat for it to work properly.
- Learned that a lot of companies call their complex services "microservices". Ah yes, the microservice with 20 endpoints which all do completely unrelated tasks?
Can you give me some tips on how to debug a massive app? (Android app running on android studio which is basically intellij idea).
For example I need to fix a bug where a certain action results in unexpected behaviour.
But oh my god the codebase is so large (mainly architecture is MVVM and rxjava) that searching for the specific place is like searching for a needle in haystack.
For example I added a breakpoint in few places, but I can see only like 4 or 5 last frames in the stack that led to the current action, last frame is a lambda which doesnt help me so frankly Im unable to even track where current event started. I am loosing my mind. I cant even find where the buttonclick action started because everything is reactive and done with observables which can be anywhere.
Any tips on debugging will be appreciated7
Me: I opened a support ticket with the software vendor last week. I haven’t heard from them yet and the can be slow to respond. I’m unable to debug the issue on my end. If you can’t wait, here are some solutions to explore. [sends a few suggestions]
Stakeholder: Can I give you examples of another error that I think is related? Is that worth exploring?
Me: 😑 No. I’ve reached the limit of what I can do for debugging. I need the vendor to answer my support ticket.
How much of mentoring should I expect as a junior dev? 4 weeks in this job. I get assigned a ticket, tryhard for 3-4 days on it only for my implementation to be replaced by a mid/senior with another broken solution with new bugs which I dont even know how to debug. They are not even in the office, I have to call them and mentoring that I get is max 30min a week. Is that normal? I expected at least 30min a day mentoring. I feel that I cant grow here as fast as I would want to. If I wanted to waste my time on digging through dozens of articles to learn what senior could tell me in 10 minutes, I wouldnt have accepted this job.9
I hate unit test. I hate testing by code.
I hate the idea to write code that tests code. And that u must update both when u add a feature. Like wtf.
Good debug mode with clear verbose and precise reporting tool and voila.
Drives me nuts thus trending shit.10
Great yeah for sure. Tried to debug most of yesterday to come up with a recommendation today. But yeah, go ahead, just ignore it. Don’t even read it. I’ll just go fuck myself.2
I think I have a slight problem in my API.
Snapshot 1 : API entrey point
Snapshot 2 : on "return" statement from API.
No biggies, 8 GB of RAM used.
The API ? Adds 1 ligne in database.
That's gonna be a fun debug8
Terraform + helm-chart ... I really ned a break. Who the fuck invented this shit.
The HCL format sucks
The documentation sucks
The dev tools suck
The debug output sucks
But I'm ok with that, I can manage.
But today really it shot the bird ... I can't have a fucking comma in a string? Because idk why the fuck helm-release tries to parse that fucking string and wants to make an array or whatever out of it? Why, you fucking abomination?
Something in the docs? Nah, who reads them anyway.
Because you know it's totally not strange that a string is analyse and oh wait there's a comma in it, the dev surely wants me to make an array out of it, because you know ...
So now I have to escape my fucking comma to prevent it to parse my fucking string. I just want to have a fucking string you hideous monstrosity ....1
If there's a breakdown of the internet what percentage of ur normal code ability (internet is present) can u write or attain ...what percentage of ur codes can u debug (without the internet)...5
Learning what it needs to debug a Safari-only bug (a lot of money).
Getting in touch with CyPress and after initial rejection seeing how it's concepts are actually brillant.
I have been invited to github codespaces.. How good is it? Is there any resource one how you can create and debug muli container applications?
It's me or the "Reactive Functional" Spring WebFlux is a stupid fad? It's hard to train new developers on it, a PITA to debug and there isn't any study which proves which it brings better performance compared to the classic Spring MVC.1
Dude ist sysadmin at server Pool hosting our app for the client.
Client: something minor is not working.
Dude: Let me just restart app, works at my windows laptop everytime or whatever.
*restarts app, hangs on entrypoint*
Dude: Dear client it's brocken.
Clients: *calls us in panic.*
Horus: Dear dude, when it hangs on startup consider to download an update because we fixed some issues with in theis area recently. Also maybe enlarge the docker compose timeout.
Dude: Still does not start up.
Horus: ok just call me on this Zoom link, then we can debug together.
Dude: oh i just saw it did startup mean while, it just took some time.
Fuck you dude, and your impatience!1
oh yay, firefox just updated and gave me a thank you for using nightly on their 100s version...
now lets see what stupid new problems arise
Omg why are social cards so hard to debug? Did no one think of such obscure techniques as local debugging? And why doesn't Twitter show me the error message? It's the same code for fuck sake! It works with one article but not with another. There MUST be some very exact problem with one of my images, but Twitter just doesn't fucking give me a proper log.1
manually writing a post request, filling it out and having to debug it vs just using the existing point and click interface ur product has and calls the same endpoint under the hood, and is already programmed to automatically fill all that tedious shit correctly etc for you
somebody mercy kill me already2
vue errors impossible to know where it caused
when I click on vue.js?3de6:634
it just gives some inside file. No stack trace to my file. Are you thinking what you are creating? Or are you making it to make it more difficult to debug vue creators?
Moengage is one of the worst analytics software I have ever worked with...
Integrating it into a react website is a pain in the ass, they don't have a npm package, you need to add a script tag to html file.
It also has a wierd bug that the service worker they mentioned in the documentation doesn't work when the debug logs are off.
Aaaargh. Now I have to make a service worker handler to import this service worker and see if it works...