Jump to page: 1 2 3
Thread overview
Re: why ; ?
May 08, 2008
bearophile
May 08, 2008
Yigal Chripun
May 08, 2008
Janice Caron
May 08, 2008
Yigal Chripun
May 09, 2008
Bruce Adams
May 08, 2008
Nick Sabalausky
May 08, 2008
Yigal Chripun
May 08, 2008
Nick Sabalausky
May 09, 2008
Nick Sabalausky
May 09, 2008
Yigal Chripun
May 09, 2008
Nick Sabalausky
May 13, 2008
Bruno Medeiros
May 13, 2008
BCS
May 13, 2008
Yigal Chripun
May 13, 2008
BCS
May 13, 2008
Yigal Chripun
May 13, 2008
BCS
May 14, 2008
Christopher Wright
May 14, 2008
Yigal Chripun
May 14, 2008
Christopher Wright
May 14, 2008
Yigal Chripun
May 14, 2008
Joel C. Salomon
May 14, 2008
Yigal Chripun
May 15, 2008
Simen Kjaeraas
May 15, 2008
Joel C. Salomon
May 15, 2008
Yigal Chripun
May 08, 2008
Janice Caron Wrote:
> Besides which, how would that work with statements like
>     if (a == b) { ++i; ++j } else { --i; --j }
> If newlines were to take over the role of semicolons, then that would turn into
>     if (a == b) { ++i
>     ++j } else { --i
>     --j }

You may want to take a look at Scala.
Your statement can be written like this, that is readable but needs many lines:

if (a == b) {
    ++i
    ++j
} else {
    --i
    --j
}

Or like this:

if (a == b) { ++i; ++j; } else { --i; --j; }

(Plus various other ways you can use today).
Both versions are okay, because ; becomes optional when it's at the end of the line. And the symbols for line continuations are part of this proposal, I presume.

If you want to remove the brackets too, you may end with:

if a == b:
    ++i
    ++j
else:
    --i
    --j

Bye,
bearophile
May 08, 2008
IMO, this whole thread is ridiculous since you're arguing about
something that amounts to just personal style. D was created by Walter
to be part of the C family of languages therefore D should continue to
use the style Walter chose.
Personally I prefer to use ; in my code but I won't join the argument
since it's just a matter of style and personal taste.

for all the python fans here - my suggestion would be to add a switch to
the compiler to parse D files written with a Python style. D would
officially use the current style but if someone wants he could use a
python style in his own code via the proposed switch. Official code
(standard library, code on digital mars, etc) will remain in the current
style.
This extension is very low priority IMHO.

--Yigal
May 08, 2008
On 08/05/2008, Yigal Chripun <yigal100@gmail.com> wrote:
>  but I won't join the argument

You just did. :-) The only way not to join the argument is not to post your opinion, but alas you gave in to the temptation. :-)

You did hold out for a long time though.
May 08, 2008
Janice Caron wrote:
> On 08/05/2008, Yigal Chripun <yigal100@gmail.com> wrote:
>>  but I won't join the argument
> 
> You just did. :-) The only way not to join the argument is not to post your opinion, but alas you gave in to the temptation. :-)
> 
> You did hold out for a long time though.

All I stated is my preferred style without getting into the whole argument which style is technically better. So you see, technically I _didn't_ post my opinion so I didn't join the argument after all.

My firm belief on the subject is that you should always choose the best
tool for the job and that there are no absolutes. People who go for such
absolutes confirm the phrase: "When all you got is a hammer, everything
becomes a nail", which is to say that I don't think any one style is
absolutely always better than all the other alternatives.
Another factor to this debate is this -
http://en.wikipedia.org/wiki/Sapir-Whorf_Hypothesis

--Yigal
May 08, 2008
"Yigal Chripun" <yigal100@gmail.com> wrote in message news:fvvk5j$k56$1@digitalmars.com...
> IMO, this whole thread is ridiculous since you're arguing about something that amounts to just personal style.

I think it's been a very interesting discussion.

