It is currently Sun May 19, 2013 2:45 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: EndWhile
PostPosted: Mon Apr 30, 2012 11:55 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Mar 24, 2004 11:04 pm
Posts: 761
Location: Seattle, USA
For improved consistency, please consider adding EndWhile as a keyword to end a While loop.
I'm not saying replace Wend, as it's already very well entrenched and in the BASIC tradition, but also allow EndWhile to be used to end a While loop as well.
This is a really minor request and I only request it because I find PureBasic already pretty consistent. We have EndIf, EndSelect, EndEnumeration, EndInterface, EndStructure, EndWith, EndProcedure, EndImport and EndMacro ... the only other termination keyword with "end" in it is Wend ... just seems like EndWhile would be more consistent there.
I know I could always add a macro like this:
Code:
Macro EndWhile
  Wend
EndMacro
But it would be handy to have it built-in to the language.

Again, a minor request but a "nice to have" IMHO.

_________________
Win7 x64, PB x86


Last edited by USCode on Tue May 01, 2012 3:52 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 3:35 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 932
Location: New York
I think I agree. "Wend" is strange and I don't know what other languages use it. "EndWhile" would be more consistent and intuitive to newcomers.

Although I've been using PB for so long I don't even think twice about typing it anymore!


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 4:34 am 
Offline
User
User

Joined: Mon Jul 09, 2007 4:47 pm
Posts: 67
Location: Right Here
kenmo wrote:
I think I agree. "Wend" is strange and I don't know what other languages use it.


It's been part of "basic" syntax from the beginning. Why should we care what other languages use? Basic precedes most of them. :)


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 10:48 am 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
... so on this line of thought, we should also have EndFor and EndRepeat? :|


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 10:52 am 
Online
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2393
Location: Utah, USA
USCode wrote:
Again, a minor request but a "nice to have" IMHO.


By way of comment I don't think this request makes sense to have.

Notice the other words you used as examples:
Quote:
We have EndIf, EndSelect, EndEnumeration, EndInterface, EndStructure, EndWith, EndProcedure, EndImport and EndMacro ... the only other termination keyword with "end" in it is Wend ... just seems like EndWhile would be more consistent there.


I Notice that you left out a few other 'end'-ing keywords. They're all looping words: Next, Until, Forever, and Wend. Would you suggest, for consistency, to use in addition to EndWhile to also moving to EndFor, EndRepeat, EndRepeatALot? That would seem a scary prospect. The alternative of just adding EndWhile and leaving the rest with no 'additions' wouldn't be consistent.

