
How to Learn Solidity: The Ultimate Ethereum Coding Guide - PetrolMan
https://blockgeeks.com/guides/how-to-learn-solidity/
======
kefka
And remember, that there's a special function called VIP() .

This is an implied function that wraps around your full code. This is
instantiated if/when core founders are losing money on a function that
possibly had a bug in it. This function returns the wrapped function, under
the guise of a new blockchain, with invalidations applied to all
'unintentional' side effects of bad or buggy code.

It happened with the DAO, because founders lost too much money. Just be aware,
that VIP() can happen to your code, regardless if your implementation is a bug
or intentional. Wrong people losing money means VIP() returns successful.

~~~
jameskegel
To me, this turns me off to the entire tech, no matter how stupid and kneejerk
that sounds. If the biggest draw to get me using your technology (immutable
contracts) is actually not true, then I'm less inclined to give it a shot
outside of novelty value.

~~~
zeven7
Unfortunately it's not an honest portrayal of events.

Disclaimer: I was a DAO investor. The DAO held 5% of my Ether at the time of
the attack.

Having said that, it's not as simple as saying: I support the DAO refund
because it was in my best interest. That doesn't necessarily follow, and it
didn't necessarily follow for most of the other DAO investors.

I still held 95% of my crypto $ in Ether. I would have been happy to eat the
5% loss if it would have been the right thing to do and instilled confidence
in Ethereum and its leadership. There were many debates at that time about
what the right course of action was, and it was a very hard decision. If
saving 5% of my investment meant I ended up with a worthless 100%, it would be
foolish to save that 5%. And everyone else knew this as well.

I think the decision the Ethereum team made was the best moral and legally
advisable choice. They had the opportunity to stop the theft of 14% of all
Ether, which would have gone to a criminal actor. It required a very risky
solution (a hard fork) which came with big consequences (an alternative chain
which remains to this day), so the solution wouldn't be feasible for smaller
attacks (as some people like the poster before you try to allege). But for an
attack which threatened 14% of the available supply, a hard fork to retrieve
the funds was a viable solution.

Most of the market agrees with this decision. In the time since the Ether
market cap has grown to the second largest of any cryptocurrency at 1/2 the
size of Bitcoin. The alternative chain that didn't fork is still alive but
only has less than 10% of the Ether market cap. The vast majority of dApps are
running on the Ether chain. And it's the chain that is being taken seriously
by enterprise (look up "Enterprise Ethereum Alliance"). Large businesses know
the founders can't simply hard fork whenever they want to better themselves.
The model works around consensus, consensus that is clearly shown by the
considerations listed above, and I am glad that the consensus model is strong
enough withstand an attack on 14% of its supply and respond with a difficult
solution to rescue the chain from a catastrophe. It makes me feel more
confidence in the technology, the community, and the protocol.

~~~
kej
Your whole argument is predicated on the idea that what happened with the DAO
was "theft".

All the publicity for the DAO explicitly said that the code was the full
specification of the contract even if it disagreed with any other statements,
and the code allowed someone to transfer the funds to their own child DAO.
What crime, exactly, are you accusing them of committing when everyone agreed
to a contract that allowed them to do what they did? How do I know using
another contract won't be labeled theft and rolled back?

> Most of the market agrees with this decision.

This is exactly the problem. Ethereum would have been interesting if it could
enforce unpopular decisions because they're specified in the code and them's
the rules. Instead it will enforce them as long as there's not too much public
outcry. No thanks.

~~~
kefka
> Your whole argument is predicated on the idea that what happened with the
> DAO was "theft".

So did the Ethereum Devs, who owned a bulk of coin from the initial auction.
And they just so happened to also control development of the protocol _AND_
the client programs. This was the message they "asked" users...
[https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Et...](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Ethereum-
Wallet_and_Mist_Beta_with_Hard_Fork_choice_0.8.1.png/1113px-Ethereum-
Wallet_and_Mist_Beta_with_Hard_Fork_choice_0.8.1.png)

"....IN WHICH FUNDS RELATED TO THE EXPLOIT ARE RESTORED...."