Yes, there is a lot that comes down to preference in the end, and yes, we have come up with some such things in this thread. But we can't just go around assuming that all opposing viewpoints are always equally valid, because a lot of times they just simply aren't.  Sometimes a clear "best practice" does emerge. Not by unanimous vote though, but by merit of the argument itself. For instance, everyone could agree 2+2=5, but that doesn't make it so, and by the same token, one rouge diehard "2+2=5" person doesn't turn "2+2=4" from a fact into an opinion or a preference.

And on the things that do turn out to be matters of preference, it's still interesting (my opinion) and potentially helpful/productive (which I submit as fact, but open for debate, of course) to see the pros and cons of each actually laid out for all to see.


May 08, 2008
Nick Sabalausky wrote:
> I think it's been a very interesting discussion.
> 
> Yes, there is a lot that comes down to preference in the end, and yes, we have come up with some such things in this thread. But we can't just go around assuming that all opposing viewpoints are always equally valid, because a lot of times they just simply aren't.  Sometimes a clear "best practice" does emerge. Not by unanimous vote though, but by merit of the argument itself. For instance, everyone could agree 2+2=5, but that doesn't make it so, and by the same token, one rouge diehard "2+2=5" person doesn't turn "2+2=4" from a fact into an opinion or a preference.
> 
> And on the things that do turn out to be matters of preference, it's still interesting (my opinion) and potentially helpful/productive (which I submit as fact, but open for debate, of course) to see the pros and cons of each actually laid out for all to see.
> 

Where in my post did you read that I said "[we should] go around assuming that all opposing viewpoints are always equally valid"? I know what I wrote and that ain't it.

I said that this specific argument which I'm replying to is about personal preferences/style only and is not a technical discussion related to D and have stated my opinion that arguing about _this_specific_subject_ is ridiculous. In the same way you could argue that you prefer you code to be shown with red color and someone else would argue that green is better. Colors do have pros and cons regarding eye-sight but they don't make your red if statement any better than Janice's green one from a code POV. Both will compile to the same assembly code. therefore, unless you discuss the pros and cons of colors to a programmer's sight, arguing whether red code is better than green code is indeed ridiculous.

If you decide to discuss next which editor is better: vi[m] or emacs (since as you say, this is "potentially helpful/productive" in your opinion) than count me out since yet again this comes down to personal preference.

--Yigal

PS: it's amazing how such smart people can waste so much time and energy debating such unimportant issues as the semicolon at the end of statements with such a passion.
May 08, 2008
"Yigal Chripun" <yigal100@gmail.com> wrote in message news:fvvtu6$16tq$1@digitalmars.com...
> Where in my post did you read that I said "[we should] go around assuming that all opposing viewpoints are always equally valid"? I know what I wrote and that ain't it.
>

Where in my post did you read that I said "You said that we should go around assuming that all opposing viewpoints are always equally valid"? ;)

But you did say "this whole thread is ridiculous", even though we discussed other issues besides "semicolon-oriented language" vs. "newline-oriented language". If you really meant just the particular branch of the thread you replied to and not actually the whole thread, then ok, fair enough.

> If you decide to discuss next which editor is better: vi[m] or emacs (since as you say, this is "potentially helpful/productive" in your opinion) than count me out since yet again this comes down to personal preference.

Sure. After all, nobody would say that you were obligated to participate. Feel free to pick and choose which discussions you wish to participate in. I do that, just as I image most of the others here do.

> PS: it's amazing how such smart people can waste so much time and energy debating such unimportant issues as the semicolon at the end of statements with such a passion.

One could make the same claim about meta-debates, such as this. (I'm not actually making that claim though. I don't personally mind the occasional meta-debate.)

Besides, I think it's good to periodically challenge, and be challenged by, each others viewpoints. This way we don't stagnate, isolated in the world of our own preferences, possibly even blind to the occasional mistaken assumption. For all I know, someone might say something that makes me think of Python in a new way and I decide "Wow, this is my new preference. I like Python better than D. If I had just agreed to disagree then my eyes never would have been opened to this."

