News for hackers. Stuff that matters.
Re:You Want Modules, Not Microservices by beefield on Tuesday January 03, 2023 @08:05AM (#34230851)
Because one day someone else may need to read and understand your code?
Re:You Want Modules, Not Microservices by hgsgm on Tuesday January 03, 2023 @08:09AM (#34230876)
Mathematicians rarely collaborate by forking and improving other papers. They rewrite from scratch, because communicating ideas isn't considered the important part, getting credit for a new paper is.
Re:You Want Modules, Not Microservices by mbork_pl on Tuesday January 03, 2023 @08:12AM (#34230892)
Fair enough, though I've been working as a programmer for over 6 years now (and I've been programming on and off, as a hobby, for over 3 decades).
Re:You Want Modules, Not Microservices by em500 on Tuesday January 03, 2023 @08:48AM (#34231228)
But is it generally easier to read and understand, say 10 files of 1000 lines or 100 files of 100 lines or 1000 files of 10 lines, compared to one 10,000 lines file? (I don't know the answer, and don't have any strong opinion on this.)
Re:You Want Modules, Not Microservices by anthonypasq on Tuesday January 03, 2023 @12:54PM (#34235034)
navigating between files is trivial in most real IDE's. i can just click through a method and then go back in 1 click
Re:You Want Modules, Not Microservices by em500 on Tuesday January 03, 2023 @03:30PM (#34237547)
But navigating between functions / classes / paragraphs / sections is also trivial in most real editors.
Re:You Want Modules, Not Microservices by mbork_pl on Tuesday January 03, 2023 @09:18AM (#34231597)
But this is precisely my question: in what way does splitting the code into many small files help with that? Personally I find jumping between many files (especially when they are located in various directories on various levels in the fs) pretty annoying...

Of course, that probably depends on the nature of the project. Having all backend code of a web app in one file and all the frontend code in another would be very inconvenient. OTOH, I have no problems with having e.g. multiple React components in one file...

Re:You Want Modules, Not Microservices by beefield on Tuesday January 03, 2023 @02:18PM (#34236528)
Obviously you can split your code into many files in a way that obfuscates the workings of the program pretty much comoletely. And I think you can write a single 10kloc file that is so well organized that it is easy to read. I just never have seen one...

I believe that files offer one useful level of compartmentalizing code that makes other people easier to understand what is going on by just looking at the file structure before opening a single file. The other guy can't grep anything before they have opened at least one file and found some interesting function/variable.