Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Do I have to rember all the code from the a course because I forget some things and my main goal with c # is to build ap

I'm build app with xamarin

2 Answers

Ivan Penchev
Ivan Penchev
13,833 Points

A little secret: No one is able to remember their code! After some time in the software engineering business, I am lucky to remember what I wrote in detail before lunch if I neglect to follow the recommendations below.

That is why we have something called style and readability; it's not just for looks.

Did you ever wonder why you always see code nicely indented, demarked by different colors, set off by good variable names, comments, etc.? THAT IS NOT FOR THE MACHINE; it is for the progammer.

The machine could give a flying <bleep> whether we call a variable "doctor" (to store a doctors name). The machine would not blink an eye if we called the same variable "xx" or even "fckYou". The machine doesn't care. It doesn't care whether I indent, it doesn't care if I make comments.

All that stuff is for me, the flesh-and-blood programmer.

Luc de Brouwer
seal-mask
.a{fill-rule:evenodd;}techdegree
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 Points

Exactly what Ivan Penchev mentioned. This magic is called "Pseudo" code.

In every coding language you will see code that starts with // /* */ <!-- --> or even /// these are all different ways to tell the compiler to ignore this code as it is only readable to you, and for you as a programmer to help you with business logic or even to tell other developers what your code is doing.

Let's take an example. You are writing an app that requires doing some math and you know how to write your code and the application works but you didn't put any pseudo code in it. A year later, you come back to the same project and you have no clue what your code is doing. To prevent this a best practice is to always include some pseudo code with every method or function you are doing. Even if it includes basic examples of what your code is trying to do, little pseudocode is more helpful than no pseudocode.

// Variable declaration for Math method int a = 2; int b = 1;

// Do some Math int ans = a + b;