Linked by Thom Holwerda on Tue 12th Oct 2010 21:52 UTC
Permalink for comment 445147
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 05/21/13 21:38 UTC
Linked by Thom Holwerda on 05/20/13 11:29 UTC
Linked by Thom Holwerda on 05/18/13 21:33 UTC
Linked by David Adams on 05/16/13 4:23 UTC
Linked by Thom Holwerda on 05/11/13 21:41 UTC
Linked by Thom Holwerda on 05/08/13 14:22 UTC
Linked by Thom Holwerda on 05/02/13 15:28 UTC
Linked by Thom Holwerda on 04/29/13 21:06 UTC
Linked by Thom Holwerda on 04/24/13 22:24 UTC
Linked by Thom Holwerda on 04/18/13 11:21 UTC
More Features »
Sponsored Links



Member since:
2010-03-08
Makes code a lot easier to read and work on for various reasons, enforces separation of the various components.
I use operator overloading heavily myself, since I implemented a cout-ish class for debug output (much easier to implement than printf, and more comfortable when it comes to using it IMO).
You can still debug with usual techniques like moving a breakpoint forward and see where things go wrong. If the code crashes after the instruction using the operator, you know who's faulty...
In a kernel, if the initialization of a basic component failed, I think it's time to panic() anyway. But if for some reason you really need an initialization/closing function to return an error code, you can just go the C way and use an "errno" global variable.
Well, new is only as complicated as you want it to be. If you want it to be an automatically-sized malloc, you can just write it this way. You're certainly *not* forced to reimplement new each time you write a new (duh) class.
Again, it's essentially a matter of high readability. In my experience, C code gets messy and unreadable a bit too easily, while with C++ it's easier to keep statements short and easy to read.
Every one has the right to have its own opinion
In my opinion, code readability is more important than ease of implementation. And my experience with Linux code is that it doesn't exactly take readability too far.
Couldn't get satisfied with the existing stuff (noticeably because I'm allergic to posix, which limits the range of possibilities quite a lot), so I rolled my own.
Edited 2010-10-15 05:56 UTC