• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Modules

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
What's the point of custom functions, I mean, I can write everything with a few functions.

I think you mean natives here :0

Also custom functions are much more different than modules. Unless we call modules "custom-struct-part".

@Chaosy: I took a look into Alloc by Sevion (not the one by Nestharus) and I think I get it but do you guys think that Vexorian thought the same when creating modules inside JASShelper?
 
Yes, natives. But you also need a little bit of functions for trigger actions and generally wherever you need "code".

Do you have any programming experience outside of wc3? Because it's obvious you should use modules to generalize code/add innate functionality and exactly NOT TO write same shit over again, especially if you need it many times over. I am trying to make sure to use extends, interfaces and modules to either make the code more readable, shorter, easier to change or to standardize it in a way, you need all those tools in a real programming environment in one shape or another, hence why they're good to use for wc3 too if you're working on something complex.

Also read vJass help, vexorian outlines why he made modules.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
People seem to forget WC3 is not a real programming environment as JASS is actually quite a bad language.

If there were better JASS optimizers half the functionality of vJASS would not be needed as much of it is to allow for manual optimizations. For example the inline statement for functions to automatically inline expand a function at the call site to avoid function call overhead. Although C++ has a similar key word, it is ignored by most modern optimizing compilers since they automatically inline expand when appropriate anyway and do so far more appropriately than humans can.

You might think of considering reuse when writing a script but the reality is Jscripts get reused very seldom. If you write a mega complex system chances are you will be the only person who will ever use or maintain it.
 
Level 7
Joined
Oct 19, 2015
Messages
286
I don't know what you're talking about. Most of vJass is about functionality, not optimization.
 
Status
Not open for further replies.
Top