Phobos packages a bit confusing

retard re at tard.com.invalid
Sun Nov 29 22:18:45 PST 2009


Mon, 30 Nov 2009 04:55:29 +0000, dsimcha wrote:

> == Quote from retard (re at tard.com.invalid)'s article
>> Hi
>> after using D1 and Tango for couple of years we decided to experiment
>> with D2 and Phobos in a small scale project. For some reason the mostly
>> flat package hierarchy seemed rather confusing. For instance, it took
>> two of us 15 minutes to build a program that reads a line from user,
>> converts the string to a natural number, adds one, and finally prints
>> it to the screen.
> 
> While I agree that the docs for Phobos should be improved after the
> language stabilizes, I honestly don't think 15 minutes is too bad if
> you're completely unfamiliar with the API.  Using Java's file I/O API,
> for example, practically requires a Ph.D. in object-oriented design. 
> It's just a fact of life that every API has its quirks that take time to
> learn, and anything that's not what you're used to is going to seem
> quirky at first.

Well, they have been teaching the Java i/o stuff to first year students 
for a while now. I completely agree that it's a bit too complicated for 
novices, but it's not the only bad thing:

 public static void main(String[] args)
 { System.out.println("Hello world!"); }

Wtf. They used to learn Scheme:

 (print "Hello World")

I guess the PhD requirement is a bit exaggerating. Of course you do need 
to learn some basic concepts first. OTOH I know a handful of C 
programmers who just don't get why their (unbuffered) i/o routines always 
perform badly, and use libraries instead.



More information about the Digitalmars-d mailing list