How Am I Doing After Four Days of Learning C#?

0
0
Asked By MellowPine42 On

I've been learning C# for about four days and I'm trying to understand whether I'm approaching things correctly. Typing code on my phone is difficult, but I wrote a small method that changes a character's health. If the health reaches zero, it calls Banish(), which sets the health to zero.

I'm also wondering whether programming is mostly about being careful with details, such as punctuation, syntax, and getting every small part right. Am I making reasonable progress, and what are some good ways to learn faster?

3 Answers

Answered By BrightCactus7 On

For only four days, this is a reasonable start. Your method does update the health and handle the zero-or-less case. A few things could be cleaned up: `hp = hp;` has no effect and can be removed, and C# methods and variables are usually named consistently, such as `ChangeHealth` and `hp` or `health`. Also, C# is normally pronounced “C Sharp,” although people may casually describe `#` as a hash in other contexts. Most importantly, practice on a computer when possible, because typing and testing code on a phone will make learning much harder.

Answered By QuietMarble19 On

Programming does involve lots of attention to detail, but it isn’t only memorizing punctuation. Try writing small programs, running them, reading the error messages, and changing one thing at a time to see what happens. Learn the basics in order—variables, conditions, methods, loops, classes, and collections—rather than trying to rush through everything. Your `Banish()` method could simply set `hp` to zero, while the `else` block can be omitted because it doesn’t change anything.

MellowPine42 -

I understand that the `hp = hp` line is unnecessary now. I added it because I wasn’t sure whether the value needed to be assigned again.

Answered By SilverOtter58 On

A keyboard would make a big difference for learning programming, especially when code contains braces, parentheses, semicolons, and capitalization. If you don’t currently have access to one, focus on short exercises and use an online compiler or coding app where possible. Don’t worry about learning faster than everyone else; consistent practice and fixing your own mistakes will help more than rushing.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.