68
u/Shmoveset May 17 '21
Except the documentation is always in Mandarin and references several rabbitholes that in themselves will take 6 hours to attempt to grasp. No thanks, I'll bang my head against a wall for 6 hours.
26
u/DanteMiw May 17 '21
Wow what you're trying to learn? Java?
36
May 17 '21
I've worked with quite a lot of languages and Java has by far the best documentation I've seen anywhere. Now of course if you're talking about some obscure chinese library, sure. Whatever, I can't speak to that. What I can speak to is that the standard library documentation for Java as well as documentation for established frameworks such as Spring etc is fucking stellar.
It's a bit verbose, but it's a really nice language to work with if you don't suck. Sadly most people suck and many universities teach Java so we constantly get flooded by "hurr durr java bad" comments from people who don't know shit about fuck and copies half their code from SO.
12
u/DanteMiw May 17 '21
No no, it was only because of the joke "java bad". I actually like java, right now i'm working with Android development on Android Studio with Java. It was only for the joke.
4
u/zaid2801 May 17 '21
Is it me or android development is a way more complex than/then regular java I just made an application for my OOP class project and literally couldn't figure out (although I didn't try very hard) how to send info from fragment to fragment had to mcgyver a sqlite db to do that.
→ More replies (1)4
u/DanteMiw May 17 '21
You send information on android with Intents "putExtra" method. Its like passing POST parameters to an API, but with java. Search for "Send data to another activity android", there are several explanations about it on StackOverflow!
→ More replies (3)2
u/themiraclemaker May 17 '21
who don't know shit about fuck
This just made me lol for no reason
→ More replies (1)7
u/riplikash May 17 '21
Language? Languages are the easy part!
It's API's, frameworks, toolset, utilities, libraries, packages, etc. where all the headaches are. You know, all the things with HORRIBLE documentation?
1
u/DanteMiw May 17 '21
Yeah, syntax is the easy part.
2
u/riplikash May 17 '21
That's the funny thing about "reading the documentary". Whether you do or don't you will spend the same amount of time debugging. If course, you'll be debugging different things (logic vs syntax), but you'll be debugging either way.
1
1
u/Shmoveset May 17 '21
Happens everywhere, I don't mean actual mandarin it's just a term we use when it's incomprehensible.
1
u/NoraJolyne Mar 01 '22
android documentation is close enough to mandarin, I'll give you that
i stopped trying after the comments went into detail about mathematical theorems
137
u/LunarGibbons May 17 '21
At least you won't make any new bugs during those six hours.
70
27
u/MrScrib May 17 '21
Wait, what happens if I do...
Stop-Process! Ah, that almost killed the network.
Wait, why does the program now show up in nut flavor?
13
11
9
u/BasicDesignAdvice May 17 '21
One of the guys in our client team would re-write everything. To this day we are fixing bugs we already fixed because he re-wrote things which didn't need to be rewritten.
The reason old code is so hard to read is all the bugfixes.
2
1
u/jackinsomniac May 17 '21
I read this on a Joel Spolsky blog post from 2006. The sacred texts must be preserved!
In the late 90s Netscape tried to do a complete re-write of their browser, right when Microsoft started offering IE for free. It could've been Microsoft, or their re-write, or both that caused them to fail. But it was buggy as hell, tanked the company, and after they got bought out it was re-born as Firefox. (Until they decided to re-write again!)
4
u/demalo May 17 '21
Couldn't find the solution the memory leak and subsequent database overwrites...
1
1
1
1
41
u/ass-eater-savage May 17 '21
Reading documentation is like reading cheat codes for a game. Itās unethical, donāt do it. Figure it out yourself.
8
1
56
u/ma_dian May 17 '21
How would we know beforehand which part of the documentation we should read for 5 minutes? If we'd know, it would also not take 6 hours to debug then, would it?
→ More replies (2)7
27
u/angrathias May 17 '21
Or my favourite, spend 5 minutes reading documentation and then 6 hours debugging wtf is going wrong because the documentation is wrong or there is a bug in the library š
4
u/4sent4 May 17 '21
This reminded me that time I tried to use perlin noise to generate height map for my minecraft-like world-gen project on unity and got exactly the same value for any coordinate. I found out later that this particular implementation had problems working with whole numbers. And yes, my coordinates were integers
1
u/ItemOne May 17 '21
š....this happened a couple of times when working with python...usually it turns out to be versioning issues e.g read the docs for subprocess in python 3.7 not knowing production env was running python 3.6.....
1
u/tarceth May 17 '21
Here it is, in the documentation!
"Well of course, that's how it's 'supposed' to work, but around here we use it a bit differently than intended"
1
u/x5nT2H May 17 '21
Pro tip: don't use libraries
1
u/angrathias May 17 '21
Thatās about as far from a pro tip as you can get
1
u/x5nT2H May 17 '21
Yeah it massively depends on what you're doing. But especially doing web development I find people rather use too many libraries than too few. A lot is possible with modern vanilla js.
16
u/risks007 May 17 '21
But you can be sure that you will remember the solution after those 6 hours.
20
u/RavioliConsultant May 17 '21
Yep. For a few months. Then you never run into the edge case again. Until you do.
6
u/riplikash May 17 '21
Sadly...no. You won't. You'll run into the problem in a whiteboard interview 2 years later and you'll certainly remember the PAIN, but not the specifics. You could look it up quicker this time...but that really won't help during the interview. :)
1
u/flavius-as May 17 '21
Something is wrong with me.
I always remember the specifics, and not the pain.
2
u/riplikash May 17 '21
I used to remember three specifics. But im almost 40. There's been WAY too many specifics at this point. Thousands of little headaches.
→ More replies (3)
16
May 17 '21
The other day i spent 3 hours searching for a mistake on my code. There was none, I had forgotten to Output the damn thing in the console...
6
u/LoyalSage May 17 '21
First coding project Iād ever worked on at work, I had written a function in the morning and when I came back from lunch and tried running the program, it wasnāt doing what I expected. I kept debugging it all afternoon and got nowhere.
The next morning I came in with fresh eyes and started tracing through the logic. I scrolled down to where the function was called and thought, āYeah, and then I call the function, passing in
aandb.ā (variable names were better than that, just donāt remember)The line of code was kind of long (I think I was assigning the result of the function call to a nested property on an object, plus the function name was a bit long), so it went of the right side of the screen. I scrolled over, which I hadnāt done the previous day for whatever reason, and saw that I passed in
nullfor both parameters.I think Iād wanted to compile it before lunch to make sure the code at least compiled before I figured out what needed to be passed in to the function.
33
u/SlipperyCorruptor May 17 '21
Shut up! You don't know nothing about anything
7
u/stong_slient_type May 17 '21
Well, frankly, not to trash OP, debug is usually a NP-hard problem.
You just do what you are paid to do. Don't expect too much, though.
9
9
u/firefox57endofaddons May 17 '21
i mean that is just efficiency.
like spending a month to automate something, that will save you 30 minutes over your entire life time....
6
u/ItemOne May 17 '21
From my manager: can we have a library that automates logging in to web sites that we scrape...
Logging in into most websites is less than 5 lines in python...
7
u/darthelwer May 17 '21
There's a sign in my classroom that says "Days of work can save you hours of planning!"
4
5
5
5
u/Noctornola May 17 '21
The problem is when there's NO DOCUMENTATION.
Always assume the person reading your code is a total noob. Like "Mooooom, grandpa shot the router again!" noob.
4
u/theannomc1 May 17 '21 edited May 17 '21
"Self documenting code" or none at all...
Tried to use the C# implementation of the Bouncy Castle Lib but good looking finding anything on it. They only provide test cases (afaik insufficient to use for my cases but at least something I guess?)
4
u/iamreadywhataboutu May 17 '21
usually debugging happens due to written by me logic, not due to some library having unexpected behavior. so, documentation is unlikely to be of any help
3
u/ItemOne May 17 '21
Plus...due to the nuances of english languages....some docs can be intepreted in multiple ways...like the axis parameter in python pandas....you think you know it till you try to use in another methodš
4
6
3
3
2
2
2
2
2
u/AllOverTheWorld May 17 '21
This is almost a direct copy of a tweet from iamdevloper from several years ago.
2
u/carcarah_ce May 17 '21
All documentations that matters are in source codes' comments. You don't need to find it, it finds you.
2
2
2
2
May 17 '21
I'm a self-taught coder. I'm between beginner and beginner/intermediate, but I have a hard time understanding some of the documentation when it comes to arguments and such. That's where I struggle the most.
1
u/LucasCarioca May 17 '21
I know what you mean, I used to struggle too. I will say it changes everything once you get good at reading and understanding docs. Saves a lot of pain in the long run. The hardest thing is missing outdated or incomplete docs.
1
May 17 '21
I think that's one of my issues. I'm not sure if it's outdate/incomplete or the author just assumed we're all pros.
→ More replies (1)
2
2
3
u/SunriseSurprise May 17 '21
Debugging puts hair on your chest while reading documentation literally takes hair away from your chest and makes you look like a baby. Your voice will start cracking and you'll start sounding 10 years old. Who wants that? Debugging it is.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/Herb_Derb May 17 '21
What about when the 5 minutes of reading documentation leads to another 6 hours of debugging why the documentation is wrong?
1
u/Cendeu May 17 '21
As someone who only knows extremely basic programming (the level, not the language ;D), i've always loved the idea of learning about projects and how they work by making documentation.
But where would I even start? Finding information about what documentation is and how it's used is nigh-impossible compared to the ocean of programming info.
1
1
u/mreggman6000 May 17 '21
Really reminds me of all the times I tried to do something and then hitting a roadblock, then finding out there was a correct and easier way to do that thing in the documentation.
1
1
1
1
u/ITriedLightningTendr May 17 '21
I used to exclusively do 3rd party integrations.
Even with the best documentation, you're still gonna spend half the process debugging, because it's incomprehensible, incomplete, or just wrong.
1
1
1
u/hihowubduin May 17 '21
Me: I don't have time to hunt thorough this convoluted doc
Also me: Spend the next three days figuring out every last corner of the coding
1
1
1
1
u/Muaddibisme May 17 '21
You're making the very bold assumption that the documentation exists and isn't total shit.
1
1
1
u/courageoustale May 17 '21
When I first started as a programmer 15 years ago, I worked at a place that made us document our code. Now it's just a habit for me, and honestly it saves future me time too. Often I can't remember what the fuck I wrote the previous day let alone months or more prior.
1
u/Lfaruqui May 17 '21
I was doing an interview for my first internship. They asked me how well I can work with other people's codes. I said that as long as the comments were good and the names were good, I'd be able to figure anything out. They clowned me for the rest of the interview.
1
1
u/Icanteven______ May 17 '21
A lot of these comments are cracks about there not being documentation.
As a slightly serious answer here, there's a checklist I go through when debugging that helps considerably, and it starts with perceiving that I am confused about how something in the system works.
Perceive that I am confused and that one or more of my assumptions about the system is wrong.
Prove to myself that each assumption holds by running an experiment on just that single assumption until I find one that is demonstrably incorrect.
If I don't understand why it's incorrect, first read the official documentation for that piece of code if it exists, then fallback to reading the code itself (if it is open source/I have access to it), then fallback to finding examples of it's usage in the codebase or other codebases, then fallback to asking Google. (Stop when you have a strong understanding of why your assumption was wrong).
Modify your code to correct your assumption.
Profit!!
This might seem annoyingly rigorous, but when you encounter a tough problem, this checklist will 100% save you time.
1
1
u/h00dman May 17 '21
Documentation - 10% in an actual document, 90% in my head.
Getting documentation out of my head and into document - ongoing...
1
1
u/riplikash May 17 '21
Oh please. 90% the time the documentation is done combination of doesn't exist, out of date, incorrect, impossible to navigate, or has to be requested from an overworked IT department in France that checks their email twice a week and takes 2 months of vacation every year.
Sure the base language documentation is usually fine...but that's almost NEVER what I actually need help with.
Sure, the documentation is a valuable resource. But don't act like it's "5 minutes of reading vs hours of debugging". That sounds like college student advice. Searching the documentation regularly takes just as long or longer than just jumping in. And you'll often search for hours or days only to fund the documentation is missing/wrong. It's always going to be a judgement call.
1
1
1
u/ssjskipp May 17 '21
That's like saying knowing the answer to the problem saves figuring out the answer to the problem... Like, the solution is usually something that takes a couple minutes. But finding that gap in knowledge is the key piece
1
u/eternityslyre May 17 '21
Documentation lies. Debuggers will tell exactly what the code did. I've lost time trusting documentation, and rarely considered stepping through problem code to be lost time.
1
u/riplikash May 17 '21
Logical fallacy: if you are spending a lot of time debugging you must not have read the documentation.
Whether you read it or not you will spend the SAME amount of time debugging. You'll just be debugging decent things: logic vs syntax.
1
1
1
1
u/splitframe May 17 '21
Copy example from the "example" folder to extrapolate from this.
2 Days of google hunting leads you to a hobbiest weather station github where one issue comment has the solution. Nowhere else. Looking at you Waveshare eInk 7.5".
1
u/SubstantialQuail4627 May 17 '21
Thatās what killed me on that profession. I spent 8hrs finding a fuck up. It was an extra space or period or something dumb. Wish I stuck with it, oh well
1
1
1
1
u/AtheonsLedge May 17 '21
This is me trying to migrate from Entity Framework 6 to Entity Framework Core. and itās been waaaay more than 6 hours.
1
u/EisVisage May 17 '21
Gotta love when the documentation seems complete, then you look at the files in question and see things you were never told existed, and have to piece it together yourself. Because why bother explaining things in the documentation?
1
1
May 17 '21
Gotta get your debugging practice in! Don't worry, eventually you'll get CRAZY GOOD at debugging! Surely someday you will have honed such skill that you will intuitively know what is wrong whenever you looked at ANYTHING no matter how little you've interacted with it; you would never need documentation again! Right? RIGHT??? RiGhT????????
1
1
1
1
May 17 '21
I was helping my cousin who's taking a computer science course in her final year of high school.
She couldn't get her program to work. I was looking over code and what the assignment was asking for. I asked if she read the Python documentation or reference since the answer was in there.
she asked me "what documentation?"
1
u/Palpatine May 17 '21
Well reading the relevant part of documentation may take 5 minutes but it's gonna take 12 hours to figure out which part is relevant.
1
1
1
1
May 17 '21
A good portion of solving the hardest problems for me isn't usually debugging but finally finding the right documentation and answers.
Microsoft for instance documents everything, but good fucking luck finding it
1
1
1
1
1
1
1
u/psycho-31 May 17 '21
We learn much better by debugging than by just reading.
2
u/EternityForest May 17 '21
The main thing I learn with that kind of debugging is that I should have used a better library that didn't require me to learn how the internals work...
1
1
May 17 '21
Depending on the documentation, 6 hours of debugging can save you 6 days of reading documentation followed by 8 hours of debugging.
1
1
1
u/knightcrusader May 17 '21
I wasted a morning trying to track down why my code wasn't working right in all situations, turns out the documentation was wrong.
1
u/JavaNoob3000 May 17 '21
You are severely underestimating my ability to read rhe docs, and still spend 6h debugging. -, _ , -
1
u/doctorcrimson May 17 '21
I like how all of the really basic functions and libraries always have examples, but those obscure classes super important to your project have like no instructions at all, and take multiple vaguely named arguments and for some reason one of them is always the wrong type no matter what you enter, and you eventually figure out it is an issue with the compiler so you submit a ticket, and when it gets fixed the whole feature is now deprecated.
1
1
u/ivakmrr May 17 '21
Read the code, it will save you a lot of trouble with broken, old documentation. At least if you have access to it, otherwise yes, you're screwed. Most documentation are terrible, when they are not outdated, fortunately for you there's the most common type: terrible and outdated.
1
1
1
u/cavejhonsonslemons May 17 '21
there are only 2 types of API documentation: Bad API documentation, and Worse API documentation. Imma stick to debugging, thank you.
1
1
1
1
1
u/EternityForest May 17 '21
12 hours of print statements can save you 6 hours of debugging with a debugger
1
1
1
1
1
1
1
1
1
u/ce-walalang May 18 '21
Image Transcription: Twitter Post
Jakob āļø \u0000, @jcrsb
6 hours of debugging can save you 5 minutes of reading documentation
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
1
1
u/SergeantPsycho May 28 '21
Or the documentation is so large the information you need is like finding a needle in a haystack, or so sparse on details, it doesn't address your specific usecase.
1
u/gao1234567809 May 31 '21
Hahhahahahahhahahah.
Yeah, I learned my lessons. I did some spaghetti code hackery once to make some troublesome event listeners work properly. Turns out I was using something incompatible and there was an entirely different Library mentioned in the documentation. Now I need to go back and refactor the spaghetti I wrote. Fcking depressing.
1
0
u/Ahnaf2 May 17 '21
Pr rather, 5 mins of reading the documentationās can save 6 hours of debugging
11
7
1
u/Sir_Keee May 17 '21
Though that only works if the documentation is good. I've had the case a few times where the documentation says one thing but the code does something else entirely.
234
u/Kiloku May 17 '21
When I was a student I firmly believed that.
Then I went into the real world and found out that documentation is but a myth.