296
you are viewing a single comment's thread
view the rest of the comments
[-] lemmesay@discuss.tchncs.de 9 points 7 months ago

I oscillate between using more functional paradigms and more object-oriented ones. is that normal?
I use a linter BTW(TypeScript) if that is a useful info.

[-] jkrtn@lemmy.ml 9 points 7 months ago

I think using both is normal. Closures and objects are duals of each other. Do whatever is understandable and maintainable, neither paradigm is magic.

[-] lemmesay@discuss.tchncs.de 4 points 7 months ago

that's a nice way to look at it. thanks!

[-] kogasa@programming.dev -1 points 7 months ago

Is the duality statement meant to be true in a technical sense?

[-] jkrtn@lemmy.ml 1 points 7 months ago

Yeah! For example, if the language allows closures to capture state, they can act like properties on an instance.

[-] kogasa@programming.dev 1 points 7 months ago
[-] jendrik@discuss.tchncs.de 1 points 6 months ago

A closure is a function with captured state. An object is state with methods.

load more comments (9 replies)
this post was submitted on 21 Mar 2024
296 points (94.8% liked)

Programmer Humor

19315 readers
71 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS