(no title)
drschwabe | 2 months ago
That was a sort of defining moment in my personal coding; a lot of my websites and apps are now single file source wherever possible/practical.
drschwabe | 2 months ago
That was a sort of defining moment in my personal coding; a lot of my websites and apps are now single file source wherever possible/practical.
kvemkon|2 months ago
nine_k|2 months ago
qznc|2 months ago
https://sqlite.org/src/doc/trunk/README.md
unknown|2 months ago
[deleted]
zdragnar|2 months ago
I've had the inverse experience dealing with a many thousand line "core.php" file way back in the day helping debug an expressionengine site (back in the php 5.2ish days) and it was awful.
Unless you have an editor which can create short links in a hierarchical tree from semantic comments to let you organize your thoughts, digging through thousands of lines of code all in the same scope can be exceptionally painful.
antirez|2 months ago
The reason FB (and myself, for what it is worth) often write single file large programs (Redis was split after N years of being a single file) is because with enough programming experience you know one very simple thing: complexity is not about how many files you have, but about the internal structure and conceptually separated modules boundaries.
At some point you mainly split for compilation time and to better orient yourself into the file, instead of having to seek a very large mega-file. Pointing the finger to some program that is well written because it's a single file, strlongly correlates to being not a very expert programmer.
sfpotter|2 months ago
It may not be immediately obvious how to approach modularity since it isn't directly accomplished by explicit language features. But, once you know what you're doing, it's possible to write very large programs with good encapsulation, that span many files, and which nevertheless compile quite rapidly (more or less instantaneously for an incremental build).
I'm not saying other languages don't have better modularity, but to say that C's is bad misses the mark.
drschwabe|2 months ago
You can do a huge website entirely in a single file with NodeJS; you can stick re-usable templates in vars and absue multi-line strings (template literals) for all your various content and markup. If you get crafty you can embed clientside code in your 'server.js' too or take it to the next level and use C++ multi-line string literals to wrap all your JS ie- client.js, server.js and package.json in a single .cpp file
lelanthran|2 months ago
You don't program much in C, do you?
unknown|2 months ago
[deleted]