Writing C# code has been going well, but there's a long way to go. Time for research as usual. I read this helpful article and learned a few interesting things. One of these was that you can actually put comments (using a //) on the end of lines, after the semicolon of course. You can check if two objects are equal without knowing if they're null by using an Object.Equals method. This is much shorter than some other ways of writing it. In a similar vein, Extension methods allow you to add new methods to existing types without having to modify or recompile. I'm still learning how to use methods, so I don't quite understand this yet, but I predict that I will soon. I also read this article. One very useful thing I learned is that you can use tuples to return multiple values from a method. Since I'm working with tutorials I probably won't be doing this yet, but it's good to know for later. I also learned that you can flag enums to access the enum values. Another thing I learned is that data types can be changed using a Convert class. Most of these tips seem to have a couple of things in common. They're about keeping things organized and avoiding the creation of long and unwieldy code. Efficiency is key. So, to summarize:
0 Comments
Leave a Reply. |
AuthorI'm moving on to my 4th (and final) year as a Game Art & Design student at Durham School of the Arts. I'd like to call myself an artist, but I'm a programmer at heart. Archives
February 2020
Categories
All
|