Re:Pointers Are More Abstract Than You Might Expect in C
by NeedMoreTea on Monday July 02, 2018 @08:18AM
(#17441009)
That was the argument of C++ advocates in the 90s.
[ Parent
| on HN ]
Re:Pointers Are More Abstract Than You Might Expect in C
by kibwen on Monday July 02, 2018 @09:50AM
(#17441564)
Considering that C doesn't have any good facilities for polymorphism, it's going to continue to be the argument of any language that succeeds C. Unless, that is, that successor language also doesn't have any good facilities for polymorphism, in which case we have Go as a fascinating real-world study in how people will incessantly demand them and deride the language for lacking them (which is saying something, considering that interface{} in Go is already better than pretty much anything one would hack up in C via void pointers or macros).
Re:Pointers Are More Abstract Than You Might Expect in C
by basementcat on Monday July 02, 2018 @12:10PM
(#17442872)
Apparently under certain conditions it is possible to emulate a crude form of ad hoc polymorphism in C.
https://codegolf.stackexchange.com/questions/2203/tips-for-g...
Re:Pointers Are More Abstract Than You Might Expect in C
by CyberDildonics on Monday July 02, 2018 @11:19AM
(#17442390)
Wasn't it originally a much bigger deal to be able to have the facilities for more generic programming before templates? These days people's threshold for bloat seems much higher, while the penalty for allocation and jumping around in memory are much higher as well.
Re:Pointers Are More Abstract Than You Might Expect in C
by AnimalMuppet on Monday July 02, 2018 @01:18PM
(#17443540)
I presume that you are defining C++'s virtual functions as "not a good facility for polymorphism". Why?
Re:Pointers Are More Abstract Than You Might Expect in C
by int_19h on Monday July 02, 2018 @03:21PM
(#17444600)
OP said nothing about C++, just plain C.
Re:Pointers Are More Abstract Than You Might Expect in C
by AnimalMuppet on Monday July 02, 2018 @03:46PM
(#17444781)
Ah, I see. I agree.
Re:Pointers Are More Abstract Than You Might Expect in C
by pjmlp on Monday July 02, 2018 @10:53AM
(#17442112)
At least C11 has light generics support.
Re:Pointers Are More Abstract Than You Might Expect in C
by marcosdumay on Monday July 02, 2018 @02:04PM
(#17444002)
It was just recently that C++ got some underpowered kind of generics (beyond templates). So, no, I don't think anybody advocated that in the 90's.
Late 90's advocacy was much more on the lines of "OOP lets you reuse code" and "widget libraries are great, and they all but require OOP". One of those is blatantly correct.