LWN.net Logo

Day: GNOME OS

Day: GNOME OS

Posted Aug 10, 2012 7:49 UTC (Fri) by nix (subscriber, #2304)
In reply to: Day: GNOME OS by mathstuf
Parent article: Day: GNOME OS

The 'delayed const' sounds like a finer-grained 'mutable'.

(But don't mention Java. Java's lack of constness is *awful*. More than once I have introduced horrible bugs because I accidentally modified a hash key due to the silent aliasing and lack of const of java.util.Map -- meanwhile such bugs never ever happen in the STL, not due to its nifty space-age genericity, but simply because its data structures copy the types handed into them, and won't give you something back that shouldn't be modified without a const on it. For that matter I have written data structures in poor old crude C with the same 'always copy, use const' rules as the STL, and *they* never suffered from this either.)


(Log in to post comments)

Day: GNOME OS

Posted Aug 10, 2012 8:10 UTC (Fri) by jezuch (subscriber, #52988) [Link]

> But don't mention Java. Java's lack of constness is *awful*.

Yes, that's one of the very few features that I truly miss in Java. There are workarounds like defensive copies and immutable wrappers but they're no fun.

Day: GNOME OS

Posted Aug 10, 2012 17:42 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Also typedefs. I hated using Strings for everything and 5 parameters all of String to Android APIs means having to look up what the order is. At least the ordering is consistent where I used it (unlike, e.g., PHP)

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