JASS, vJASS & cJASS. What's the difference?

Status
Not open for further replies.
Level 20
Joined
Jul 6, 2009
Messages
1,885
They aren't really same. JASS is JASS, Warcraft's language. vJASS and cJASS are languages that get compiled into JASS so they all have same abilities and limits except that it's easier to work with vJASS and cJASS.
Though vJASS allows something that's impossible in JASS - using any type of global variable. This is limited for JASS since you have to use variable manager.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I'm pretty sure if you import your script (via the Import Editor) with the name war3map.j you can declare your own global variables. They do it in the *.j file so I can't see there being problems if you were to do like that yourself.

It's not like if you use JASS you can't declare global variables, you just have to go about it a different way. Similarly, in vJass it is possible to define lines in your script which create objects in the object editor. While this exact feature wasn't available in JASS it was still possible to do it by actually using the Object Editor.
 
Level 13
Joined
May 11, 2008
Messages
1,198
cJASS has a bug i noticed with textmacro that is actually quite rare. it also has some bug with static if. besides that, i've the only other bugs i noticed was the colorizer for tooltips seemed to be broken, and the TESH update for /* */ comments was locked, and uncustomizable.

since nestharus is a big fan of static if, i see that one he could complain about. the first bug i mentioned, like i said is a rare bug, and the bug about tooltips has nothing to do with jass, and the bug about TESH is pretty annoying but not something worth crying about.

i'm curious nestharus, what other bugs did you find with cjass? so far i'm very pleased with it.

edit: well, besides what i'd mentioned, i believe there's no improvement of cjass for the vjass extras, for example.

function nameoffunction takes nothing returns nothing -vJASS
nothing nameoffunction() -cJASS

as of now, i don't know that you can make a method or a module or whatever using this same setup...
but i'd hardly call it a bug...just some sort of inconvenience that it hasn't been updated? i can hardly use modules and structs and methods right now, anyway...but hey, i'm learning. you can still use those...you can mix cjass in with it all. you just don't have the support of the cjass declaration of functions also for the methods, i guess, i think...and i'm still not knowing the actual difference between a method and a function...

cjass is basically easier to customize and edit than vjass is. other than that there's not much else cjass has to offer. but that is a pretty big deal that it's easier to edit and customize.

i would've switched from gui if it only meant that the code was easier to edit.
 
Level 13
Joined
May 11, 2008
Messages
1,198
The reason why I'm not a fan of cJASS isn't because I'm a fan of static ifs, but rather because it breaks vJASS.

i don't know what you're talking about. the adichelper runs and then jasshelper runs afterwards. therefore you can use cjass and vjass in a map. if you want to use only vjass, you can disable adichelper. you seem to just be giving out an unclear message that it breaks vjass. if you can't provide examples, as i did, who can take you seriously?
 
Level 13
Joined
May 11, 2008
Messages
1,198
where do you use \n? i can't remember what it does nor do i remember seeing it in any code.

also, i didn't even know you could declare anything in a static if, are you sure you don't mean the static if bug i'm referring to?(static if is not even possible in cjass, you have to comment it out, meaning the adjustments have to be made manually, rather than automatically)

anyway, it feels like minor inconvenience...yes these things need fixing.

you have written a lot of resources so perhaps you know that static if are useful, but i find them a waste of time(in the end, the code only runs one way). and new jasshelper break old jasshelper /* */ comments so complain cjass /* */ comments break vjass comments is pretty unfair statement, isn't that right?
 
JASS:
static if true then
    local integer i = 0
endif
//with cJASS
local integer i = 0
local integer i //this one is read as not being declared at the top, so it's declared by cJASS
set i = 0 //within if statement

//////////////////////////////////
call Ho (/*
*/)
//with cJASS, bug


////////////////////////
local string s = " "
//with cJASS optimizer
local string s = ""
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
He doesn't actually mean the string "\n" he means the character that said escape-character refers to. The "character" "\n" represents a hit of the enter key, an end to the current line of text and beginning to a new one.

Basically you cannot separate your code on multiple levels which can be used well to organize code and make things line up nicely.
 
Level 13
Joined
May 11, 2008
Messages
1,198
you don't need that. that's what \ is for. it's the opposite of ;.

not sure what you're trying to point out with static if. as i said, you can't use them in cjass at all.
about the one space string optimizing...when does anyone use a one space string? at any rate if you for some weird reason used it you can disable the optimizer.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
you don't need that. that's what \ is for. it's the opposite of ;.

No, the ";" character is used when programming to signify the end of a line. The character "\n" would be used in a string as a character that starts a new line of text.

Try it out using DisplayTimedTextToPlayer.
 
Also, you can't just say use the cJASS features instead... that's pretty much saying that if you use cJASS, you can't use any vJASS resources >.>...


So no, ; is a syntax error in vJASS.

#if is a syntax error

about the one space string optimizing...when does anyone use a one space string?

save/load delimiter...

No, the ";" character is used when programming to signify the end of a line. The character "\n" would be used in a string as a character that starts a new line of text.

