John Lindal’s Blog
The Long Road to Hell
November 29, 2009 on 8:15 pm | In Programming | No CommentsA friend just introduced me to Variadic Templates in C++0x. When will they admit that they just plain started from the wrong place? Their example of how to print a comma-separated list of arbitrary values, which is impossible in C++ without variadic templates, is so trivial in an untyped language that nobody would bother to discuss it.
Has it really never occurred to the C++ crowd that they should start with a loosely typed language and then add in an option for compile-time type checking? Objective C actually does this. A function parameter can be id, which means it accepts anything, or it can be a type, which means that it accepts that class or any subclass, or it can be a Protocol, which means that it accepts any class which implements the required methods. (Protocols also feature prominently in the new language, Go.)
The only flaws I can see in Objective C are (1) id only accepts objects, not primitives, and (2) constructors return id, so there is no type checking when an object is created. Java fixes the former this via autoboxing, but Java doesn’t have the concept of a Protocol and reflection is very painful.
One could argue that another flaw in Objective C is the lack of private functions. However, this can be solved the same was as in JavaScript: static functions, which are accessible only to other functions declared in the same source file.
Eee PC Back Online
November 12, 2009 on 9:16 pm | In Computers | No CommentsI recently made the grave mistake of upgrading my Eeebuntu installation to the latest Ubuntu, after which support for my external monitor vanished. Ouch! I finally have it working again, after starting from a clean install off the Eeebuntu CD. This time around, it went a bit faster, since I knew that networking would not work without a kernel upgrade, so I downloaded it before the re-install. Thank goodness I put /home on a separate partition!
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^