Solidity Basics

the return in the end does not really matter since the function is gonna return error if you type anything else than a number in it. I dont think its necessary, you can keep it or remove it, up to you.

2 Likes

Thank you! My code was running without it but it is better always to double check when you have not programmed before :smiley:

2 Likes

As a person who has never programmed before, is it normal that I have to program the basic stuff many times for them to stick into my head? In my first day of Solidity i went through the first chapter and the past 2 days I am repeating this chapter by programming what Philip does on my own and then check if my code is similar to his.

I am not per se frustrated, but sometimes it does feel like I am a bit stupid for not getting something the first time I program it or see Filip program it, and having to do it 2,3,4 times. For instance, Bitcoin 101 and Ethereum 101 were so easy as courses compared to programming.

Is it normal thus to struggle a bit with typing as a beginner? I understand immediately what every variable or function does when Filip explains but where I do get stuck is in composing the code and adding variables. I am in no way quitting as I love the space, the academy, the industry and I love that we are building something for the people of tomorrow when we will not even be here to enjoy it anymore, but could use some emotional support since as I said, I get frustrated having to repeat my code 2,3,4 times before it gets stuck into my head.

In terms of mappings, can we see a block explorer as a mapping or key value storage? I am asking this because in the block explorer, one adds a key (an address) and gets a value (how much eth or btc etc the address has). Would tha qualify as mapping?

It´s quite normal, even experienced coders have to look up solutions regularly for problems from Stack Overflow for example. Each programming language has a little different styling which must be learnt, and depending on previous experience it takes more or less time.

About the mapping, at an idea-level (when you program mappings) you could think it in that way. Etherscan indexes data read from public ledger of Ethereum´s blockchain, whether they use mappings to do this, I dont know, their code is private I think.

1 Like

Is the course still up to date? i noticed you were using version 0.7.5 in one of the course videos which is very outdated.

2 Likes

I could say YES, the changelog between the versions are minimal, the huge step was from 0.6 to 0.7. So we update our course by that time to stay up to date. Now the difference between 0.7 to 0.8 are not critical enough to update the course to that version (meaning the course content is still valid to learn the fundamentals of solidity).

You can read more about this changes here: https://docs.soliditylang.org/en/latest/080-breaking-changes.html

Carlos Z.

1 Like

it means the licence your using is incorrect. can u show screenshot

Does it matter which compiler I use? The video “contract structure” is using 0.7.5, but now I can see there’s 0.8.15. SHould I follow the video and use 0.7.5 or use the most recent one 0.8.15?

1 Like

I’m learning from the “contract structure” video. Flilip said I need to choose “hello world” under “Contract” before deploy the contract. But there’s nothing I can click under “contract”. What should I do?

1 Like

Yes, you should stick with the course version.

Carlos Z

2 Likes

You have to compile the contract first, you can do it through the compilation icon
image

Then go back to deploy menu (icon below compilation) and deploy the contract.

Carlos Z

2 Likes

Thanks for the reply!! May I know why it is giving me error as stated in the photo below please? It doesn’t like me having “_” before “number” and “index”.

1 Like

Your array is declared as number but you typed numbers on both functions.

Carlos Z

3 Likes

no usually it does not matter which compiler version you use. in fact for the scope of this course and beyound it does not mater at all. the only time you should be careful when choosing a compiler version is when your writing a contract that is inheriting the smart contracts of another protiocol (uniswap for example), in this case the creators contracts may be dependanct on older versions where certain code might be deprecated in newer versions. in this case to make your code compatibale with theres its important. but for here its not

1 Like

@thecil @mcgrane5 Thanks for the info!!

1 Like

no worries at all @cyl2chan

I noticed the Javascript VM environment option isn’t there anymore when deploying a contract, you can just use Remix VM

1 Like

remix has updated recently. for just use teh remix vm its the equivilent

Hi, I had a hard time finding what option/setting I can enable on Remix to get it to display variable values including “decoded output” in the console log. Example for this is in video “Constructors” at 03:35. If you are in the same boat, go to the “Home” file, click “More”, then activate your “Debugger” module. You may even need to reload the webpage for this to take full effect. Now when you run the program it will display a “Debug” button on the bottom-right which you can toggle/open and it will show what you’re looking for… Phew!

1 Like