wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-06-2009, 09:59 AM   #16
C2H3NaO2
User
 
Join Date: May 2008
Posts: 80

C2H3NaO2 is on a distinguished road (17)

Default

Quote:
Originally Posted by grim001
Can you post code examples of why you need super and overwriting methods?
Expand JASS:

This is only a _small_ example. In my you can find something like this everywhere.
There are about 15 specializations of BuffSignal and BuffSignalFactory so it is very gerneral useable.
C2H3NaO2 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-06-2009, 10:30 AM   #17
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I have no clue what the heck that code is supposed to be doing. I guess this is why people say that implementation inheritance is evil, it allows the creation of absurdly overcomplicated code.

I am sure that whatever you are doing could be done with less complication, more performance, etc if you didn't code it like that.

Anyway, rather than code, do you mind explaining conceptually what overwriting implemented methods and using .super() is enabling you to do that is impossible or difficult to work around without it?
grim001 is offline   Reply With Quote
Old 07-06-2009, 10:41 AM   #18
C2H3NaO2
User
 
Join Date: May 2008
Posts: 80

C2H3NaO2 is on a distinguished road (17)

Default

Of cause I could use creepy workarrounds, but than it would have to copy much code arround and all in all it would be much more code (belive me, I saw other 'simple' solutions to this problems). It would be impossible to maintain if a litte thing copied to 20 places would be buggy.
C2H3NaO2 is offline   Reply With Quote
Old 07-06-2009, 11:16 AM   #19
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

That is not very specific. What is it that you would have to copy to 20 places without overwriting methods or super?

Are you aware that you can allocate structs of an interface by typeid?
grim001 is offline   Reply With Quote
Old 07-06-2009, 08:28 PM   #20
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
* Type safety gets added to the mix. So...
Collapse JASS:

local somestruct = someinteger


Will cause errors, I told you to use typecasts...

Is it really necessary or it's just to prevent people of being dumb ?
I don't see a way where you can fail with that, without see easily your error.
Or maybe you consider the code will be less senseless ?

I'm agree with ToukoAozaki, if you do that you should add a fashion way to make an empty struct.

Btw, I didn't have use stub super and i won't miss them, the rest seems fine for me.

Last edited by Troll-Brain : 07-06-2009 at 08:31 PM.
Troll-Brain is offline   Reply With Quote
Old 07-06-2009, 08:54 PM   #21
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

I use stub and super, but if a better way to do the things is arriving, I'll await for the best decision.

Quote:
* Type safety gets added to the mix. So...
Collapse JASS:

local somestruct = someinteger


Will cause errors, I told you to use typecasts...
HAHAAA!!!! for all the lazy people who avoided integer(struct)

Last edited by moyack : 07-06-2009 at 08:57 PM.
moyack is offline   Reply With Quote
Old 07-06-2009, 09:47 PM   #22
C2H3NaO2
User
 
Join Date: May 2008
Posts: 80

C2H3NaO2 is on a distinguished road (17)

Default

Quote:
Originally Posted by grim001
Are you aware that you can allocate structs of an interface by typeid?
And what should i do about the init method?
C2H3NaO2 is offline   Reply With Quote
Old 07-06-2009, 10:51 PM   #23
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Troll-Brain
Is it really necessary or it's just to prevent people of being dumb ?
Typecasting is one thing, you're supposed to be extra careful when doing that, but when simply passing structs as arguments to functions you can easily make a mistake in maps with many interfaces that have other interfaces as their members (like passing the struct to a function instead of it's member) and it's really hard to find the kind of mistake that the compiler should by all standards warn you about.
__________________

Last edited by Anitarf : 07-06-2009 at 10:52 PM.
Anitarf is offline   Reply With Quote
Old 07-07-2009, 12:06 AM
Litany
This message has been deleted by Litany.
Old 07-07-2009, 12:30 AM   #24
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I recall Vex saying that using set i=struct instead of set i=integer(struct) is perfectly fine as far as he is concerned, so that likely won't be enforced. set s=struct(integer), however, will be.
__________________
Anitarf is offline   Reply With Quote
Old 07-07-2009, 01:30 AM   #25
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

I keep the costume of using integer(struct) to get the index, because I think is helps in readability. It doesn't cause any harm to do it in this way and it helps people avoid confusions with integers.

*Being pending how this thread evolves...*

Last edited by moyack : 07-07-2009 at 02:57 PM.
moyack is offline   Reply With Quote
Old 07-07-2009, 01:47 AM   #26
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Just means I'm not going to be ever updating jasshelper or JNGP again. Suits my purposes, I don't particularly need any of the new stuff anyways.
__________________
Rising_Dusk is offline   Reply With Quote
Old 07-07-2009, 02:34 AM   #27
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

It's been like a month since stubs were added, I don't see why some people already can't do without them. They're practically the same thing as interfaces.
__________________
Anitarf is offline   Reply With Quote
Old 07-07-2009, 03:33 AM   #28
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Quote:
Originally Posted by Rising_Dusk
Just means I'm not going to be ever updating jasshelper or JNGP again.

Rather than saying that the point of this thread is to discuss why said changes should or shouldn't be made... what is it what would be too annoying to change after the update?
grim001 is offline   Reply With Quote
Old 07-07-2009, 04:54 AM   #29
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

The whole type-safety thing, as should have been obvious from the post just prior to mine.
__________________
Rising_Dusk is offline   Reply With Quote
Old 07-07-2009, 05:15 AM   #30
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Yeah I don't particularly see the need for type safety either unless it enables some kind of new features later on.
grim001 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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


All times are GMT. The time now is 10:19 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services