Consensus is nice, especially when you can manufacture it. Noam Chomsky talks
about this in great detail.
[https://www.youtube.com/watch?v=tTBWfkE7BXU](https://www.youtube.com/watch?v=tTBWfkE7BXU)

Chomsky: "The first place to look is, who's in a position to make the
decisions that determines the way a society functions."

------
otoburb
One of the main Ethereum co-founders is working on a new experimental contract
language targeting the Ethereum Virtual Machine called Viper which still seems
to be under relatively active development[1].

Why pick Solidity if Viper and other languages like Low-level Lisp-like
Language (LLL) by Consensys[2] are around the corner? Or is this just a matter
of language flavour similar to how anybody can pick from a plethora of
languages targeting the JVM (Clojure, Scala, Java, etc.)?

[1] [https://github.com/ethereum/viper](https://github.com/ethereum/viper)

[2] [https://media.consensys.net/an-introduction-to-lll-for-
ether...](https://media.consensys.net/an-introduction-to-lll-for-ethereum-
smart-contract-development-e26e38ea6c23)

~~~
PetrolMan
Viper is not completed, and it might never be completed.

Solidity is here now, and the demand for Solidity developers is growing by the
hour.

~~~
otoburb
_> >[...] it might never be completed._*

"Complete" is certainly in the eyes of the beholder, but Viper's author seems
to think the language is "complete enough" to have started writing Ethereum's
new Proof-of-Work/Proof-Of-Stake hybrid system (aka Casper contracts[1]) in
Viper[2][3].

[1] [https://www.ethnews.com/proof-of-stake-vitalik-buterin-
share...](https://www.ethnews.com/proof-of-stake-vitalik-buterin-shares-
casper-contract-code)

[2]
[https://ethereumclassic.github.io/blog/2017-03-13-viper/](https://ethereumclassic.github.io/blog/2017-03-13-viper/)

[3]
[https://github.com/ethereum/casper/blob/master/README.md](https://github.com/ethereum/casper/blob/master/README.md)

------
buttershakes
I've been using Solidity for a bit. I wouldn't say it is my favorite language,
it's a bit too javascripty for my personal preference, and its genuinely hard
not to introduce subtle security flaws into the code. As a smart contract
language it leaves a lot to be desired. That being said, it is really the only
game in town on Ethereum right now. The other language implementations on the
EVM are in various states of disuse. If you are interested in smart contracts
on Ethereum you have to learn Solidity unless you want to reinvent the wheel
with your own language implementation.

~~~
surak
well said, agree with you!

------
woodandsteel
Last year I was pretty excited about Ethereum for a few months. But then I got
to thinking about the social problems I care about, like how factory and
middle class jobs are being wiped out by robots and AI, and I couldn't think
of how DAPS could fix those sorts of problems on a large scale.

~~~
Jabanga
People are not meant to work in factories. They're meant to own parts of
factories and other productive enterprises. Ethereum reduces the barriers to
entry to becoming a stakeholder in value created by enterprises. The cost to
exchange a token is 1000X less than the cost to exchange a security. This is
an orders of magnitude reduction in barriers to entry and expansion of
liquidity. It means the economy can grow in all directions and become more
inclusive in its ownership structure.

We're still very early days, but this is what distributed smart contracts make
possible. The second and third order consequences of this will be enormous.

~~~
woodandsteel
Do you mean people won't work in factories but instead sit around and collect
profits, or do you mean people will work in factories but own them
cooperatively, or that people will work but not in factories but in some other
type of economic enterprises, or what?

And could you give me a link where this is described in more detail, including
addressing various possible objections?

~~~
Jabanga
I mean people will sit around and collect profits.

I don't have any links about this. This is my own view on an ideal future. I
haven't come across any objections to it.

~~~
woodandsteel
>I don't have any links about this. This is my own view on an ideal future. I
haven't come across any objections to it.

This is what I am talking about. Ethereum supporters think it is going to make
the economy into an anarchist-libertarian techno-paradise, but they don't
present specific ideas and write them up so they can be subjected to critical
scrutiny. You know, lots of ideas seem great until you try to work them out.

My own thought is that economics starts with basic needs and desires, like for
food, shelter, health care, internet access, and so on. Today these are
provided largely by small and medium enterprises, and people earn their money
working for them. I don't see how most of these things could be provided by
DAPS, and so I conclude Ethereum isn't going to make much difference to the
average person.

~~~
Jabanga
Here's a more detailed write-up on it:

[https://www.reddit.com/r/Futurology/comments/61lg8g/the_robo...](https://www.reddit.com/r/Futurology/comments/61lg8g/the_robot_invasion_is_coming_and_its_gunning_for/dfgdoka/)

You're right that there are no complete road maps written out. But proponents
of this vision can hardly be blamed for not being able to create a detailed
plan for things they believe will be invented. It will necessarily be
impossible to predict exactly what form the future will take. Yet we can make
reasonable extrapolations based on the nature of knowledge, and the role
knowledge plays in investment.

------
OrangeTux
FWIW: The current Humble Book Bundle does contains the book Introducing
Ethereum and Solidity[1].

[1]: [https://www.humblebundle.com/books/linux-book-
bundle](https://www.humblebundle.com/books/linux-book-bundle)

------
charlescearl
Are there any resources more informed readers might suggest for building a
"toy" EVM language? Say based on racket? Thought it might be a good way to
understand things deeply.

------
Principe
Now this truly is a job for the future..

------
rboyd
bullish. whenever the average HN comment is negative for new tech you know
it's going to be huge.

great guide here too.