The looping words were chosen (for the most part :wink: ) because they make sense, not because they followed a pattern. To be consistent they should be left as they are without the need of any syntatic sugar. You already mentioned how you would do it with a macro if you wanted it (though, if it is for a beginner you've already moved into more advanced territory).

Furthermore, what about other keywords such as Return, or the function names in libraries: StopDrawing(), Stop3D(), StopSpecialFX(), StopPrinting()?


Even though I'm not a newbie and this is a minor request, I still wouldn't be in favor of this (-1).

_________________
Image


Last edited by Demivec on Tue May 01, 2012 10:53 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 10:52 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 1563
Location: Berlin, Germany
Foz wrote:
... so on this line of thought, we should also have EndFor and EndRepeat? :|

... and "EndForEach" and "EndGosub" :x :?:

_________________
Math problems?
Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 11:08 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4714
Location: Berlin - Germany
EndOfWorld :mrgreen:

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 11:45 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1456
kenmo wrote:
"Wend" is strange and I don't know what other languages use it.

:shock: "While/Wend" is in AutoIt, Visual Basic, PowerBasic, RealBasic, Liberty Basic, QBasic, JustBasic...

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 5:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Mar 24, 2004 11:04 pm
Posts: 761
Location: Seattle, USA
Foz wrote:
... so on this line of thought, we should also have EndFor and EndRepeat? :|

No, I wasn't suggesting we have those. For-Next and Repeat-Until, those are understandable words in context.
However, I understand Wend has been around forever and is used in many other BASIC-like languages.

Not that Fred was likely to add it anyways! :wink:

_________________
Win7 x64, PB x86


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 7:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 791
When someone has a feature request that they feel important enough to post, and others rant about how lame the request is, it is very annoying. Especially when it is a backwards-compatible request that does not force a change upon people. Unfortunately, users on this board are experts at rants like that. Regardless of the reasons, Fred implements changes as he sees fit regardless of the popularity and/or logical improvement we as users see. Couple that with his lack of time (having been doing this "on the side" for the past few years), and in the end, very few "sugar" requests are implemented. Perhaps he'll sweeten PB up for us a bit after he finishes his recently-announced mind-blowing updates, now that he is back on PB "full time."

Having said that, "wend" is likely the single most common way to end a while loop in all basic languages. This is likely one of those time where the syntax may be confusing and/or frustrating when you are learning a new language, but once you give in and get accustomed to it you soon forget it was ever an issue.

When I first started using PB, I made a macro for LocalVar, because I strongly disliked using "Protected." I'd never seen that keyword used before, and wanted something I would recognize quicker. I'd forgotten all about that until last month I ran into some code I wrote early on. I think I only used the macro for a week, maybe two. By the time I saw so many samples in Help, the Forum and in the many library sites, it kind of became second nature. Perhaps wend will become that way for you; in the meantime, be prepared for a long wait, if it ever comes.


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 7:10 pm 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 911
USCode wrote:
For improved consistency, please consider adding EndWhile as a keyword to end a While loop.
I'm not saying replace Wend, as it's already very well entrenched and in the BASIC tradition, but also allow EndWhile to be used to end a While loop as well.
This is a really minor request and I only request it because I find PureBasic already pretty consistent. We have EndIf, EndSelect, EndEnumeration, EndInterface, EndStructure, EndWith, EndProcedure, EndImport and EndMacro ... the only other termination keyword with "end" in it is Wend ... just seems like EndWhile would be more consistent there.
I know I could always add a macro like this:
Code:
Macro EndWhile
  Wend
EndMacro
But it would be handy to have it built-in to the language.

Again, a minor request but a "nice to have" IMHO.


Wend = W(hile)End. Quite logical as it stands don't you think?


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 7:57 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Mar 24, 2004 11:04 pm
Posts: 761
Location: Seattle, USA
LuCiFeR[SD] wrote:
Wend = W(hile)End. Quite logical as it stands don't you think?
:|

So then ...
If -> Iend
Select -> Send
Procedure -> Pend
With -> Wend ... (this one in particular illustrates why Wend is a bad idea, but it is what it is)
... no thanks. :wink:

Fred's not going to add it anyways, so this is all academic.

_________________
Win7 x64, PB x86


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 9:56 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 791
USCode wrote:
Fred's not going to add it anyways, so this is all academic.

I agree.

On the other hand, "wend" sounds like a word, while "iend" does not; "endif" flows smoothly as a word.

In reality, he has clearly chosen his keywords based on existing language syntax.


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 10:00 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 932
Location: New York
MachineCode wrote:
:shock: "While/Wend" is in AutoIt, Visual Basic, PowerBasic, RealBasic, Liberty Basic, QBasic, JustBasic...

Fair enough. I've only used a few of those, and not recently... Most of my non-PB experience uses "EndWhile" or just braces. :)

Demivec has a good point that none of the loop-keywords start with "End", and I was unaware that "Wend" is the most common keyword to end a "While".

But I don't know why everyone is extrapolating one specific keyword suggestion to dozens more keywords. USCode didn't ask to change For/Next (everyone recognizes those) or Repeat/Until/Forever (these are needed to distinguish how the loop repeats) or StopDrawing/Stop3D/etc (these are library functions not keywords) or Return or ForEach or anything else...

By that logic, you could take any Feature Request, expand it into 50 different feature requests, then argue they're unnecessary. :twisted:

Anyway I am neutral toward adding "EndWhile"... Honestly I would probably still use "Wend" out of habit.


Top
 Profile  
 
 Post subject: Re: EndWhile
PostPosted: Tue May 01, 2012 11:03 pm 
Online
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2393
Location: Utah, USA
kenmo wrote:
But I don't know why everyone is extrapolating one specific keyword suggestion to dozens more keywords. USCode didn't ask to change For/Next (everyone recognizes those) or Repeat/Until/Forever (these are needed to distinguish how the loop repeats) or StopDrawing/Stop3D/etc (these are library functions not keywords) or Return or ForEach or anything else...


@kenmo: USCode's feature request was made based on a desire/need for consistency.

Demivec wrote:
The alternative of just adding EndWhile and leaving the rest with no 'additions' wouldn't be consistent

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye