Show HN: Onnemi-4211, A minimal coding style that can be used with any language
github.com
github.com
Sure, making code as narrow as possible is good but some languages can make it very hard.
Imagine writing a web app. Writing HTML and CSS inside your JS codebase seems like a terrible and inconvenient idea, especially combined with the “150 lines per file” thing. You’ll have a JS file which will basically contain just HTML and some logic to put it in the DOM (and by the separation of concerns principle, if the file was less than 150 lines you’d probably just end it there anyway)
With a large web app, this would grow to hundreds of JS files. Some of these files would be by necessity named something like “page1-html.js” or something similar. At that point, you may as well call it “page1.html” and save yourself the headache.
In the case of JavaScript, it means there's no step where you build your source files into a runnable application and then run it. You just run the application directly.
But really this is just a corollary to the "One Language" idea. It means, if you need to build something, build it in the language your app is in, as part of your application logic. Building themselves is part of what applications do, not a thing done to applications.
A lot of this is inspired by the Jai programming language, which is a C-like language that lets you configure the compilation and build process in the language itself as part of the application. I wanted to try to take Jonathan Blow's ideas and apply them in JavaScript and then radicalize them.