This is by far one of the best c++ programming posts I have ever read.... quakeboy 29th January, 2008 16:12 (UTC)

This is by far one of the best c++ programming posts I have ever read…. Thank you I am quoting this in my blog

http://prasansdevblog.blogspot.com

This is by far one of the best c++ programming posts I have ever read.... Kirit Sælensminde 30th January, 2008 02:21 (UTC)
quakeboy said

This is by far one of the best c++ programming posts I have ever read…. Thank you I am quoting this in my blog

http://prasansdevblog.blogspot.com

I'm very pleased you liked it. I look forward to reading what you think about it.


To join in the discussion you should register or log in
This is by far one of the best c++ programming posts I have ever read.... Adrian 27th June, 2008 19:27 (UTC)

I'm a bit confused by the third code example. When does this resolve to false:

if ( nLat < 180. || nLat >= 180. )

This is by far one of the best c++ programming posts I have ever read.... Adrian 27th June, 2008 19:49 (UTC)
I'm not sure about this… isn't this writing a lot of code just to avoid writing a getter/setter pair? The containing class is easier to read, but to understand the class as a whole you can no longer read just one file.
This is by far one of the best c++ programming posts I have ever read.... Kirit Sælensminde 28th June, 2008 13:13 (UTC)
Adrian said

I'm not sure about this… isn't this writing a lot of code just to avoid writing a getter/setter pair? The containing class is easier to read, but to understand the class as a whole you can no longer read just one file.

I think that depends on how common the idiom is in the source code. For example, we don't worry about having to look up things like std::map or std::pair — we just use them and expect anybody reading the code to know what they are. The parts of the libraries that get used a lot need to be learned by the developers and when that happens the shorter class definitions are well worth it.

I don't think that the technique has much merit if not used pretty widely.

if ( nLat < 180. || nLat >= 180. )

I stared at this for many minutes thinking “there's nothing wrong there, what does he mean?” before I spotted the missing minus on the first half of the test. Thanks for spotting that.


To join in the discussion you should register or log in