Comment by acbart

Comment by acbart 2 months ago

6 replies

And then at some point someone shows you how Classes can be verbs, and functions can be nouns, and your brain hurts for a while. You overuse that paradigm for a while, and eventually learn to find the appropriate balance of ideas.

2muchcoffeeman 2 months ago

Writing code is like writing though. None of these ideas for structuring code are the be all and end all of coding. Things evolve, sometimes old idea are good, sometimes new.

Like how the phrase “to boldly go where no man has gone before” will bring out pendants.

  • AStonesThrow 2 months ago

    I don't believe that anyone wears pendants much on that show, unless you mean the communicators people wear in TNG. I did have a Romulan keychain once, though.

nailer 2 months ago

Haven’t seen that yet after 25 years. It just always seems like lazy naming when this isn’t followed. Maybe I missed something.

  • angra_mainyu 2 months ago

    I have to agree, particularly if you look at functions as pipelines: data/events go in, other data/events go out.

    If I had to hazard some kind of heuristic with 99% applicability, it'd be to always strive to have code with as few indentations (branches) as possible. If your code is getting too indented, those deep Vs are either a sign that your implementation has a strong mismatch with the underlying problem or you need to break things up into smaller functions.

kiviuq 2 months ago

Example: Object Algebra pattern represents data types ("nouns") as functions.