News for hackers. Stuff that matters.
Re:Ooc - modern object oriented c by StrawberryFrog on Thursday October 15, 2009 @04:56AM (#883019)
The documentation has issues, e.gs.

"But remember, the compiler is your friend. He guessed that's what you wanted to return."

Yuk, a compiler is not a cuddly teddy bear, and I really don't want a compiler to "guess", I want it to be very predictable in its behaviour.

add: func(a, b : Int)

Previous function example specifies a return type, why doesn't this one?

The strange little dots

Oh please.

No explanation of why some things seem to be prefix, e.g. "Hi, softer world =)" println() and some are infix, e.g. add(1, 2)

Re:Ooc - modern object oriented c by nddrylliog on Thursday October 15, 2009 @05:03AM (#883024)
That's why it's called a "tour", not a reference documentation ;) Reference docs are being written, and are updated here http://docs.ooc-lang.org/ from this git repo http://github.com/nddrylliog/ooc-docs If you want to help you're welcome.

> A compiler is not a cuddly teddy bear

Why, shouldn't it? I always found gcc so cold and all. Friendly compilers surely aren't so bad. I could do a -hardass flag if you wanted.

> Previous function example speicifes a return type, why doesn't this one?

Wohow, my bad. Fixed in the doc.

> The strange little dots

Actually they are strange, because they're unexpected. It's a bit of the syntax that would probably most appeal to perl hackers, and is totally optional.

EDIT: Realized the return type was missing in add: func definition. :/ sorry.

Re:Ooc - modern object oriented c by StrawberryFrog on Thursday October 15, 2009 @06:21AM (#883101)
Friendly compilers surely aren't so bad.

No, they aren't bad. Cryptic error messages are just annoying.

Would "inferred" be a better word than "guessed" in that context? It sounds more deterministic, conveys more of a meaning of "worked it out for itself from the context" rather than "rolled the dice and took a stab at what you might mean".

Re:Ooc - modern object oriented c by StrawberryFrog on Thursday October 15, 2009 @05:16AM (#883036)
>> Previous function example speicifes a return type, why doesn't this one?

> Because the function doesn't return anything (e.g. is void), I guess.

Have another look at it. Does "add" look to you in this context at all like a function that returns void?

printf("1 + 2 = %d\n", add(1, 2))

Re:Ooc - modern object oriented c by nddrylliog on Thursday October 15, 2009 @05:23AM (#883046)
And now I feel very dumb.

You were right :/ It's all fixed now, thanks a lot for reporting.

(At first I thought that you thought that return type specification was non-optional, e.g. that it lacked "-> Void")

About the other issues: are you really bothered by them? (e.g. the familiarity of the writing, etc.) I thought it'd be less boring, but I didn't mean it to annoying.

EDIT: fixed the "strange little dots" and "compiler is your friend" parts.

Re:Ooc - modern object oriented c by StrawberryFrog on Thursday October 15, 2009 @06:01AM (#883076)
Striking the right tone is hard, and you can't please everyone. Personally, I like a slightly conversational tone, but it's easy to got to far with it, and it just becomes a waste of words. You're writing to please the reader, not the writer ( see http://news.ycombinator.org/item?id=875094 ).

E.g. "Foreaches. Foreaches is like.. a regular For that gave up alcohol, decided to shave daily, and bought a new suit. It's prettier, and more effective. "

I've been programming in C# for years, I know foreach. It's a workhorse feature that I use daily. There are similar constructs in Ruby and PHP and others.

Re:Ooc - modern object oriented c by bonecandy on Thursday October 15, 2009 @05:57AM (#883073)
I think your writing was fine! I like seeing some style with programming talk :D
Re:Ooc - modern object oriented c by ahpeeyem on Thursday October 15, 2009 @06:03AM (#883079)
+1 for a -hardass flag, that would be awesome
Re:Ooc - modern object oriented c by nddrylliog on Thursday October 15, 2009 @10:19AM (#883405)