Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

It's not JavaScript, it's UnityScript

Discussion in 'General Discussion' started by coderarity, Feb 3, 2012.

  1. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    Couple things:

    1) Although I can accept any proposal or request to rename Unity's JavaScript to something else, all documentation currently calls it JavaScript. It is very confusing for any new reader to navigate the forum and see anyone refer to "UnityScript" when there is no documentation anywhere for such a thing. My point: unless it's officially renamed, its counterproductive to call it something that you wish it was called. When I first got started I actually thought the environment supported 4 different languages, not 3, precisely because of this usage of the name. I ignored a few search results because they were referring to their examples as UnityScript and not JavaScript.

    2) My first project was written in JavaScript, for various reasons. One: it is easier to prototype with that language due to it being laxer on the syntax (also means its easier to f-up but that can be, at times, an acceptable compromise.) Second reason is that nearly everyone agreed most the example code in the forums was written in JavaScript, and being a beginner I figured I would be in need of as much sample code as I was able to see.

    Because of this, if support for JavaScript was dropped, I would be extremely angry.

    I am writing all my new stuff in C# but I don't have the time to go back and port all my previous project to C#. It's humanly doable, but I just am too busy to do that, however I still support the title and removal of the language would force me to either port everything, never upgrade unity or keep an isolated environment with an older version of Unity just to support the title.

    Not to mention: a lot of sample code in the forums is just in JavaScript and may be become useless for new entry level developers.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    For what it's worth I code everything in unity js. I know c# rather well, I just don't feel creative enough using it. I like all the little short cuts of ujs :)

    If I was forced to use c# then I would be pissed off, yes.
     
  3. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Hippo Say No!

    /thread
     
  4. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I script in unity script and to be honnest C# confuses me alot. I would not have paid for a licence if it only supported C# as i just find it to darn hard, i do plan on learning it one day though :)
     
  5. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    It's been some time since the term "UnityScript" dominated. The persisting "JavaScript" label at UnityScript documentation snippets and other documentation documents is unfortunate and my guess is that will change soon ( there is an ongoing documentation re - writing ).

    UnityScript is a new .NET language created by Rodrigo B. de Oliveira, the creator of Boo. Quoted from http://www.manning.com/rahien/
    So it seems that mister Rodriguez made a domain specific language for game development with Unity called UnityScript. It has no relation to JScript.

    I am grateful to mister Rodriguez because using UnityScript I managed to make my first steps into programming, to learn some things about .NET, to earn back the money I gave to purchase the Unity IPhone Basic license, plus a little more. I have only done a few small steps so far but without UnityScript I wouldn't have done any steps at all. I am not able to judge as a programmer, but I am able to judge as a customer.

    I respect the opinion of the people who prefer not to use it. I am comfortable with many C# developers who complain about it, from their point of view, they are right. IMHO if someone is developing in C# components for use with Unity and finds that UnityScript support is a burden, he can simply claim " No UnityScript support". If someone wishes to "enlighten" others suggesting them to code in C# only, it is his right to do so ( it is sometimes annoying, especially when such suggestions come from not-so-brilliant junior programmers, but when dreamora and other senior C# programmers talk, their arguments do count ).

    There are some strong points and some week points in every programming language, a programmer could explain them better. From my point of view, UnityScript is great because I can code in it ( and because I keep on having beautiful discussions on #unity3d "You keep on playing for 3 years, go and learn C# at last damnit !"... :D Besides me, it seems that there is a large user base that to some people can be important as a market target. Also, it seems that many people find it easy to begin with. Sometimes, numbers count, especially in business.
    Peace,
    -Ippokratis
     
  6. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    ECMAScript-flavored JavaScript (just JavaScript from here out) is far different from UnityScript, actually. As I discuss below, the differences between UnityScript and C# are mostly syntactical. However, JavaScript has new and unique concepts that make it very different from UnityScript. JavaScript is a prototypal language, which means classes are actually just objects. (You define classes in JavaScript using a function.) This is great because you can easily add things to a class at any time, and contributes to the flexibility of the language a lot. UnityScript is a classic object oriented language, similar to C#.

    If people have problems going from UnityScript to C#, going from JavaScript to UnityScript should be far harder, since the conceptual differences between JavaScript and UnityScript are far greater than that of UnityScript and C#.

    People generally like the example code being in their language because they can just copy the code. This is bad anyways, you shouldn't just copy the code from the internet without understanding it! And if you use the code to understand it, then you should easily be able to use your understanding to write it in C#.

    -------------------------------

    And to contribute to the thread derailing that I'm just going to accept has happened at this point:

    1 - C# and UnityScript have a lot in common, and a lot of the changes are syntactical. (There are some new concepts in C#, but AFAIK nothing in UnityScript that's not also in C#). If there are just a few small changes with some concepts, there's no reason you should have significant trouble changing languages. I find the argument that C# is "harder" extremely impractical and frankly just stupid. It has additional concepts, but those are not required for use of the language, nor impede it's use.

    2 - Communicating the same concepts faster is great, as with UnityScript, but C# does have more features that can be useful.

    The point is, if your problem is with the syntax in C# compared to the syntax in UnityScript, you really need to rethink how you code.



    This whole language argument is ridiculous. It shouldn't be happening in the first place (nor in this thread), but Unity has already made the terrible decision to support 3 languages, so it is. I might note that Unity's decision has split the community, and actually acted to exactly the opposite goal they originally had with it! Unity's goal was that people had to learn less because they would already know one of the 3 languages, but what they have actually done is made everyone who uses Unity learn all 3 (or at least 2) of the languages!

    There's a general problem with people coming to Unity: they don't understand how to program. Many Unity users come to Unity and build a lot of their game by copying code and following tutorials without actually understanding what they're typing. It's vitally important that they understand the concepts related to programming completely before coming to something like Unity.

    I think this also causes a lot of the language argument: since people are copying code, they perceive it as "easier" to use UnityScript, because they can code without understanding what they're doing easier! However, their real problem is with understanding the concepts, not the languages themselves.

    So, the real solution to this problem is to learn how to code (including the concepts) before you use Unity. (especially with Unity) Then you should have no problems with examples being coded in a different language, nor switching languages for a specific project if it is required, because it's really pretty simple.
     
    Last edited: Feb 5, 2012
  7. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Not sure where it turned into a language arguement, maybe i just didnt pay to close attention ... bottom line, the thread is (was) about the name used in general to describe UnityScript. This name is javascript ... and yet its not ... as i agreed. Thats just fact.

    Next came some rediculous arguements about cutting languages from Unity, which as i said , i find highly improbable .... as far as quoting my *similiar* statement, well cmon, you can argue all the technicalities you want, but when it comes to all these higher level languages most of us use today, most are indeed very similar, as i also said in this very thread, its not to hard to adjust.
     
    Last edited: Feb 5, 2012
  8. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Epic thread :D

    on topic : Before Unity, I came from Flash Actionscript. I didn't know C# at all when I started Unity back in 2009, so I started to write a 5000 lines framework in UnitySscript. So I can say the Javascript trap worked :D

    Then one day, remembering bad experience in the past about javascript performance, I was just curious and tried to port a class into C#.
    One month later, I had rewrote all my framework into C# :p Just to say that C# gave me the impression of a very robust, safe, but yet multi-tooled framework. And after 2 years of intensive use, I can confirm that, and will never look back to US. It's like C# creators are both maniac about forcing you to structure your code, while doing all they can to give you multiple choices, all without creating unnecessary/clone classes (JAVA I'm looking at you). Down to the efficiency and performance, in short. And by reading their blogs, I'm pretty sure they're maniac :p
     
  9. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Hahah , i got no problems with either language, having come from a non game dev environment using c#, im comfortable with it, but on the other side, i have no issues with Javascript (UnityScript) either, lol. But just to +10 this , i still stay compliant and in full agreement , it should be renamed. :D

    Without threat of legal action....
     
  10. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    A while ago I was porting a little sample class from C# to UnityScript, and found out one really surprising fact. UnityScript language reference doesn't exist (or maybe I'm blind). One has to learn it using different tutorials, community wiki's, howto's, and try-and-fail method. That was shock. Now I understand the reason of having so many tutorials ― there's no other way to learn UnityScript.
     
  11. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,815
    Does someone have a Find and Replace tool for the interwebz?

    We can just replace JavaScript with UnityScript on any page containing the word Unity and we all happy :)
     
  12. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    ... and the thread title will be "It's not UnityScript, it's UnityScript"
    :)
     
  13. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,815
    lolol :)
     
  14. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    From the ECMAScript standard:

    Apparently, JScript is a distinct thing from JavaScript. From the quote above, it appears that Netscape originated the term JavaScript, which evolved into ECMAScript. However, Microsoft adapted NetScape's JavaScript to JScript for IE (which later evolved to JScript.NET). From that knowledge, it seems to me that JScript has always been distinct from JavaScript (which apparently died when Microsoft went to ECMAScript). So I think the argument that, when Unity says JavaScript, they mean JScript.NET is flimsy, since it's been distinct in the past.
     
  15. snoopbaron

    snoopbaron

    Joined:
    Mar 21, 2009
    Posts:
    88
    I think removing UnityScript support would cause more harm than good. Having to start with C# will deter a lot of non-programmers and beginners. What I would rather see is continuing to improve UnityScript so that it keeps its strengths but narrows its weaknesses when compared to C#.

    1. Release the internal UnityScript <---> C# translators (and Boo).
    2. Add the remaining features of C# that are are missing to UnityScript so that you can properly translate any code.
    3. Add an official language reference to the docs for UnityScript and Boo.

    If they did those three things the drawbacks of multiple languages would be greatly diminished and users could continue to enjoy their preferred language.

    I don't mind if the continue to call it Javascript but a prominent note in the documentation explaining that it is also known as UnityScript whith a link to the official UnityScript language reference and a section on how Unity's Javascript differs from ECMAScript would help clear things up for new users and not introduce any downside.
     
  16. actuallystarky

    actuallystarky

    Joined:
    Jul 12, 2010
    Posts:
    188
    Although a dedicated C# user I +1 snoopbaron's proposal.

    Good lord, does this mean a 4 page heated online debate can result in a sensible suggestion? One of my fundamental views on life has been shattered.
     
  17. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    The entire point of my post (large one on page 3) is that beginners shouldn't have trouble with C#. The fact that they are having trouble means that there are fundamental problems with their programming skills anyways, that should be fixed before beginning to program in Unity. Unity should try to prevent programmer errors OVER getting people to use their products. However, this is the woe of commercial game engines.

    This doesn't mean that UnityScript support should be removed necessarily. I'm just saying the argument for not removing it, being that it makes it harder for beginners, is a fairly terrible argument.
     
  18. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    We recently had a thread in which the OP was clueless when it comes to the basic data types and their ranges.

    There was another thread in which the OP was trying to save a reference of a value type.

    The idea that one can rush into scripting with no programming knowledge is flawed - something that US tends to encourage IMO. I started out with US - but luckily I already had sufficient background to not get trapped.
     
  19. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Then we come to that good ol' debate on how dynamic typing languages do generate lazy coders :p
     
  20. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    UT's objective is to put tools in people's hands to make games. If someone makes a great game that people enjoy and buy, and it puts food on their family's table, whether or not they explicitly typed some variables isn't going to matter to anyone except some pretentious code snobs on an internet forum. To paraphrase Jonathan Blow on developing independent games, "Get S*** done and make S*** work."
     
  21. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    And to paraphrase taumel: "Making Ruby S*** is more enjoyful than making Unityscript S***."
     
  22. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    In theory you can do the replace on the SQL server only to threads that do not contain the "UnityScript" wording in them.
     
  23. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Javityscript ?
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Problem solved. Once again the pioneering and collaborative environment of the Unity Forums has borne fruit. Fruit that is ripe for the noble prize.
     
  25. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    This.

    No one cares what language your game is written in once it's compiled.

    And I really don't understand why some people think Unity should offer LESS choice in language... frankly it's one of their biggest selling points. I think they should add support for a few more (IronPython and IronRuby being my first choices).
     
  26. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    It's already annoying to mix together C# and UnityScript in a single project, and it would be much worse if there were even more languages.
     
  27. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    No one is forcing you to use multiple languages.
     
  28. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Some of Unity's standard scripts are written in UnityScript, some in C#. Some third-party scripts are in US, some in C#. The best solution I know is to rewrite all US stuff I want to work with into C# and forget about US.
     
  29. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Another solution would be to write your own code rather than rely on third party scripts.

    Then again, if you understand script compilation order, C#, UnityScript, and even Boo all play nicely together.
     
  30. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286


    Exactly.
     
  31. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    This is the exact reason I do write all the code on my own, because otherwise, I had to rely on script compilation chaos, or to use barbarous SendMessage calls to communicate between different scripts and loose the guarantee to be able to refactor the code safely.

    What you are saying is "the more different languages the better, but don't use different languages, otherwise you are in trouble."
     
  32. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Not what I'm saying at all. I've used UnityScript plus C# and Boo plus UnityScript without issue.

    And the benefit of Unity supporting multiple languages is not that you can use every one of them in a single project.

    Main benefits to me:

    1. Easier to port preexisting code into Unity.

    Flash or GameMaker ==> UnityScript
    XNA ==> C#
    Python ==> Boo

    2. Similarly, we have more choices when hiring programmers.

    3. We can use a language with the feature set we need (Although the UnityEngine and MONO stuff is mostly identical in all 3 languages, the syntax isn't, and each has it's own advantages/disadvantages).

    4. We can use a language we actually enjoy using (I know this is hard for some C# coders to believe, but not everyone loves C#)
     
  33. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    Up to this day I have had no issue referencing C# code classes from within JavityScript.

    I have, though, had issues referencing JavityScript classes from C#. Didn’t put much time into it but after a while struggling I decided to trash old classes I was planning to reuse and just go pure C#

    I sort of agree: keep as many languages as possible, as they help many different teams do quicker transitions from different environments, but it's a good idea to stick to a single language once the project is started, and minimize third party code usage as much as possible (although it seems most sold third party plugin code is C# and again, had no issue calling it into a project’s JavaScript)

    Many programmers tend to be rather stubborn and arrogant about their code preferences. It's not rare to hear a programmer insult and bash anyone in any field using a language other than the one they specialize with.
     
  34. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    I think quite some people could benefit from using Boo - but Ruby would be greater (btw. sometimes a wish comes more from experience than from stolidness) - but they'll never use it because from one side they hear that C# ist so pro and anything else is just a joke. Then there are those saying nah use da ?-Script language, it's quite easy, better integrated and maybe you can code in Flash, HTML-5 or on RTOS for nuclear power plants as well, you know just the crazy way humans tend to be.
     
  35. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I wonder why we dont have actionscript as for flash builds it converts it to it so why cant ot work the other way? i wouldent use it and never had but i.bet theres loads of people from flash here.
     
  36. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    Would not be shocked if support was added once they iron out Flash Export.
     
  37. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Been a while since I used Action Script, but I seem to recall the syntax being almost identical to UnityScript.
     
  38. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Interestingly, there are people who assume that their "coding abilities" gives them the "right" to be arrogant. In fact, this behavior characterizes them as bad professionals. I believe that the attitude is an important factor that affects the jobs possibilities.
    I found a nice read about getting a job as a programmer. After reading it someone could picture how much work can be expected on different fields. It is not surprising that one of those fields is the attitude. Anyone who had a job realizes that insulting and bashing is bad for business. This could explain why most senior programmers tend to be more bland.
     
  39. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    I rofl'd. Now the next step would be to all insert Javityscript in our Curriculum Vitae "languages" line.
    (and send it to EA)
     
  40. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    haha , +JavityScript.

    wonder how long until someone creates the *poll*


    edited :
    hahaha just seen that.
     
  41. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,815
    LOL that's an awesome name :D
     
  42. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    I actually like it. JavityScript is not only close enough to JavaScript for anyone to actually realize what you are talking about, but also avoids being branded as the one official Unity scripting language. One big reason I dislike the UnityScript name is that many starters or clueless managers may think you HAVE to go UnityScript if you want official support.
     
  43. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128
    The #1 reason I like JavityScript:

    In C#
    Code (csharp):
    1.  
    2. delegate int AnonFunIntInt(int i);
    3. delegate string AnonFunStrStr(string s);
    4.  
    5. void test()
    6. {
    7.   AnonFunIntInt mult = (x) => (x * x);
    8.   AnonFunStrStr addStr = (y) => (y + y);
    9. }
    10.  
    In JavityScript
    Code (csharp):
    1.  
    2. function test()
    3. {
    4.   var mult = function(x : int) {return x * x;};
    5.   var addStr = function(s : String) {return s + s;};
    6. }
    7.  
    Multiply by however many different callback types you have.
     
  44. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    I agree:

    Code (csharp):
    1.  
    2. var mult = function(x : int) {return x * x;};
    3. var addStr = function(s : String) {return s + s;};
    4.  
    Is so much vastly simpler than:

    Code (csharp):
    1.  
    2. Func<int,int> mult = (x) => (x * x);
    3. Func<string, string> addStr = (y) => (y + y);
    I mean, look how many characters it saves!

    -----

    How about we get fancy?

    Code (csharp):
    1.  
    2. delegate T myF<T>(T i);  //Put this in a separate file so you can use it system wide.
    3. ....
    4. myF<int> mult = (x) => (x * x);
    5. myF<string> addStr = (y) => (y + y);
    6.  
    Multiply by however many different callback types you have.
     
    Last edited: Feb 8, 2012
  45. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128

    OK, do it with this function:

    private function P2PClientHelper(facilitatorIP : String
    , facilitatorPort : int
    , proxyIP : String
    , proxyPort : int
    , proxyPassword : String
    , connTesterIP : String
    , connTesterPort : int
    , hostUseNAT : boolean
    , hostIP : String
    , hostPort : int
    , externalIP : String
    , externalPort : int
    , hostGUID : String
    , hostPassword : String
    , useProxy : int
    , joinerExternalIP : String)

    Crazed template expansion is not a great solution, I prefer my lambda functions to be supported by the language without having to prototype them.

    Also, the inconsistency of how a lambda expression is formed is annoying. This is more nitpicky though.

    Edit: I have to admit, I didn't realize the template expanders were implemented in this version of Unity, I was under the impression those were added in 4, and Unity's Mono was at 3.5. If implicit typing for lambda expressions was added to C# I'd have less beef.
     
    Last edited: Feb 8, 2012
  46. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Example use case?

    Maybe you should wait and see how it works? You've already demonstrated how US is more verbose [yet no more informative] to do the exact same thing. We haven't even touched on simple things like:

    Code (csharp):
    1. var test = new List<string>{"hello", "cheese", "I love america"};
    2. test.ForEach ( x=>print(x));
    3.  
    Which, correct me if I'm wrong, requires significantly more fluff in US.

    What inconsistency?
     
    Last edited: Feb 8, 2012
  47. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128
    That was a snippet from callback code I have to deal with a peer to peer service. The vast majority of the calls have more than 8 parameters.

    I don't understand what you mean here. Wait and see how what works? I think your second snippet showed how C# is more verbose with the templated delegate declaration.

    Code (csharp):
    1.  
    2. var test = ["hello", "cheese", "I love America"];
    3. print(String.Join(", ", [s for (s in test)]));
    4.  
    Can't really comment on the fluff level, array comprehensions are more familiar to me as a language feature than relying on API calls.

    Lambda expression use a different format than standard function declarations.
     
  48. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Show me how you use it with unityscript - because I'm not quite sure what it's doing in a C# context.

    C# delegates/lambda's etc - you have made claims based on a poor understanding of how C# handles it.

    Pleeeeeaaaaaase! You make a claim that US is more compact - especially when you create lots of similar delegates - I completely and utterly refute that, and you make up this nonsense?

    That's like saying C# is more verbose cause you could code your functions in brainfuck! You use your judgement and pick the best solution for each case.

    Not a list [can't dynamically add elements].
    Does not call print repeatedly.
    Concatenates separate arguments.
    Adds superfluous data.

    You've not only failed to reproduce the functionality, you've confused the message. This is not about the sample data, but the functionality the language brings. The strings could have been enums and the print function could have been a brainfuck interpreter.

    And? [BTW, that might have something to do with lambda's being different - there's all sorts of interesting goodies they allow].

    edit: I do agree with you, I regularly have this discussion with myself:

    Code (csharp):
    1.  
    2. //This is such a hassle
    3. Action<string> compact = x => Console.WriteLine(x);
    4. //I just love the verbose version
    5. Action<string> verbose = delegate(string x) { Console.WriteLine(x); };
    6. //And wish it could look like this
    7. Action<string> fictional = void (string x) { Console.WriteLine(x); };
    8.  
     
    Last edited: Feb 8, 2012
  49. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
  50. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    hahahah , thats great