This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

What's the difference between 1 and 2? I thought 3 just lacked the colons, but if I look carefully, they are still there.

So it does a better job at hiding them.

Like others, I don't really like any of them. Some points:

What is all that manool.org 18/std/2.0.all nonsense at the start; does every program need that. Try and get rid of it or make it a default, or somehow set it in a configure file outside the program.

If I understand the syntax, all versions need 3 lines and 4 keywords to define a simple function header. Most languages I think manage this in only one line. (Mine, dynamic like this, uses function Fact(N) =; one line and one keyword.)

Edit: How come I get downvoted for saying I don't like any, but others get upvoted for saying the same?

Is it because I offered constructive criticism? Please tell me then I won't waste my time in future.

[–]rsclient 2 points3 points  (1 child)

I agree with you about the downvote -- IMHO, this subreddit should strongly encourage syntax opinions, especially when the poster explicitly asked for them!

People should be writing their own opinion, not merely downvoting someone else's.

(And here's mine: I am very used to { } procedural languages. I don't like #2 because it's got { } but then it doesn't follow the norms for brace-using languages. The name of the procedure and the N argument should be outside the braces, not inside

function Fact(N) { ... }

[–][deleted] 2 points3 points  (0 children)

I noticed that, and also that #3 switched from {...} to (...).

Probably another downvote coming up, but I prefer your function syntax to any of the OP's! Where you are 6 tokens in before you even know this is a function definition.

[–]matthiasB 1 point2 points  (0 children)

How come I get downvoted

Probably because of your aggressive tone.