4 ms·
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
by StrawberryFrog 17y ago
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)
- nddrylliog 17y agoThat'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/ http://docs.ooc-lang.org/ from this git repo http://github.com/nddrylliog/ooc-docs 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.
- StrawberryFrog 17y ago>> 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))
- nddrylliog 17y agoAnd 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.
- bonecandy 17y agoI think your writing was fine! I like seeing some style with programming talk :D
- StrawberryFrog 17y agoStriking 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 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.
- ahpeeyem 17y ago+1 for a -hardass flag, that would be awesome
- nddrylliog 17y agohttp://github.com/nddrylliog/ooc/issues/#issue/25 http://github.com/nddrylliog/ooc/issues/#issue/25 =)
- StrawberryFrog 17y agoFriendly 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".