Blåhaj Lemmy - Choose Your Interface

When I was in my 101 comp sci classes, one of my professors would say, “A function is meant to do one thing. So if your function doesn’t fit on the monitor in it’s entirety, that is a good indication your function is probably too complicated and/or doing too many things. Either simplify it or break it down further.” And that’s a rule I usually try to live by with my professional work too. So, anyway… I want to see the 4000k monitor this guy is using.

I personally go by the monocre that if it’s something important, it’d be all on one file as not to lose the train of thought when debugging it.

As jumping around between files

tends to break up thought lines

also, the compiler likes it better when there’s layers

Are those your arguments?

Train of thought is subjective

And the compiler doesn’t care

Yeah? If something is important being able to have it all on one file is the best way to ensure you get the behaviour you want.

Having to file-hop is generally a strain on mental resources and it breaks the linearity of the project, ofuscating initial reads.

And yes, the compiler does care, there are no 0-cost abstractions.

Yesnt.

If the alternative to changing into a new file is to search through a 40k lines file that has no structure, then I rather go to a new file. As my train of thoughts is interrupted by the size of the file.

And a good compiler is capable of a lot these days. However if you are working on low end hardware that has to perform good and fast then you should of course think about the compiler.

In 99% of software that isn’t the case though