News for hackers. Stuff that matters.
Re:Can you use a class in C? by danhau on Sunday August 13, 2023 @07:52AM (#37109030)
Thank you. You put into words what I was thinking.

The best paradigm in programming has to be procedural style. The cleanest code I’ve written and read has always been procedural. I even maintain a monster VBA Word Macro at work and - after some much needed refactoring - its pretty easy to understand (ignoring VBA’s warts).

The flow of logic and dependencies on data is much easier to follow in procedural.

Re:Can you use a class in C? by thewix on Sunday August 13, 2023 @10:13AM (#37110208)
I prefer functional. Procedural is not restrained enough and allows for mutable global state. This can go off the rails when multiple people are in the code.

Functional stresses composition so functions should stay small, and ADTs allow for all effects (errors!) to be represented. Strong typing helps reduce the number of tests I need to write, as well.

Re:Can you use a class in C? by diarrhea on Sunday August 13, 2023 @05:14PM (#37114578)
I think ADTs and effects system are orthogonal though. A “print” has an effect but I don’t know of languages where failure of that is propagated (for example in Rust, println doesn’t evaluate to Result).