Solidity Basics

@filip

Hello Filip!

In the video

Ethereum Smart Contract Programming 101 / Categories / Solidity Basics / Types & Arrays

at the part from 0:36-0:46 you explain about “uint”:

And the most common one is the one, that is called “uint”, which is short for “unsigned integer”, which means that we can have both positive and negative numbers.

This is wrong, because an unsigned int can only be 0 or positive. Maybe you should correct this.

Best regards

Ouzo69

2 Likes

Hey @Ouzo69 thanks for letting us know. I must admit I didn’t even notice when watching the video :sweat_smile:

1 Like

Hello @Ouzo69
Thanks your notifying this little mistake, we have take note on this to fix it asap!

Carlos Z.

1 Like

Hi @Ouzo69,

You are right that this is incorrect, and it has been raised before. It’s been discussed and resolved here in this same discussion thread. I would always recommend doing a search in the corresponding forum discussion thread if you find an issue in a video, as you will probably find that it has already been commented on and the correction confirmed (before the video itself can be edited). You’ll often find additional information related to that particular question too :slight_smile:

We actually do it on purpose just to check you are listening attentively. Well done — you’ve passed the secret test (only joking :wink: )

@thecil @Alko89

3 Likes

eXCELLENT TOOL, WHEN YOU ARE LOOKING FOR DOGS, GOOD ANALOGY FILIP :clap:

So you call your dog and it comes back!
LOL
DOODESVILLE :slight_smile:

Yeah, I put a query next to that because it sounded a bit wierd.
DOODESVILLE :slight_smile: :upside_down_face:

@filip @jon_m

Hi jon_m,

thank you for your comment. I will keep this in mind before reporting an error next time.

But I should proof to you that I am really listening to the videos very attentively:

Ethereum Smart Contract Programming 101 / Categories / Solidity Basics / Types & Arrays
In the same video (from 3:41 to 3:47) Filip explains about arrays:

And arrays are variables where you can store multiple instances of a variable.

I have been thinking about this sentence a lot and the last word doesn’t make much sense too me, but I think I already figured out what Filip wanted to say. All elements of an array must be the same data type. So this sentence would make more sense to me if we change it to:

And arrays are variables where you can store multiple instances of a data type.

However this is just a very small inaccuracy and most people won’t even notice it at all.

Best regards

Ouzo69

1 Like

Hey everyone,
Back in the hamster wheel again.
I’m going over this with a fine toothcomb - this is the important bit, right, so getting very nit picky.
Couldn’t figure out what I was doing wrong so went to the code in the git - posted by Filip.
Very grateful for that Filip!
Now clear as mud!
Onwards and upwards.
DOODESVILLE :slight_smile:

1 Like

Hello Filip,
I am going over this section time and time again, and it’s making more sense every time.
I am telling myself if I can write a knitting pattern and sight read classical music sheets, then I can learn coding.
I reckon if I just keep following what you are doing then, eventually it will all fall into place and make sense.
Is that the general idea?
DOODESVILLE :slight_smile:

1 Like

Hello Alko89,
I am going over the first four videos in this section time and time again.
It’s getting easier to understand every time.
I used to write knitting patterns for original sweater designs with complicated patterns on them.
I reckon if I can do that, and sight read classical music sheets, then I can learn to code in solidity.
I am also just following what Filip says, and just doing it piecemeal, because I reckon that it will all eventually fall into place in my mind and I will then be able to code.
Is that the general idea?
DOODESVILLE :slight_smile:

1 Like

So i know it might be a bit too early for this, i just finished the lesson with the structs, and i couldnt help but wonder how to generate random numbers (to use for an id). In javascript we can use the math.random and generate random numbers, however i dont know if there is a similar thing in solidity. I would love to learn how to make a function that generates random numbers!

really liking this course!

1 Like

Hey @Ouzo69,

Apologies for taking so long to reply to this post of yours :pray:

Yes, this is great — the fact that you’re thinking deeply about the different concepts, and how to explain them in your own words so they are meaningful to you, is a sure way to progress quickly and effectively :muscle:

Often, different programming concepts can be explained using different words and terminology. The most important thing is that you understand what is really meant by the explanation, and express the concept in words that are meaningful to you (as long as it’s accurate, obviously).

I agree that the explanation:
“And arrays are variables where you can store multiple instances of a variable.” takes some thinking about, and maybe isn’t the clearest of definitions, but I think the term variable has been used because each element in the array has a value (which, as you say, must all be the same data type * ) assigned to an index (an array’s equivalent of a variable/property name).

Your definition works too, but if you are just referring to the values stored in each element, then I would use the term values instead of instances. To me, the term instance suggests not just the value, but a value assigned to a name (or identifier, or index).

But, if changing the words helps you to internalise better what is actually happening in practice, then that is the main thing :slightly_smiling_face:

Keep up the fantastic analytical thinking!

( * note that this is true in Solidity, but in JavaScript arrays can contain values of different data types, although it’s definitely more common for them all to be of the same data type).

1 Like

Hello @jon_m,

thank you so much for your reply, which helps me to get an even better understanding. And I can guess that it took you quite some time to write this reply. This shows me that you are really dedicated to help me understand things well!

So I can only give the praise back: Keep up the good work! I really appreciate it.

Best regards

Ouzo69

1 Like

Hi @doodesville,

It will fall into place as long as you also experiment with the code yourself, really think about what it’s doing, have a good read of some of the other posts in these forum discussions (for additional information, clarification, confirmation and inspiration), and then ask questions if anything is still unclear. It is true that not everything will be 100% clear at first, and so you shouldn’t let a few uncertainties prevent you from moving on (as long as they are just a few). Some programming concepts only click into place when they are revisited after you’ve made further progress. It’s important to revisit and rework certain aspects depending on your own particular experience, as it’s through that kind of selective repetition that you will find yourself making more effective progress.

I hope that goes some way to answering your question, and gives you some things to think about as you’re learning and studying. :slightly_smiling_face: :muscle:

1 Like

Thank you for your kind words @Ouzo69 :slightly_smiling_face: It’s a pleasure to spend time helping someone who is clearly investing the time to really think and analyse things :+1:

I’m no expert in the logic of knitting patterns, but I do have some experience with classical music. I do think that the logical patterns and rules to which all music owes much of its beauty, have lot in common with the concepts and discipline of programming. So I do think your classical music skills will help, yes :slight_smile:

1 Like

Hey @Leon_Targaryen,

Excellent question, but, yes, it is a bit early for this, as it’s certainly not straightforward and relies on you having a lot more advanced knowledge. But, hey, I certainly don’t want to dampen your enthusiasm so here’s a video for you to get an idea, and maybe come back to a little later down the line :muscle:

3 Likes

That was not too difficult and reasonably enjoyable.
Feeling more confident now.
:slight_smile:
DOODESVILLE

1 Like

Remix kind of sucks. why is there not a LOCAL IDE that we can down load. something more like atom, visual studio code etc. Remix works great but I can save my state locally I can load local files into the system with that tricky remixd but not easy to save changes back to the local file system.

Are there any alternatives?

1 Like