3 ms·
> Just last month there was a huge article here about sscanf taking quadratic time. That could happen to any of the functions that you are invoking. I don't re
by josephg 6y ago
> Just last month there was a huge article here about sscanf taking quadratic time. That could happen to any of the functions that you are invoking.
I don't really know how that would have been made better or worse by OO. The issue there came from a lack of transparency - its not obvious that sscanf takes time linear with the size of the input string. (FWIW, I didn't know that either).
But both OO and functional approaches can obscure details like that. So it seems kind of tangential.
> We’re better off debating about specific policies in code style.
I don't think good taste can be enforced at a code style level. The problem we have is that all problems can be solved either with OO or FP, or with actors and so on. Its much easier for programmers to learn one style and apply it everywhere, rather than learn all the different ways of expressing something and apply each one only when that approach is appropriate.
Is this what you mean by 'ontology'? When I hear that word I imagine the question of "What is the ontology of data types in our program?" - "We have products, and orders, and users, and ...". Which usually presupposes classes even when they're the wrong tool. Thinking about ontologies is a leading question, and it'll lead you to a different program from classical structured programming's question of "What does your program do". Or FP: "What does your program output, and where does that output come from?" Or dataflow programming: "How does the data move through your system?"
Programming isn't an ontology problem. Its an expression problem - how do you express your program to the computer? I still don't know how to say that in response to an overly OO PR. "Thanks for the change, but this is an inelegant expression of the problem you're solving. Can you please make the data flow primary and obvious in your code, and the ontology secondary?". That doesn't tend to go down well. Even when they're open to it, I get a lot of confused responses. "Huh? Without classes? How would you even do that?"