View mode: basic / threaded / horizontal-split · Log in · Help
September 12, 2010
Re: Input handling? (newbie alert!)
On Saturday 11 September 2010 13:54:19 Cavalary wrote:
> Hm, to me "informatics" made sense :) Not sure if I ever heard it
> used in English, but it sounds more suitable than "computer
> science", which (no matter how it's officially used) sounds like
> it would include everything that deals with computers, so hardware
> as well.

Informatics is essentially the term used in at least some European languages 
other than English. Personally, I think that the name is no better - if not 
worse - than computer science, since it implies that it has to do with the study 
of information, which doesn't necessarily have anything to do with computers, 
math, or logic. Apparently the term is already taken by more or less that 
anyway: http://en.wikipedia.org/wiki/Informatics_(academic_field) . But I've 
never heard a term which really properly captured what computer science / 
informatics is.  All candidates have problems of one sort or another. In any 
case, I was just pointing out to Bearophile that the official English term is 
computer science so that he's better able to communicate in English (from this 
and other posts, I gather that English is not his first language, though he's 
definitely fluent). What the best term would technically be really isn't of 
consequence, since it's not like we really get to pick at this point.

> And thanks again. Haven't seen readln() used in any of the
> examples I glanced over, so would have had no idea about it
> otherwise...

The examples on D's site are generally both sparse and old. Many of the projects 
on dsource are either D1 and/or old, so it's not a great place to look for 
examples either. The reality of the matter at this point is that you're going to 
have to read through the Phobos docs if you want to find all of the functions 
which could be useful to you. Also, I think that many of the examples in the 
language documentation in particular (rather than the Phobos docs) are more 
likely to be C in style rather than taking advantage of more idiomatic D stuff 
like ranges. My guess is that that's because a fair bit of it was done by Walter 
rather than Andrei.

In any case, good examples of D code are rather lacking at this point, so you'll 
have to explore the Phobos docs yourself and pay attention to what people post. 
For that matter, you could dive in the Phobos code and have a look there. 
std.range and std.algorithm are probably particularly good to look at - though 
neither would really help you with I/O.

However, Andrei's recently published book "The D Programming Language" 
(typically referred to as TDPL around here) is a fantastic source for learning 
about D. So, if you haven't picked that up yet, I highly recommend it.  It's the 
best introductory book to a programming language that I've ever read (probably 
in part because it doesn't assume that you've never programmed in your life and 
have no clue what basic stuff like variables or if statements are - it does 
explain how they work in D though). Howeve, t does mean shelling out around $40, 
so whether it's worth it depends on how serious you are about learning and using 
D.

- Jonathan M Davis
September 12, 2010
Re: Input handling? (newbie alert!)
Yeah, one of the reasons why it made sense to me I guess, as the
term's "informatica" in Romanian, so the mental link was instant
even if I probably never heard it used in English before.

A programming language that doesn't put effort into teaching
people how to use it isn't exactly likely to end up with a
significant userbase, don't you think? (As for D1, from my 1
attempt to compile my "toy" into it I know it can't handle
my "hybrid" use of foreach (just how it made sense to me when
porting from Ruby... and since it worked in D2, great).)
But yeah, starting to poke around through the Phobos docs and even
the files (when I looked for random number generators, when the
compiler announced that rand was deprecated, and also for the
rounding functions... "Hm? Undefined? If I were a rounding
function, where would I be? ... Math? Let's see what's in there
then.")

readln seems to do well enough for input for the moment. I'll be
looking into file I/O later.
Just put in my first working try-catch last night too. (After
scratching my head a lot because from the example I was given I
assumed catch needed a random parameter, though I didn't
understand why. Then the compiler errors made me try with no
parameter (as in catch()), variable types, the word "class",
either alone or followed by various things (since it said it only
accepted classes)... Eventually found a post in the learn archives
that said that if you want catch-all you just put in catch with no
parentheses and went duh!)

About seriousness... At the moment I don't even know if I'll still
have it installed next week. And I'll need to be REALLY serious
about something to shell out $40 on a book about it! And there's
also the matter of availability over here (though Andrei's name
says he was most likely at least born here).
September 12, 2010
Re: Input handling? (newbie alert!)
Jonathan M Davis:

> Informatics is essentially the term used in at least some European languages 
> other than English. Personally, I think that the name is no better - if not 
> worse - than computer science, since it implies that it has to do with the study 
> of information, which doesn't necessarily have anything to do with computers, 
> math, or logic.

I think the term "Informatics" is better than "Computer Science" for this field we are talking about, because despite there are parts of math and logic that it doesn't cover, it does cover the part related to the management of information, its processing, storage, and transmission, that are large parts of this field. On the other hand "Computer Science" is mostly misleading, both words don't fit very well with what this field is.


> In any case, I was just pointing out to Bearophile that the official English
> term is computer science so that he's better able to communicate in English

English is something you learn and use, but it's also something created by people, so it's also something you can influence, grow, and improve. This is why it's positive for everyone to try to improve the language.


> (from this and other posts, I gather that English is not his first language,
> though he's definitely fluent).

Thank you :-) You are right, English is not my first language. My English grammar has some evident holes (The usage of 'can', 'may' and 'might' are one of the most evident ones, that I need to fill). My general linguistic skills are awful, the work I have done to learn some English is probably enough for your average human to learn three languages :-) I now know a bit of English just because I was stubbornly determined to learn it, no matter how much work.

