Comment by 0xWTF
Comment by 0xWTF 2 months ago
Can I float an adjacent model? Classes are nouns, functions are verbs.
Comment by 0xWTF 2 months ago
Can I float an adjacent model? Classes are nouns, functions are verbs.
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.
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.
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.
Working with python for a while and I still don’t bother with classes. Only when I “borrow” other code do I mess with them. It just seems like a flowery way to organize functions. I prefer to just write the functions. Maybe its because my first languages lacked classes that I don’t much like to reach for them.
I don’t even like loops and prefer to functionalize them and run in parallel if sensible.
I know this makes me a bit of a python heathen but my code runs fast as a result.
Didn’t the Apollo guidance computers work with VERB and NOUN?
I remember being taught that in CS101 and still use it today 15 years later. It's a good and simple and easy to follow pattern
I like to think of it completely differently: Functions are where you hide things, Classes are where you expose things.
Functions to me are more about scoping things down than about performing logic. The whole program is about performing logic.