As real-world examples, when I first started reading about Python, I had a knee-jerk reaction and decided "this is garbage, I'm not going near it", and that was that. But a couple weeks ago I was talking to a friend who liked Python, we disagreed, but still discussed, and I realized that Python did have some good functional-ish features - things that even my favorite language, D, could use to borrow. And I also came to the conclusion that it really wouldn't kill me, at the very least, to write a quck little prototype, script, etc., in Python every now and then. All this even though I still consider, for example, the rationale behind Python's indentation to be logically flawed and inappropriate for large projects. In much the same way, my friend ended up getting interested in D (To paraphrase: "Wow, a static typed, non-VM language without the muss and fuss of C/C++, who knew?").

If we had just decided "these are matters of preference, discussing it is ridiculous", and avoided what seemed like a pointless discussion, then where would we both be right now? Sitting in our own happy ignorance.


May 09, 2008
"Nick Sabalausky" <a@a.a> wrote in message news:g003u3$1g02$1@digitalmars.com...
> "Yigal Chripun" <yigal100@gmail.com> wrote in message news:fvvtu6$16tq$1@digitalmars.com...
>> Where in my post did you read that I said "[we should] go around assuming that all opposing viewpoints are always equally valid"? I know what I wrote and that ain't it.
>>
>
> Where in my post did you read that I said "You said that we should go around assuming that all opposing viewpoints are always equally valid"? ;)
>
> But you did say "this whole thread is ridiculous", even though we discussed other issues besides "semicolon-oriented language" vs. "newline-oriented language". If you really meant just the particular branch of the thread you replied to and not actually the whole thread, then ok, fair enough.
>
>> If you decide to discuss next which editor is better: vi[m] or emacs (since as you say, this is "potentially helpful/productive" in your opinion) than count me out since yet again this comes down to personal preference.
>
> Sure. After all, nobody would say that you were obligated to participate. Feel free to pick and choose which discussions you wish to participate in. I do that, just as I image most of the others here do.
>
>> PS: it's amazing how such smart people can waste so much time and energy debating such unimportant issues as the semicolon at the end of statements with such a passion.
>
> One could make the same claim about meta-debates, such as this. (I'm not actually making that claim though. I don't personally mind the occasional meta-debate.)
>
> Besides, I think it's good to periodically challenge, and be challenged by, each others viewpoints. This way we don't stagnate, isolated in the world of our own preferences, possibly even blind to the occasional mistaken assumption. For all I know, someone might say something that makes me think of Python in a new way and I decide "Wow, this is my new preference. I like Python better than D. If I had just agreed to disagree then my eyes never would have been opened to this."
>
> As real-world examples, when I first started reading about Python, I had a knee-jerk reaction and decided "this is garbage, I'm not going near it", and that was that. But a couple weeks ago I was talking to a friend who liked Python, we disagreed, but still discussed, and I realized that Python did have some good functional-ish features - things that even my favorite language, D, could use to borrow. And I also came to the conclusion that it really wouldn't kill me, at the very least, to write a quck little prototype, script, etc., in Python every now and then. All this even though I still consider, for example, the rationale behind Python's indentation to be logically flawed and inappropriate for large projects. In much the same way, my friend ended up getting interested in D (To paraphrase: "Wow, a static typed, non-VM language without the muss and fuss of C/C++, who knew?").
>
> If we had just decided "these are matters of preference, discussing it is ridiculous", and avoided what seemed like a pointless discussion, then where would we both be right now? Sitting in our own happy ignorance.
>

I just re-read what I wrote here and realized it came across a little bit hippy-ish. Anybody: feel free to sprinkle in a few "fuck"s or "damnit"s as you read it. ;)


