+ 5
How can i improve this?
3 Antworten
+ 1
Also, indentation... See Microsoft C# syntax convention.
+ 3
1 - Try to avoid statics.
2 - Learn about Dictionary.TryGetValue and cache it instead of using lots of dictionary index access
3 - Why tolower and toupper? use only toupper
4 - Try to don't use pre-defined properties, use constructors.
Also, take a look at resharper, it's a tool who can help you to code better :)
+ 1
C# is an OOP language so it's a good starting point models some classes.
For example you can create a Shop class that contains a collection of Item (another class) and expose methods like GetItems, BuyItem, RestockItem and so on.
This items may have various properties like Name, Price, Stock.
Play with objects and as already Paulo told to you try to avoid statics.