Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

C# version 8!!!!!!!! Woohoo!!! Thank you NT8! :)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    C# version 8!!!!!!!! Woohoo!!! Thank you NT8! :)

    Just noticed in the release notes for 8.1.2.0:


    "Updated compiler to use Roslyn

    Feature Minimizing & Restoring charts

    This enhancement now grants you the flexibility to leverage C# features up to version 8, providing even more versatility in your scripting endeavors."


    I haven't tried it yet, but this is GREAT news!!

    #2
    Yes, there are some various things that previously we had to avoid doing in NT scripts but now we can. One such example that used to cause me to periodically go back and have to fix things if they had to compile in script editor was inline declaration of out variables.

    For instance:

    if (!int.TryParse(someString, out int someInteger)) someInteger = 0;

    That used to fail to compile on the "out int" part because C# before v7 wanted the int someInteger; to be prior to the TryParse not inline with it.

    There are others, but that one in particular seemed to come up all the time.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Too bad they abandoned NT8.0. New C# version is big improvement but using NT8.1.X and have to deal with login wall and connection issues like yesterday.. Well, it's not worth it.

      Comment


        #4
        C# 8 is absolutely huge for me, I'll take the hit on the login dialogs. So many ways it makes coding easier and better. Ridiculous as it may sound, I honestly think that "expression-bodied members" is one of the best language features ever devised, in terms of how much code it saves; it makes it easy to turn a surprising percentage of functions into one-liners.

        I have found that when language features make it easier to do a thing that also improves your code, you end up doing the thing, and you get better code as a result of it, almost as if by gravitational pull. I.e. as a language designer, the easier you make it for people to do the "right" thing, the more they do it, the better client code ambiently becomes. So with each new version of C# people's code just gets better and better.

        Other super useful features:

        1. Interpolated strings. <-- I use this ALL the time.
        2. Tuples
        3. Null propagator
        4. Local functions
        5. Pattern matching

        See here for all the awesome functionality we just got:

        https://learn.microsoft.com/en-us/do...ersion-history

        In C# 8.0 (I'm on 7.3), I'm looking most forward to:

        1. Readonly members (I heavily used const members back in my C++ days).
        2. Default interface methods.
        3. All the expanded patter matching enhancements, particularly switch expressions.
        4. Nullable reference types! Finally, a real fix for the "billion dollar mistake", hah. (Super curious to see how much of a PITA this is and how impactful it is overall towards code quality.)
        Last edited by carnitron; 10-27-2023, 04:30 PM.

        Comment


          #5
          Yes, labeling various things const or not in C++ is a sort of code hygiene - I am surprised so few people do it.
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            It can be pretty hard to add to a large project that did not start out using const. Which is a shame b/c it does a great job of ambiently and clearly communicating intent.

            Comment


              #7
              I read previously that Ninjatrader was in .NET 4.8 when it was C# 5.0,
              is it still .NET 4.8 now that it is C# 8?

              Comment


                #8
                Yes. 4.8 is the latest .NET Framework.
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Karado58, 11-26-2012, 02:57 PM
                8 responses
                14,825 views
                0 likes
                Last Post Option Whisperer  
                Started by Option Whisperer, Today, 09:05 AM
                0 responses
                1 view
                0 likes
                Last Post Option Whisperer  
                Started by cre8able, Yesterday, 01:16 PM
                3 responses
                11 views
                0 likes
                Last Post cre8able  
                Started by Harry, 05-02-2018, 01:54 PM
                10 responses
                3,203 views
                0 likes
                Last Post tharton3  
                Started by ChartTourist, Today, 08:22 AM
                0 responses
                6 views
                0 likes
                Last Post ChartTourist  
                Working...
                X