LWN.net Logo

Haiku

Haiku

Posted Jun 3, 2011 19:16 UTC (Fri) by cmccabe (guest, #60281)
In reply to: Haiku by daglwn
Parent article: Object-oriented design patterns in the kernel, part 1

> > *Everyone* is using some kind of subset of C++.
>
> Not true, and if they are, they're Doing It Wrong.

Really? Let me ask you: when was the last time you wrote code that used throw specifications? Or the "export" keyword for templates? Or wide character streams (wchar)? Have you ever used protected inheritance?

Wake up and smell the coffee. You're programming in a subset of C++. You are no doubt convinced that your subset is "modern" and "progressive", whereas everyone else's is "backwards" and "old-fashioned". But it's still a subset.


(Log in to post comments)

Haiku

Posted Jun 3, 2011 21:09 UTC (Fri) by daglwn (subscriber, #65432) [Link]

This makes no sense. If this is your criteria, everyone programs in a subset of their favorite language. When's the last time you used gets()?

The point is that the tools to use shouldn't be artificially restricted. If someone wants to use protected inheritance, let them as long as they can show why it's necessary or beneficial.

Haiku

Posted Jun 4, 2011 1:07 UTC (Sat) by cmccabe (guest, #60281) [Link]

You're mixing apples and oranges. gets() isn't a language feature, it's a library function.

> The point is that the tools to use shouldn't be artificially restricted.
> If someone wants to use protected inheritance, let them as long as they
> can show why it's necessary or beneficial.

You didn't answer my question. When was the last time you used those features?

You say that programmers shouldn't be "artificially restricted" from doing things that are "necessary and beneficial", but those are weasel words. The reality is, you'll just define necessary and beneficial as whatever you've been doing. So if you've been throwing exceptions as pointers, it's obviously "necessary and beneficial" for the new code to do the same. If you haven't been using throw specs, obviously the new code shouldn't have them. But you're not using a subset of the language, oh no.

As a side note, what's with the gets() obsession in these programming language debates. I don't think I was even alive the last time someone used gets() in a real program.

Haiku

Posted Jun 4, 2011 1:11 UTC (Sat) by cmccabe (guest, #60281) [Link]

As a side note, I found this highly amusing:
http://stackoverflow.com/questions/214321/what-c-features...

Literally every comment has a completely different view of which C++ features are "evil." I don't think you can find even two distinct answers that agree. I can only imagine what a novice programmer, fresh out of school, would think after reading this :)

Haiku

Posted Jun 4, 2011 5:52 UTC (Sat) by elanthis (guest, #6227) [Link]

It saddens me that it's become the norm to expect a "novice" who's had a full four years worth of a $100,000 education to have his first experience with real-world languages be a StackOverflow posting.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds