News for hackers. Stuff that matters.
Re:Writing system software: code comments by steve_musk on Sunday October 07, 2018 @07:54AM (#18160120)
Why not have each of those sections as a separate file?
Re:Writing system software: code comments by rocqua on Sunday October 07, 2018 @08:13AM (#18160189)
It's a balancing act of-course. The total file is ~200 lines at the moment, breaking it up would create some very small files, and generate a lot of 'including' boilerplate.

Moreover, it would make it more difficult to understand the whole thing. The lexer and parser are closely coupled (by the data type for the tokens) and the parser and 'processor' are closely coupled by the data type of the syntax tree.

I could still see it happen that it does get split, and there are certainly coding styles that would have split this without question.

Re:Writing system software: code comments by iofiiiiiiiii on Sunday October 07, 2018 @08:15AM (#18160201)
That works if you need to usually only work within a section. However, in many cases switching files can be more distracting than scrolling to a different section in the same file.
Re:Writing system software: code comments by Cursuviam on Sunday October 07, 2018 @03:57PM (#18162331)
Sections are the step before separate files for me.