4 ms·
Again, these are all your preferences/opinions which you are stating as some sort of acknowledged truth; which is most definitely not the case. While there are
by rramadass 2y ago
Again, these are all your preferences/opinions which you are stating as some sort of acknowledged truth; which is most definitely not the case. While there are many good points about Rust it is quite over-hyped with evangelical zeal which is why a lot of software engineers are turned off of it. Graydon Hoare himself has said he took the good ideas from old languages and put them together. That in itself is obviously not a bad thing (imo, the industry killed research in programming languages/OS from the mid-nineties when Java was marketed up the wazoo by Sun throwing ungodly amounts of money at it) but the "saviour complex" being pushed is a strict no-no with experienced C/C++ developers.
- sunshowers 2y agoI don't think there really is any reasonable way to disagree with "constraints liberate, liberties constrain", sorry. Anyone who has spent any amount of time with algebraic structures in mathematics will grasp this intuitively, as will anyone who has written code in a type-safe style. It really is a basic law of nature, similar to other basic principles like Bayes' law. I only brought in Rust because it does polymorphism in a non-OO style.
- rramadass 2y agoPointing to Algebraic structures is not an argument since it is fundamental to mathematics and hence to programming in any language. What do you think a Type/ADT is? Why do you think user-defined types exist in any language? It is a given, the only difference is the strict pov taken by functional languages vs. imperative (procedural/OO) languages. There is a reason i pointed to the example of linking the derived type's contracts (i.e. properties) with the base type's because that would have made the isomorphism between two algebraic structures clearer (which you didn't seem to understand). Repeating some slogan is not knowledge. You have to go beyond the immediate notation/syntax in any language to the abstract concept it is trying to express. That is the heart of mathematics and programming. Since you brought up algebraic structures, C++ can express it directly using template syntax and relationships between them using parametric polymorphism non-OO style. Not only that, but because in C++ genericity is unconstrained, we actually can use OO inheritance for a type hierarchy and then using it to get constrained genericity. This flexibility is quite powerful and you get full type checking. To understand all this (and apply the concepts in any other language) see the books by Alexander Stepanov viz. From Mathematics to Generic Programming and Elements of Programming.