• 🏆 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!

[Zinc] Finally got style

Status
Not open for further replies.

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
The Zinc language's syntax has got me on one thing: the return value is hard to spot. Right next to the list of parameters is this bizarre -> thing that really doesn't stand out from anything else on that line. So, I've come up with a pretty cool solution to that:

JASS:
function foo()
-> boolean
{
    return false;
}

I'm posting this because I know some of you brought up this weird part of the Zinc syntax, so maybe this is of use to you because to me it's very easy to identify the return value this way.
 
Level 16
Joined
Feb 22, 2006
Messages
960
The idea behind the -> is to show which type is returned... so it totally makes sense to have it in the same line as the function name itself.
Also it differentiates Zinc from C-syntax constructs (ok just a bit!)

The arrow visualizes the spot where the returned value is declared :)
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
I get Zinc Is Not C, and how it's a mutated Java/Jass/C hybrid, and I get the originality thing. Don't get me wrong on that.

Thing is, the arrow is hard to read when I'm scrolling through a long list of Zinc functions with each having many parameters, so much in fact it's almost indistinguishable. It's "uniqueness" causes unreadability, hence this hacky fix I've come up with.
 
Status
Not open for further replies.
Top