Bye,
bearophile
September 12, 2010
Re: Input handling? (newbie alert!)
On Sunday 12 September 2010 04:18:01 Cavalary wrote:
> Yeah, one of the reasons why it made sense to me I guess, as the
> term's "informatica" in Romanian, so the mental link was instant
> even if I probably never heard it used in English before.
> 
> A programming language that doesn't put effort into teaching
> people how to use it isn't exactly likely to end up with a
> significant userbase, don't you think?l

There are higher priorities at the moment. For the most part, the folks who 
would be working on examples and the like are busy on dmd, druntime, and/or 
phobos. While D and dmd have essentially stabilized now as far as features go, 
there's plenty of bug fixing to do, and Walter is busy on things like the port to 
64 bit and making shared libraries work. And more importantly, yhobos is still 
very much a work in progress, so while much of it is going to stay the way that 
it is more or less permanently, there's plenty of it which is still in flux, so 
it doesn't make a lot of sense to create a whole lot of examples using it. As it 
matures, I'm sure that there will be more example code, but it's still pretty 
young at this point.

> readln seems to do well enough for input for the moment. I'll be
> looking into file I/O later.
> Just put in my first working try-catch last night too. (After
> scratching my head a lot because from the example I was given I
> assumed catch needed a random parameter, though I didn't
> understand why. Then the compiler errors made me try with no
> parameter (as in catch()), variable types, the word "class",
> either alone or followed by various things (since it said it only
> accepted classes)... Eventually found a post in the learn archives
> that said that if you want catch-all you just put in catch with no
> parentheses and went duh!)

Typicall what you'd do is use catch(Exception e), so you can do things like 
print the exception, but catch without parens will work (you just don't have 
access to the exception).

> About seriousness... At the moment I don't even know if I'll still
> have it installed next week. And I'll need to be REALLY serious
> about something to shell out $40 on a book about it! And there's
> also the matter of availability over here (though Andrei's name
> says he was most likely at least born here).

That's totally understandable. However, since D2 has recently become  
essentially stable feature-wise (as in within the last few months), TDPL is 
pretty much _the_ source for anything in-depth on D (though, as phobos isn't 
particularly mature yet, it doesn't cover much of phobos). As time goes on, I'm 
sure that online resources will improve, but D has been in flux for so long as 
it's been being developed, that online examples and the like tend to be out of 
date or nonexistent. With time, that will change though. As for availability, I 
don't know the best way to get it in Romania, but I know that folks in Europe 
have ordered it from Amazon without any problems. And while I don't know if 
Andrei was born in Romania, as I understand it, he does have family there, and 
he has an accent, so he probably was.

- Jonathan M Davis
September 14, 2010
Re: Input handling? (newbie alert!)
Cavalary wrote:

> Yeah, one of the reasons why it made sense to me I guess, as the
> term's "informatica" in Romanian

Getting back to the tutorial question, with the remote chance that you 
know Turkish as well, there is

  http://ddili.org/ders/d/index.html

That tutorial still uses std.cstream (din.readf, etc.) though. I tried 
to convert it to stdin.readf but could not go far with 2.048. I am 
waiting for future releases with more novice-friendly standard input 
handling.

Ali
September 14, 2010
[OT] Re: Input handling? (newbie alert!)
bearophile wrote:

> I think the term "Informatics" is better than "Computer Science" for this
> field we are talking about

On a related note, "programmers" are called "software engineers" in the 
US, at least in Silicon Valley.

> "Computer Science" is mostly misleading, both words don't fit very well
> with what this field is.

Agreed. About programming, I am pretty convinced that it is a craft more 
than anything else.

> My English grammar has some evident holes

I know that I am not kualified ;) to judge, but your English is just 
perfect.

Ali
September 14, 2010
Re: [OT] Re: Input handling? (newbie alert!)
On Tuesday, September 14, 2010 10:41:53 Ali Çehreli wrote:
> bearophile wrote:
>  > I think the term "Informatics" is better than "Computer Science" for
>  > this field we are talking about
> 
> On a related note, "programmers" are called "software engineers" in the
> US, at least in Silicon Valley.

Well, software engineers are programmers, but programmers aren't necessarily 
software engineers - just like there is a software engineering major in addition 
to computer science. Their focus is different.

>  > "Computer Science" is mostly misleading, both words don't fit very well
>  > with what this field is.
> 
> Agreed. About programming, I am pretty convinced that it is a craft more
> than anything else.

I believe that the idea is that computer science is the study of computers - 
like how political science is the study of politics. However, computer science 
only covers the software side of things, isn't entirely tied to a computer, and 
is really more like math or engineering (though when you focus on the 
engineering side of things, you start straying into software engineering rather 
than computer science) rather than science, since (aside from debugging) it 
really has nothing to do with the scientific method. So, while the basic idea 
behind the name is solid, it doesn't really fit very well when you get down to 
the details.

- Jonathan M Davis
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home