LWN.net Logo

C for anything

C for anything

Posted Feb 3, 2011 4:10 UTC (Thu) by ncm (subscriber, #165)
In reply to: LCA: Lessons from 30 years of Sendmail by HelloWorld
Parent article: LCA: Lessons from 30 years of Sendmail

No, he's right. Wright Flyers are grounded, trucks have entirely supplanted horse-drawn wagons, LCDs drove out CRTs, and does anybody use the x86 instruction set any... um.

C++ is clearly the better choice. You have keep the Java monkeys away, though, or you'll spend your life writing Get and Set functions, and calls to them. Fortunately Java monkeys are more attracted to Ruby and other four-letter languages.

(This is not meant to suggest that all Java programmers are monkeys. You, in particular, are the exception.)


(Log in to post comments)

C for anything

Posted Feb 6, 2011 15:22 UTC (Sun) by malor (subscriber, #2973) [Link]

Trust me on this: no, I'm not. :-)

Getters and setters

Posted Feb 6, 2011 23:30 UTC (Sun) by man_ls (subscriber, #15091) [Link]

You have keep the Java monkeys away, though, or you'll spend your life writing Get and Set functions, and calls to them.
That comment is a bit cruel, but it's right on target. I have been wondering for the last 5 years what all those getters and setters were buying us. On one hand you were supposed to use them instead of public attributes because you could change the way to access the particular attribute later on. On the other, you were not supposed to do weird things in getters or setters since it might be considered as a bad practice. Even simple encapsulation of another object can be frowned upon in certain circles, and it certainly does not help understand the code.

I turned to public attributes a few years ago and never regretted it. You know, I'm not against the occasional access method, and separating methods with side effects from methods that return values is an excellent practice. But mandating a whole level of indirection just in case, just for the sake of it? Why?

Then I found out that not everything is an object, and I stopped wondering. My Python skills have improved since I understood that simple truth.

Getters and setters

Posted Feb 11, 2011 12:26 UTC (Fri) by mattthecat (guest, #72858) [Link]

The monkeys are those who use Java that write get and set functions.
The few of us that recognize Java without the added c**p are not monkeys.

"Don't got to use no stinkin' getters or setters"

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