2

I learned a bit of python and started to enjoy programming. The syntax is short and beautiful but because I want to get into AR development I started C# now. The basics were ok but I am going fucking crazy looking at arrays. It's like the time I had to do stuff with Java again. I'd rather get tortured like Theon Greyjoy then writing this clunky garbage. But I really wanna get into AR 😖.
I'd appreciate if someone could give me reasons not to hate this syntax from the bottom of my 💓.
int[ ][ ] ohGodWhy = new int[ ] [ ]

Comments
  • 1
  • 2
    Because it tells you very clearly that it's a 2d array and makes it utterly obvious that you should index it twice to get a value.

    Btw, use the var keyword if you don't want to type the type twice
  • 0
    I am reaching the Hulk State-of-Mind. Just doing the SoloLearn course

    int[ ][ ] jaggedArr = new int[ ][ ]

    {

    new int[ ] {1,8,2,7,9},

    new int[ ] {2,4,6},

    new int[ ] {33,42}

    };

    I can't use a double array inside but still have to declare it an int array.

    @RememberMe @beegC0de thanks, this makes it bearable
  • 1
    How about simply writing this? 🤔

    (No screenshot, because I'm too lazy rn)
  • 1
    @Krokoklemme That's amazing O_O .Thanks! I am rushing through the tutorials so I get the basics down and skipping the fucking around part where I would learn this kind of beauty for prototyping.

    That's why I love devrant. Newbies and screen tanned pros get together.
Add Comment