Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of suggestions on notebook 1 #47

Open
hasack opened this issue Oct 7, 2020 · 1 comment
Open

Couple of suggestions on notebook 1 #47

hasack opened this issue Oct 7, 2020 · 1 comment

Comments

@hasack
Copy link

hasack commented Oct 7, 2020

Listened to the recording for notebook 1 and felt like there were a few jumps or assumptions that newbies like me might not immediately get so had some suggestions that might make the stepping stones closer together:

// Everything in C# is an object

Can there be a short definition of what it means to be 'an object'? Something like:

_"The idea that there's a series of out-of-the-box (or user designed) specifications / blueprints - known as TYPES. When something new is created to those specifications / blueprints, it's known as an OBJECT.

As a result of being built to those particular blueprints / specifications, the new object will have characteristics (known as properties), and things it can do (known as methods).

A real world example would be if I got a new vehicle (let's call it 'myVehicle') built to 'car' specifications. It has characteristics (properties) such as colour, make, model. It also has things it can do (methods) like go forward, reverse.

The example OBJECT myVehicle is said to be "of TYPE car".

Properties are usually retrieved by adding a .Something after the name of the object. For example car.colour might return 'blue'.

Methods are usually triggered with .Something(). For example car.Goforward()

The brackets allow for extra detail to be added to the instruction. For example, instructing the car to advance a distance of 3 might be car.Goforward(3)"_

// Maybe an introduction to Type Casting

_"Trying to squeeze something that is originally of one shape into another shape. For example squeezing an integer into a hole designed for a decimal. C# can figure that out (implicit conversion) on the basis it fits into the hole with space left over.

However, trying to do the other way round (decimal into something designed for an integer) does not want to go naturally, so needs to be forced (explicit conversion)."_

// Modify and assign at the same time

Worth putting the equivalent code after in a comment?

e.g. // apples = apples + 10;
e.g. // apples = apples - 10;

...

Just thoughts - happy to write up and send over PR if useful. If doesn't work / fit the flow, no worries.

@csharpfritz
Copy link
Owner

Sounds like a worthy update.. if you'd like to send over a PR that would be a great help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants