The Helper Forums
The Helper offers free technical support for computer games,
computer hardware, and other computer software. Staffed
by volunteer tech support workers, The Helper is highly
regarded as a premium destination for those who are
experiencing technical problems with their computers.
Affiliate Sites
Warcraft 3 World Editor Tutorials - The Greatest Resource for the new Warcraft 3 Mapper
Silkroad Online Forums
Houston Microsoft Access, VBA and Visual Basic Programming
The source for NUON news, information, and games.
Griffonrawl Muay Thai and MMA
Warcraft 3 Modding Site.
Element Tower Defense by Karawasa.
Topaz Games.
Chernobyl Lost Riddles

Able Auto Glass specializes in Houston Auto Glass Replacement as well as windshield repair and replacement services.
Apex Steel Pipe - Buys and sells Used Steel Pipe.

Go Back   The Helper Forums > Warcraft Zone > World Editor Help > JASS Help

Reply
 
Thread Tools Display Modes
  #16  
Old November 7th, 2009, 05:51 PM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Quote:
Originally Posted by Nestharus View Post
In compiled programming, the switch statement immediately goes to the set case.
Are you sure? I've learned most of what you say is assumptions so I doubt I believe that. I don't see what mechanism could make that possible.
Reply With Quote
  #17  
Old November 8th, 2009, 12:06 AM
Nestharus's Avatar
Nestharus Nestharus is offline
o-o
 
Join Date: Aug 2006
Posts: 1,223
Nestharus is starting to get some respect (+100)Nestharus is starting to get some respect (+100)
Switch statement is just multi branch goto...


jesus4lyf, given who you are I didn't expect I'd have to explain that to you ...


Again, switch statements in JASS are impossible... if you are doing it just for syntax that's just totally misleading, not to mention pointless.


Now, you may call my statements wrong when it comes to JASS, but when it comes to the real world, you'll find I'm right. JASS doesn't follow real world trends, so I may use real world examples since I assume JASS does the same thing.

Quote:
I've learned most of what you say is assumptions
And where on earth do I get those assumptions? Now we are talking about a feature from real world programming languages, not from JASS, so this is not at all an assumption. If I ever have an assumption, it only ever has to do with JASS relating to hard cold facts from real world languages. I don't just pull them out of a hat.

Last edited by Nestharus; November 8th, 2009 at 12:32 AM.
Reply With Quote
  #18  
Old November 8th, 2009, 12:30 AM
Narks's Avatar
Narks Narks is offline
-= THE GAME =-
 
Join Date: Sep 2005
Posts: 1,055
Narks is starting to get some respect (+100)Narks is starting to get some respect (+100)
lol ninja edit

i see wut u did thar


I think switch is a really good idea, who cares about efficiency? People who want to be efficient will know to avoid switch.
Reply With Quote
  #19  
Old November 8th, 2009, 12:33 AM
Nestharus's Avatar
Nestharus Nestharus is offline
o-o
 
Join Date: Aug 2006
Posts: 1,223
Nestharus is starting to get some respect (+100)Nestharus is starting to get some respect (+100)
Narks, that post made 0 sense unless you are thinking of using pure trigger evaluations ;|.


Trigger evaluations would be similar to a switch statement actually, but... they'd be hella slow ^^

And if you wanted to do labels.. that'd be like multiple trigger evaluations per trigger evaluation o-o.
Reply With Quote
  #20  
Old November 8th, 2009, 12:56 AM
Narks's Avatar
Narks Narks is offline
-= THE GAME =-
 
Join Date: Sep 2005
Posts: 1,055
Narks is starting to get some respect (+100)Narks is starting to get some respect (+100)
Actually now that I've read up switch statements, I realize they are different from the "Select Case" statements in visual failbasic.

I thought switch was just like a bunch of if / else statements.
Reply With Quote
  #21  
Old November 8th, 2009, 03:00 AM
Jesus4Lyf Jesus4Lyf is offline
Good Idea™
 
Join Date: Jul 2007
Location: Australia
Posts: 3,857
Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)Jesus4Lyf has a reputation beyond repute (+1000)
Quote:
Originally Posted by Nestharus View Post
Switch statement is just multi branch goto...


jesus4lyf, given who you are I didn't expect I'd have to explain that to you ...


Again, switch statements in JASS are impossible... if you are doing it just for syntax that's just totally misleading, not to mention pointless.


Now, you may call my statements wrong when it comes to JASS, but when it comes to the real world, you'll find I'm right. JASS doesn't follow real world trends, so I may use real world examples since I assume JASS does the same thing.



And where on earth do I get those assumptions? Now we are talking about a feature from real world programming languages, not from JASS, so this is not at all an assumption. If I ever have an assumption, it only ever has to do with JASS relating to hard cold facts from real world languages. I don't just pull them out of a hat.
Quote:
Originally Posted by Wikipedia
Optimized switch
It is probably true to say however that many programmers do not realize how extremely important it is to obtain a very compact range of possible values for optimization to actually occur within the switch statement. They assume, incorrectly, that simply using a switch statement in their program is inherently efficient. It may indeed be true that the code is much neater and easier to maintain - but it is certainly not necessarily always optimized for faster execution unless the values are strictly suitable. Sometimes they have to be converted first by the programmer to a more suitable range using a simple transformation (complex/lengthy transformations may defeat the purpose so should be avoided). See algorithmic efficiency for an explanation of how the programmer can "assist" the compiler to make an efficient choice. See also the section 'Compiler generated branch tables' in branch table article for why optimization is not always performed as expected and how to solve this.
Important note to self: My hunches are more reliable than Nestharus' "expertise" and it appears he doesn't have any idea what he talks about.

>Switch statement is just multi branch goto...
Do you know how machine code works? Even I understand that there is "jump if", "jump if not", "jump" or "return" - not "jump to this, that, or the other thing based on what value it is".

>I may use real world examples since I assume JASS does the same thing.
>And where on earth do I get those assumptions?
Apparently, they're based on other guesses...
Reply With Quote
  #22  
Old November 9th, 2009, 11:47 AM
Nestharus's Avatar
Nestharus Nestharus is offline
o-o
 
Join Date: Aug 2006
Posts: 1,223
Nestharus is starting to get some respect (+100)Nestharus is starting to get some respect (+100)
Edit
Just realized we were arguing two completely different points from me misreading your post

Last post states this ><
End Edit

Last edited by Nestharus; November 9th, 2009 at 02:25 PM.
Reply With Quote
  #23  
Old November 9th, 2009, 12:33 PM
phyrex1an's Avatar
phyrex1an phyrex1an is offline
Staff Member and irregular helper
 
Join Date: Mar 2005
Location: Sweden
Posts: 3,776
phyrex1an has disabled reputation
Quote:
Originally Posted by Nestharus View Post
The argument is not about switch statement optimization, so your quote is completely irrelevant -.-.
Then what are we talking about? What is there about the switch that isn't "just syntax" or optimization?
__________________
Reply With Quote
  #24  
Old November 9th, 2009, 02:23 PM
Nestharus's Avatar
Nestharus Nestharus is offline
o-o
 
Join Date: Aug 2006
Posts: 1,223
Nestharus is starting to get some respect (+100)Nestharus is starting to get some respect (+100)
Quote:
In JASS, it really wouldn't matter whether you were using a switch statement or a set of ifs. In compiled programming, the switch statement immediately goes to the set case. In compiled programming, switch statements are faster than ifs -.-, but this isn't compiled programming is it? It's interpretive, so it really doesn't matter which way or the other .


Unless jesus4lyf is arguing about how switch statements are sometimes slower than ifs o-o, and in that case I totally misunderstood because of this-

Quote:
Do you know how machine code works? Even I understand that there is "jump if", "jump if not", "jump" or "return" - not "jump to this, that, or the other thing based on what value it is".
And now I'm reading that ;o.

Jesus4Lyf was responding to the speed of switch statements in relation to if statements while I was responding that switch statements are different from if.

My bad : D.

I was primarily talking about the fact that they are totally different, which a lot of people didn't understand ; ). Jesus4Lyf took one small portion of my post and talked about that without saying what he was talking about ><.

Quote:
Quote:
In compiled programming, the switch statement immediately goes to the set case.
Are you sure? I've learned most of what you say is assumptions so I doubt I believe that. I don't see what mechanism could make that possible.
I believed he was trying to say that switch were just like if statements with that remark ><, like saying jump etc didn't exist.

I was not debating about optimized switch statements ><.

Quote:
Optimized switch
It is probably true to say however that many programmers do not realize how extremely important it is to obtain a very compact range of possible values for optimization to actually occur within the switch statement
lol


Next time jesus4lyf needs to be more clear about what he is responding to.


Final
Also my initial post wasn't fail... my statements were completely correct -.-. Again, we were arguing too completely different points, so I could say the exact same thing about your responses -.- j4l.

Last edited by Romek; November 9th, 2009 at 02:40 PM.
Reply With Quote
  #25  
Old November 10th, 2009, 07:11 AM
Vexorian's Avatar
Vexorian Vexorian is offline
Why no custom sig?
 
Join Date: Apr 2005
Posts: 814
Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)Vexorian has much to be proud of (+800)
I was going to add switch to Zinc but not the ugly C-style break based ones. As for Jass, I think a chain of elseif is more readable considering JASS' audience. And any Jass switch statement would just compile to chained elseifs anyway, so...
Reply With Quote
  #26  
Old November 10th, 2009, 08:31 AM
TheDamien's Avatar
TheDamien TheDamien is offline
_
 
Join Date: Nov 2006
Posts: 2,719
TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)TheDamien has a reputation beyond repute (+1000)
Quote:
Originally Posted by Jesus4Lyf View Post
Do you know how machine code works? Even I understand that there is "jump if", "jump if not", "jump" or "return" - not "jump to this, that, or the other thing based on what value it is".
The jump address/offset can be computed at run time. When Nestharus says "multi branch goto" he is referring to a jump table.
Reply With Quote
  #27  
Old November 10th, 2009, 12:35 PM
Nestharus's Avatar
Nestharus Nestharus is offline
o-o
 
Join Date: Aug 2006
Posts: 1,223
Nestharus is starting to get some respect (+100)Nestharus is starting to get some respect (+100)
He knows that already, he was talking about switch statement speed vrs if statement speed.

Don't worry, his statements threw me off too ; )
Reply With Quote
  #28  
Old November 10th, 2009, 01:11 PM
Renendaru's Avatar
Renendaru Renendaru is online now
Swish swish, back and forth.
 
Join Date: Jun 2008
Location: ?
Posts: 3,965
Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)Renendaru is a sight to see (+700)
Quote:
Originally Posted by Nestharus View Post
He knows that already, he was talking about switch statement speed vrs if statement speed.

Don't worry, his statements threw me off too ; )
Nestharus, you throw yourself off. Takes people 12 posts to explain a simple sentence to you at times.

I don't like the idea of switch, but its uses are fine I suppose.
__________________
------------------
ekjdslkfjslkdfjlskdfjksdkf
-------------------

[14:43] <Vestras> I hate fags and jews
Reply With Quote
  #29  
Old November 10th, 2009, 04:12 PM
GetTriggerUnit-'s Avatar
GetTriggerUnit- GetTriggerUnit- is offline
.
 
Join Date: May 2009
Posts: 1,311
GetTriggerUnit- seems to have the helping tendency (+150)GetTriggerUnit- seems to have the helping tendency (+150)
Quote:
Originally Posted by Vexorian View Post
I was going to add switch to Zinc but not the ugly C-style break based ones. As for Jass, I think a chain of elseif is more readable considering JASS' audience. And any Jass switch statement would just compile to chained elseifs anyway, so...
Yay!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:19 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.