in vJASS/JASS, \n represents end of line. The /* */ works because it comments out that \n, lol.
 
Level 13
Joined
May 11, 2008
Messages
1,198
i've been making new lines in strings by manually making new lines.

i thought new lines were made with |n, and not \n. well, like i said, the \ lets you put code on a new line but it is treated as the previous line. so if you have a very wide line of code you can break it up into multiple lines for easier viewing without the horizontal scrolling that is very annoying. it's simpler to type \ than /*
*/
so i have a reason to say what i said. i would add support for the vjass features for cjass if i could, but i can't. so far, the cjass is more convenient than the vjass.

i don't even know what # is for...
; is a cjass command it is compiled before you get to vjass, so there is not an error with vjass with ;.
 
As if JASS isn't dysfunctional.

So true, but it's happily the least dysfunctional of all of them. At the language itself doesn't error out when you like try to make a local variable in a function.

vJASS, for example, doesn't handle modules correctly when they're in static ifs.
JASS:
static if B then
    static if C then
        implement H
    endif
elseif D then
    implement H
endif

H is only implemented one time, and it is on that first implement statement. vJASS reads it like this
JASS:
implement H
implement H

So the second one is always ignored.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
But what I'm saying, I guess, is that static ifs aren't even available in normal JASS. They work to the extent of which they can be useful, and that's all that really matters. Nobody is forcing anybody to use static if-statements, or implement modules.

In JASS you can't even use a static if-statement, let alone code a module which you can implement into different structs to simulate inheritance in your code. They may not be perfect features, but they are there and work better than having nothing at all.

It's all the same thing, honestly. In the context of trying to develop a fun game the language that you use is inconsequential. While doing something in JASS as efficiently as it can be done with vJass may take a great deal more time, it still can be done.

it's happily the least dysfunctional of all of them

They're all equally dysfunctional. vJass may have features that do not function but JASS does not have them at all. The only thing that JASS offers is the declaration of functions and local variables.

I don't see how vJass can't rank higher than JASS if something like global variable declaration is an example of a feature that works properly in vJass but isn't available in the least in JASS. Also, everything that can be done in the plain JASS language can be done in vJass (whether it be the same syntax or not).

I don't even know why I'm arguing/discussing this; I'm so tired, and this topic is quite pointless.
 
I'm pretty sure if you import your script (via the Import Editor) with the name war3map.j you can declare your own global variables. They do it in the *.j file so I can't see there being problems if you were to do like that yourself.

It's not like if you use JASS you can't declare global variables, you just have to go about it a different way. Similarly, in vJass it is possible to define lines in your script which create objects in the object editor. While this exact feature wasn't available in JASS it was still possible to do it by actually using the Object Editor.

I tried this once but it did not work
is there any secret trick?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
The fact is none of them are "better" they can all be used well. The potential of JASS is the same as the potential of vJass, or cJass. The rest is just personal preference.
Eh, just because they can do the same things doesn't mean they're equally good for some application or other. If you disagree, feel free to code all your standalone programs in assembly and let me know how it works out for you.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Nah, it really can't be. C++ adds lots of stuff which makes certain high level tasks easier but JASS is missing lots of really basic stuff (like any sensible way to do waits) which are a total mess without vJass. C++ adds stuff to a language which is complete but rather barebones. vJass patches over a language which is definitely not complete.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
In order to do precise waits, you use a timer. It has been that way since before vJass. With KiTTaNa's original H2I game-cache system you could attach necessary components to the timer. Obviously it wasn't as simple as making a struct with said components and passing a single integer through, but it wasn't that far behind either.

I like vJass more, but that's not to say it is better. I think the question itself should be "which do you prefer?". Asking which one is better is assuming there is some known fact of which one is superior. You can do everything in vJass that you could do in JASS, plus more - that (I suppose) - makes it better. The problem is that once you say vJass is better you'll get a bunch of JASS fanatics who claim that vJass is inefficient, and most likely some Russian mobster who has coded an entire physics engine in standard JASS.

Is this question really this important?
 
Basicly, to wrap up this thread:

JASS = Original language (very hard to manage and pretty ugly)
vJASS = Much more features than JASS. Makes the coding closer to OOP

What vJASS does:

Static ifs:
If you have a constant boolean and you have an if statement based on it,
it will remove the unwanted part (the if part or the else part depending on what you
set the boolean to during compile time.

Structs:
They're huge arrays that are much easier to manage, recycle, and initialize.

Textmacros:
When you run a textmacro, you're just pasting code in that place :p


That's what makes vJASS awesome :)
 
Level 13
Joined
May 11, 2008
Messages
1,198
vJASS is definitely the language to code with. cJASS is an optional language you can code with in addition to vJASS to make the code come together more smoothly(matter of opinion). oldschool JASS means you're pretty much relegated to using it in combination with GUI. as far as i know there's no way to actually delete generated objects in vJASS so even a little editing is still necessary for the Object Editor....But being able to define all your own variables without using the clumsy variable list in GUI is a pretty big deal.
 
Status
Not open for further replies.
Top