May 09, 2008
Nick Sabalausky wrote:
> "Nick Sabalausky" <a@a.a> wrote in message news:g003u3$1g02$1@digitalmars.com...
>> "Yigal Chripun" <yigal100@gmail.com> wrote in message news:fvvtu6$16tq$1@digitalmars.com...
>>> Where in my post did you read that I said "[we should] go around assuming that all opposing viewpoints are always equally valid"? I know what I wrote and that ain't it.
>>>
>> Where in my post did you read that I said "You said that we should go around assuming that all opposing viewpoints are always equally valid"? ;)
>>
>> But you did say "this whole thread is ridiculous", even though we discussed other issues besides "semicolon-oriented language" vs. "newline-oriented language". If you really meant just the particular branch of the thread you replied to and not actually the whole thread, then ok, fair enough.
>>
>>> If you decide to discuss next which editor is better: vi[m] or emacs (since as you say, this is "potentially helpful/productive" in your opinion) than count me out since yet again this comes down to personal preference.
>> Sure. After all, nobody would say that you were obligated to participate. Feel free to pick and choose which discussions you wish to participate in. I do that, just as I image most of the others here do.
>>
>>> PS: it's amazing how such smart people can waste so much time and energy debating such unimportant issues as the semicolon at the end of statements with such a passion.
>> One could make the same claim about meta-debates, such as this. (I'm not actually making that claim though. I don't personally mind the occasional meta-debate.)
>>
>> Besides, I think it's good to periodically challenge, and be challenged by, each others viewpoints. This way we don't stagnate, isolated in the world of our own preferences, possibly even blind to the occasional mistaken assumption. For all I know, someone might say something that makes me think of Python in a new way and I decide "Wow, this is my new preference. I like Python better than D. If I had just agreed to disagree then my eyes never would have been opened to this."
>>
>> As real-world examples, when I first started reading about Python, I had a knee-jerk reaction and decided "this is garbage, I'm not going near it", and that was that. But a couple weeks ago I was talking to a friend who liked Python, we disagreed, but still discussed, and I realized that Python did have some good functional-ish features - things that even my favorite language, D, could use to borrow. And I also came to the conclusion that it really wouldn't kill me, at the very least, to write a quck little prototype, script, etc., in Python every now and then. All this even though I still consider, for example, the rationale behind Python's indentation to be logically flawed and inappropriate for large projects. In much the same way, my friend ended up getting interested in D (To paraphrase: "Wow, a static typed, non-VM language without the muss and fuss of C/C++, who knew?").
>>
>> If we had just decided "these are matters of preference, discussing it is ridiculous", and avoided what seemed like a pointless discussion, then where would we both be right now? Sitting in our own happy ignorance.
>>
> 
> I just re-read what I wrote here and realized it came across a little bit hippy-ish. Anybody: feel free to sprinkle in a few "fuck"s or "damnit"s as you read it. ;)
> 
> 

I'm glad that you realize that I was talking about "semicolon-oriented language" vs. "newline-oriented language". I never said we shouldn't discuss python vs. D which (again) was not discussed in this thread. this very long discussion was about the semicolon and you already know what I think of such discussions.

Your post actually proves my original post. If you read it again you would realize that I said that I prefer to use the right tool for the job, be it D, python or even VB (ok, I would probably would never use VB if I can help it ;) ). Also, there's was link to a wiki page about the Sapir hypothesis in there. Sapir is a linguist and he noticed that the language used by a people affects their way of thinking. Applying this to our discussion means that a C/C++ programmer "thinks" in a C/C++ way and it would be harder for him to understand python vs D. Hence your knee jerk reaction to Python as you stated above. so you see, you've just proved my point.

