Hacker News new | past | comments | ask | show | jobs | submit login
ONEMMI-4211
1 point by erikpukinskis on June 16, 2018 | hide | past | favorite | 2 comments
My new software philosophy:

    One language
    No config
    No build
    Everything is a Module
    Modules want to be 150 lines
    Imperative is best
And...

    - Wrap text at 42 character width
    - 1:1 ratio of expressions to lines
 
ONNEMI-4211



    var library = require("module-library")(require)
It looks like this:

    library.define(
      "hello-world",[
      "web-site",
      "web-element",
      "browser-bridge"],
      function(WebSite, element,
        BrowserBridge) {
        var site = new WebSite()
        site.start(
          3444)
        var page = element(
          "hello world")
        site.addRoute(
          "get",
          "\",
          function(_, response) {
            var bridge = new BrowserBridge(
              ).forResponse(
                response)
            bridge.send(
              page)})})


One Language

- No CSS, HTML, macros, build flags, etc. Construct them imperatively in native code.

No Config

- Switches, addresses, hashes, application structure, all must be written in function calls, not keys in a config file.

No Build

- Can be started with its one file

Everything Is Module

- No dependencies implicit in filesystem, environment switches, build descriptors, etc. Modules must be written explicitly in code

Modules Are 150 Lines

- they’ll grow to 600 but they want to be 150

Imperative Is Best

- Pass data to procedures. Don't entire namespaces. Don't pass flags.

- Try not to have keys on object that stick around and affect different pieces of code at different times. As much as possible try to use objects in the same module that created them

ONEMMI-4211




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: