3 ms·
My traditional way of understanding a program was to find main() (or it’s equivalent) and find my way through the code from there. In modern codebases, this doe
by dhosek 4y ago
My traditional way of understanding a program was to find main() (or it’s equivalent) and find my way through the code from there. In modern codebases, this doesn’t work at all. I do find it a bit amusing that younger devs find it magical that I can trace through code without running it and find bugs.
- atomicnumber3 4y agoYeah, I agree, and I didn't even start all that long ago. For many programs, if you read main, all it does is kick off thread pools and then wait. And so to find the "entry point" you have to know how all the whatever (be it http or whatever) handlers work for this system. And it also feels like this kind of stuff is the first thing people end up DIYing / NIHing so even when languages or stacks have normal ways of doing things, somebody has always come along and muddied the water at some point and now you're stuck with it. Even UI is so damn hard these days because it's all JavaScript with a truly pitiful standard library and needs to handle 50 different screen sizes and browsers and run on both gaming desktops and 30 year old phones running leaked android pre-releases. I'll say it. I miss my days of programming in Java Swing. May GridBagLayout forever bless your pack()s.
- easton 4y ago> I do find it a bit amusing that younger devs find it magical that I can trace through code without running it and find bugs. I’m finding at work with the mass reliance on AWS stuff that this skill is super necessary for a lot of code thee days, because if you have to wait 10 minutes for your code to deploy before you can see if it’s right, you need to be able to see bugs before you run it.
- acuozzo 4y agoThis is why the documentation I always write (especially in rushed cases in which I write no other documentation) is a "where do I start?" guide for newcomers to the codebase I'm leaving behind. I usually call it TREASURE_MAP so that it won't get skipped over like README is sometimes.