--Yigal
May 09, 2008
"Yigal Chripun" <yigal100@gmail.com> wrote in message news:g0156n$lj6$1@digitalmars.com...
> Nick Sabalausky wrote:
>> "Nick Sabalausky" <a@a.a> wrote in message news:g003u3$1g02$1@digitalmars.com...
>>> "Yigal Chripun" <yigal100@gmail.com> wrote in message news:fvvtu6$16tq$1@digitalmars.com...
>>>> Where in my post did you read that I said "[we should] go around assuming that all opposing viewpoints are always equally valid"? I know what I wrote and that ain't it.
>>>>
>>> Where in my post did you read that I said "You said that we should go around assuming that all opposing viewpoints are always equally valid"? ;)
>>>
>>> But you did say "this whole thread is ridiculous", even though we discussed other issues besides "semicolon-oriented language" vs. "newline-oriented language". If you really meant just the particular branch of the thread you replied to and not actually the whole thread, then ok, fair enough.
>>>
>>>> If you decide to discuss next which editor is better: vi[m] or emacs (since as you say, this is "potentially helpful/productive" in your opinion) than count me out since yet again this comes down to personal preference.
>>> Sure. After all, nobody would say that you were obligated to
>>> participate.
>>> Feel free to pick and choose which discussions you wish to participate
>>> in.
>>> I do that, just as I image most of the others here do.
>>>
>>>> PS: it's amazing how such smart people can waste so much time and
>>>> energy
>>>> debating such unimportant issues as the semicolon at the end of
>>>> statements with such a passion.
>>> One could make the same claim about meta-debates, such as this. (I'm not
>>> actually making that claim though. I don't personally mind the
>>> occasional
>>> meta-debate.)
>>>
>>> Besides, I think it's good to periodically challenge, and be challenged
>>> by, each others viewpoints. This way we don't stagnate, isolated in the
>>> world of our own preferences, possibly even blind to the occasional
>>> mistaken assumption. For all I know, someone might say something that
>>> makes me think of Python in a new way and I decide "Wow, this is my new
>>> preference. I like Python better than D. If I had just agreed to
>>> disagree
>>> then my eyes never would have been opened to this."
>>>
>>> As real-world examples, when I first started reading about Python, I had
>>> a
>>> knee-jerk reaction and decided "this is garbage, I'm not going near it",
>>> and that was that. But a couple weeks ago I was talking to a friend who
>>> liked Python, we disagreed, but still discussed, and I realized that
>>> Python did have some good functional-ish features - things that even my
>>> favorite language, D, could use to borrow. And I also came to the
>>> conclusion that it really wouldn't kill me, at the very least, to write
>>> a
>>> quck little prototype, script, etc., in Python every now and then. All
>>> this even though I still consider, for example, the rationale behind
>>> Python's indentation to be logically flawed and inappropriate for large
>>> projects. In much the same way, my friend ended up getting interested in
>>> D
>>> (To paraphrase: "Wow, a static typed, non-VM language without the muss
>>> and
>>> fuss of C/C++, who knew?").
>>>
>>> If we had just decided "these are matters of preference, discussing it
>>> is
>>> ridiculous", and avoided what seemed like a pointless discussion, then
>>> where would we both be right now? Sitting in our own happy ignorance.
>>>
>>
>> I just re-read what I wrote here and realized it came across a little bit
>> hippy-ish. Anybody: feel free to sprinkle in a few "fuck"s or "damnit"s
>> as
>> you read it. ;)
>>
>>
>
> I'm glad that you realize that I was talking about "semicolon-oriented language" vs. "newline-oriented language". I never said we shouldn't discuss python vs. D which (again) was not discussed in this thread. this very long discussion was about the semicolon and you already know what I think of such discussions.
>
> Your post actually proves my original post. If you read it again you would realize that I said that I prefer to use the right tool for the job, be it D, python or even VB (ok, I would probably would never use VB if I can help it ;) ).

Agreed on VB ;)

Not everyone always agrees what the right tool for a given job is. But the problem is: even when preference plays a large part, it isn't always due 100% to preference. For instance, sometimes a mistaken assumption may have slipped in, or an oversight. We don't know if it really is purely preference, or if faulty reasoning has managed to slip in until it's...discussed.

> Also, there's was link to a wiki page about the
> Sapir hypothesis in there. Sapir is a linguist and he noticed that the
> language used by a people affects their way of thinking. Applying this
> to our discussion means that a C/C++ programmer "thinks" in a C/C++ way
> and it would be harder for him to understand python vs D. Hence your
> knee jerk reaction to Python as you stated above.

A knee-jerk reaction which I then (at least partially) overcame through...discussion. The Sapir hypothesis doesn't mean that we should just stick to our native language and avoid comparing/contrasting languages. But what it does mean that we're naturally blind to the pros/cons of that which we are unfamiliar with. Avoiding discussion allows this natural ignorance to persist, while participating in discussion helps to dispell it.


« First   ‹ Prev
1 2 3