Some programming principles I have been living by
Do it inside a module with a clearly described interface
No modules bigger than 150 lines or so. They should read like a chapter in a book
Prune data structures as much as possible at interfaces
Code is deployed with a realtime editor
Don't break the debugger
Stick to functions and literals. If you want to use a fancy control structure, it's fine, just do it behind a function with an understandable name and a clear interface
Address the widest possible market, and use whatever backwards technology you must to make it possible
Try to keep things imperative, even if you have to reorganize your functions so it reads well. Only use declarative interfaces where you truly need meta control, like composing things that can't just be concatenated, or optimising a pipeline
10 comments
[ 3.0 ms ] story [ 32.1 ms ] thread>> No modules bigger than 150 lines or so. They should read like a chapter in a book
>> Code is deployed with a realtime editor
>> Address the widest possible market, and use whatever backwards technology you must to make it possible
I'm going to guess, your one language is javascript? I write Node.js too and your list is a reasonable list for "A list of Node.js programming principles".
- Try to have as little side effects as possible
- Keep the number of data structures I use in the same project as small as I can.
- Use sane defaults.
- Treat bad documentation as a blocking bug.
- The tool you look for probably exists already and it's not going to get better just because you rewrite it Rust / Go / Node.
- Abstraction should make things easier. Abstraction for the sake of abstraction is obfuscation.