简体   繁体   中英

Stuck with learning C# - What is best way to start your first app with OOB and TDD? [on hold]

I am jutst starting my jurney with programming and I need little bit of help / advice. After several days spend learning C# I have learned basic syntax of variables, collections, if statements and loops. I have looked around classes for OOP. I have a basic knowledge of programming and I know key is practice. I have decided I will build something. After opening my IDE I got stuck. I have tons of ideas for an app however I don't know where to start write it. I got frustrated and all I know is getting wipped out my head. Any advice what should I do or where to go from here? Thank You in advance. Have a great day.

Start small, think of some thing your app is supposed to do, break it down into very simple steps and start programming these steps. Put them in a function, do the next steps, put it in a function and so on, until you have a collection of functions that you can call in sequence to do a thing. Repeat until you have a lot of things that do what your application is supposed to do. Then put it all together and boom, you got yourself your first application.

Classical example: I want to create a Discord bot that can play hangman with a user. Personally I would begin to write code that selects a random word from a String[] of words, put it in a function. Then I would write code that reads a new-line seperated list of words from a file into a String[], put it in a function. Next, write code that would check if a letter is part of a word. Then maybe something to keep track of whether a letter has been already checked. And so on. Eventually you can combine all these functions to a functional basic game (eg. read file, select random word, read input from console, test if letter already checked, check if letter part of the word, and so on). And finally you put it in a class and then you put that class in some Discord.Net bot library thing and write some code that handles interaction from users to your class (starting new games, keeping track of score, taking in guesses, etc).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM