Earlier quoted context omitted.
I've sadly come to realize (after witnessing on many projects) that there's a pattern that goes like this: * Team A writes code quickly. Not bad code, really, but they take shortcuts everywhere they can. They don't have the strongest tests, they don't generalize for all the known use cases, etc. Their code goes to beta and gets users and makes progress. * Team B deliberates and deliberates. They try to avoid taking s…
There's a YouTube video about beginner musicians vs intermediate vs advanced. The beginner uses simple chords The intermediate uses advanced chords, crazy fills and runs and riffs. The advanced uses simple chords
A project with a single 11,000-line code file
291–300 of 346 posts
Re: A project with a single 11,000-line code file
#292Quote: "There was no test environment. If I made a change, I had to test it in "production"." What year is this? 70's and mainframes? Because no way in hell you cannot, on large organization that had "Jeff in marketing", since 80's and PC's, duplicate the environment. Especially given this was used by almost everybody in the organization. And once you're done duplicating the production, and create proper test environ…
But one antipattern might be that the file is being modified by other people, even if on paper he is the only owner. So while you create a test, someone you don't even know exists modifies prod right under you.
Another antipattern is forever-changing ownership. You own it for 2 weeks. Then someone anonymous in some layer above you decides something else, and of it goes. Maybe they did bother to tell you you're not the owner anymore, maybe they only told the new owner. In these 2 weeks, you've got ownership of 3 new programs and lost it for 2 others.
I've seen it happen. There is no way to build something stable in these circumstances. Management will need to provide some stability before the underlings can do any work. If you're living there, run away, you can't save them.
Re: A project with a single 11,000-line code file
#293Earlier quoted context omitted.
I'm kind of surprised that you can't find engineers interested in creating a new implementation of an existing application that is actually used by people. I think that might be my dream role.
At the risk of crushing your dream role, re-implementations can be long slogs. I'm in the middle of one right now. The Product owners don't know what the thing does. The engineers who originally wrote it are gone, and their replacements are relatively new to the codebase. The bright side is customers are hugely interested in our progress to date and we've received positive feedback. The business wishes we could move…
This is the dumbest part. You’d think that someone documented something when they originally built it, but nooo. Don’t even know the requirements, just that it has to be the same as the previous one.
Re: A project with a single 11,000-line code file
#294Earlier quoted context omitted.
It might sometimes be hard but I have never seen a case where it was impossible (25+ years of experience dealing with undocumented legacy code more often than not).
If work with not easily deterministic code typically but not always ML models like say speech-to-text or Face-Recognition or classification/ recommendation systems or network performance dependent applications like video conferencing that wouldn't be that feasible . Almost nothing is impossible to test yes, however to know and be able to mock the data for each test case can be extremely hard and at some point not wor…
Nah, most ML systems (actually doing something in the world) are mostly just ordinary code, which can be tested like any other code (as you put it into functions, etc). The models themselves are pretty awkward, but you can normally freeze the model and just use that to ensure that things stay working while you refactor, and then re-run a few (10+) times to check coverage and intervals and stuff.
It tends to be more difficult, as many DS/data people are not software engineering focused, but it's not impossible.
Re: A project with a single 11,000-line code file
#295So afraid to write bad, spaghetti code, I ended up writing no code at all. This thread made me realize that it's better to have a working profitable project with bad code, than a perfect unfinished project, with meticulously chosen design patterns. Afraid of being judged for bad code, I could not start until I had the right architecture. I'm glad I read this. This is developers therapy.
Restaurant industry version: I was so afraid to cook in a dirty kitchen, I ended up not cooking at all. This thread made me realize that's better to sell food prepared on dirty surfaces with unrefrigerated ingredientes half-eaten by rodents and roaches that makes people sick, than fresh food prepared on clean surfaces with clean utensils. I'm glad I read this. This is a restaurant worker story. Construction industry…
Re: A project with a single 11,000-line code file
#296Countless non-software developers, ranging from IT support to business analyst able to implement business requirements. Good for business if you ask me.
Re: A project with a single 11,000-line code file
#297I learned that not all text editors go to the effort of loading the file data very carefully with careful underlying data structures when I tried to open a 67K LOC COBOL file on a 32bit system, a while back. (Sidenote: COBOL has a 999,999 LOC hard limit in the compiler spec.) So very many editors just couldn't open it. Some would use so much memory that the system would either freeze, or the OS would kill them. Some…
Emacs is actually quite poor at opening large files, at least comparatively—depending on the machine, 65K lines may be enough. However, there's an addon, i.e. a ‘mode’, that implements editing of large files somehow. Vim, on the other hand, does it splendidly: it keeps only a chunk of the text in memory, and iirc the ‘swap file’ that it creates for every opened file, keeps the changes in some kind of a sparse structu…
Yeah, essentially this (apparently) mostly occurs when the file has no newlines (like json often does). I think the hacks are around turning off font-lock mode and one or two other things (install long-lines-mode if this is a problem you're having).
Re: A project with a single 11,000-line code file
#298Earlier quoted context omitted.
You can get away with a lot on a single developer project and best practices aren’t in place solely to make code functional. That application would likely fall apart if multiple developers of with diverse backgrounds had to maintain it and add new features.
To be fair even with using best practices, code can still fall apart with multiple developers from diverse backgrounds.
Re: A project with a single 11,000-line code file
#299Re: A project with a single 11,000-line code file
#300Earlier quoted context omitted.
> The most important things is to have code that is easy to refactor Very true. I'll just add that another most important thing is to actually take time to refactor, even when things are busy. I spend maybe 1/3 of my time refactoring, and that feels good.
I like to refactor once I have passing tests and before committing. Once you know it works take a minute to clean up and make the changes fit your preferred style, extract repeated code into shared methods, comment the tricky bits, etc.