Developer Mindset - Reading Assignment

  1. Why does smart contract development require a different mindset than regular programming?
    The cost of failure is higher and changing/updating can be difficult and costly.

  2. Argue with your own words why clarity in your code is more important than performance.
    Clean and easy code is easier to read and troubleshoot in development. It is also less prone to bugs. Additional performance may be achieved with less tested code, however, there may be unknown issues that could arise later.

  3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
    someone may think the private functions keep your data private, which isn’t the case - all information is public. Also all the code is visible to everyone.

  4. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
    There is no perfect smart contract that can do everything without having different risks.

1 Like
  1. Why does smart contract development require a different mindset than regular programming?

The stakes are higher. Smart contract developers are handling programs which control money, and it is important to focus on security.

  1. Argue with your own words why clarity in your code is more important than performance.

There is less chance of errors in the code which can be exploited by attackers, if the code is simple and clear to read.

  1. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?

Private data in smart contracts is viewable by anyone. Thinking otherwise is dangerous.

  1. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?

You just have to be somewhere at the axis. If you want simple, easy to read code, you focus on clarity. If you want a dedicated well performing smart contract, you focus on performance and have to be extra careful with security.

1 Like

Why does smart contract development require a different mindset than regular programming?
Blockchain and ethereum programming is new, and there is constant change in the security landscape and in how best practices are implemented.

Argue with your own words why clarity in your code is more important than performance.
Simplicity and a modular approach can reduce errors and risk. Leonardo Di Vinci said, “Simplicity is the ultimate sophistication.” I think it’s hard to argue that programming money is not sophisticated, so it only makes sense to take a sophisticated, i.e., simple approach, when programming value.

As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
Assuming that something could be kept private might cause a developer to leave open a vulnerability, and since smart contracts program money, the risk of loss is high.

Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
We live in a world of tradeoffs, particularly as it relates to security. When working with high value projects, in smart contracts or otherwise, it’s better in my opinion to take a careful approach, limit risk, and build confidence with your application’s users.

1 Like
  1. The cost of failure can be high, and change can be difficult.
  2. Easy to understand and simple for other people to understand.
  3. For private data or function, is limited accessibility to developers to be safe from the malicious to platform or user.
  4. Tradeoffs of this situation are security and performance that every developer needs to think of in each case.
1 Like
  1. You have to prepare for the future of your contract, due to the blockchain being immutable. This means that you will have more risk from the start of development. You generally also always work with some type of token an in turn money. This means even more risk. So it is crucial to have a mindset that enables you to think about future bugs and problems that might occur and to set up redundant measures to ensure a secure future for your contract and user base.

  2. To minimise the risk of making an error without noticing it, due to the code being a mess.

  3. One might think that private data or functions cannot be seen by people viewing the contract or blockchain. Private data and functions on the blockchain can however still be seen by the public if viewed.

  4. Generally you cannot have all benefits in one contract. You might have to trade speed of execution for security or a mapping for an array.

1 Like

1). Why does smart contract development require a different mindset than regular programming?
Due to the nature of high risk and extreme difficulty in upgrading the smart contract. Risk comes from the fact that smart contracts are able to handle money.

2). Argue with your own words why clarity in your code is more important than performance.
Clarity in code is of extreme importance than performance because of the risk associated with smart contracts. Since they are able to handle money through smart contracts, clarity of code would supersede performance.

3). As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
Private data and private functions do not mean that they cannot be seem. The code is exposed for scrutiny even if functions and data are private.

4).Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?

Its a trade off between security, speed.

1 Like
  1. Because the cost of one failure can be high, and to fix one failure will be harder then regular programming
  2. You can find errors more quickly if your code is clear. Keep the lay-out clean so that everything is structured
  3. Someone might think they’re being rugged or scammed.
  4. It all depends on what you want your smart contract to do. You can’t keep everything simple if there are many complex functions. Same with upgradeable contracts. Upgradeable contracts add more complexity to your contract. Find the balance between simple and complex.
1 Like

Reading Assignment: Mindset

Question 1 - Why does smart contract development require a different mindset than regular programming?

Answer:

  • The cost of failure can be high.
  • Making changes can be difficult.
  • Not enough to defend against known vulnerabilities.

Question 2 - Argue with your own words why clarity in your code is more important than performance.

Answer:

Performance might make it harder to read a smart contract and therefore the probability to introduce errors might be higher than keeping the contract easy to read (Clarity).

Question 3 - As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?

Answer:

The private data in smart contracts is also viewable by anyone.

Question 4 - Why do you think all the fundamental principles mentioned in the article come down to tradeoffs?

Answer:

Each choice will have an expected output and might introduce an unwanted side effect.

For example, to make a smart contract easier to upgrade, modularity might be a good choice. But by using modularity, a smart contract might be more complex and harder to read. So in this case the tradeoff will be simplicity and that could introduce more errors.

1 Like

Why does smart contract development require a different mindset than regular programming?

  • New ecosystem = You have to stay up to date follow new bug, new method, new protocol on that platform.
    Upgrade to lasted version and adopt new security techniques that appear useful.
  • High cose of failure = You need to implement risk statregy into your code because smart contract handle money.
  • Difficult to update = You have to implement steps at first deploy and make new smart contract when change feature or found critical bugs (code is law).

Argue with your own words why clarity in your code is more important than performance.

  • Easy to find bug (less complexity on the code)
  • Easy to integrate with other smart contract as open-source for update any functions
  • Easy for testing

As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
As the article says, understand that your public functions are public, and may be called maliciously and in any order. The private data in smart contracts is also viewable by anyone.

Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
There are important exceptions where security and software engineering best practices may not be aligned. In each case, the proper balance is obtained by identifying the optimal mix of properties along contract system dimensions such as “Rigid versus Upgradeable”, “Monolithic versus Modular” and “Duplication versus Reuse”.

1 Like
  1. Because the cost of failure is high, as well as the difference within security threats to protect against (current and future), there are many updated/outdated releases of software to be reconfigured along with the state of mutability that the code has in order to improve upon tasks if required or desired.
  2. It makes it easier for collaborative corrective assembly to take place in restructuring or improving said code, and in the end it can be an amazing code that is put out but too complex to a point where updates or tuning the code and its results could damage or destroy your current activated protocol because the unclear code created misrepresented issues.
    3.That they can put whatever information within the smart contract to ease their minds and not forget it or think that the s.c has a firewall protecting the information within it.
  3. Because in order to gain something, more often than not there is a cost-benefit-analysis done pertaining to the specific situation in order to choose the more advantageous structure. For a selection of principles to ebb and flow with one another, they need to be able to work in unison and have other principles stemming from the same requirements in order to have non-conflicting mechanisms that work without issue.
1 Like

Because SC handles money, it’s difficult to upgrade and it’s public

More complexity means more possibility of failure. Having a clear and easy-understandable contract allow you and all the world to understand what it does, diminuish points of failure and allow to to undestand where there is the problem quickly

Of course yes, there could be the possibility to malicious entity to find a hole in the contract and catch private data

Smart contracts are a powerful instrument but they are fragile. We need to pay attention on how to handle them.

1 Like

The above given link is broken.

When you click on the link, just click “General Philosophy”.

1 Like
  1. Why does smart contract development require a different mindset than regular programming?
    The cost of failure can be high and changes to the contracts can be difficult.

  2. Argue with your own words why clarity in your code is more important than performance.
    It’s better to have a contract with simple logic than something more complex that does the same thing. This make sit easier for anyone, including yourself, when reading through the contract.

  3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
    Some might believe that private functions are 100% private and therefore not viewable in addition to calling. But that is not the case. The private functions are viewable to anyone.

  4. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
    We need to think through our smart contracts both as we write them and before deploying them to make sure it is a good solution. Easier said than done of course.

1 Like

Reading Assignment: Mindset

1. Why does smart contract development require a different mindset than regular programming?

Because a smart contract can't be changed once it has been launched on the mainnet. A bug in the smart contract loses users' funds and tarnishes the reputation of the dApp developers. Traditional app development, in contrast, tends to emphasize fast iteration cycles as best practice.

2. Argue with your own words why clarity in your code is more important than performance.

Clarity is more important so that the code can be bug-free, or to a major extent, easier to debug. As a smart contract developer, clean code is necessary to avoid potential pitfalls that could lose users' funds. Performance can then be built upon once clean code has been tested and verified.

3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?

They could believe that there's a lack of transparency to the code, and that because the code is "hidden", that some "illegal activities" could take place with the user's information or funds. This leads to a distrust of the smart contract and crypto as a whole.

4. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?

Because once the smart contracts are written and deployed, there is no way to change them. The developers need to be sure that all the code is, to the best of their ability, tested and working to the needs of the users and to the principals of why they created the smart contract in the first place. Unfortunately, it's always easier said then done.

1 Like
  1. Why does smart contract development require a different mindset than regular programming?

    • because smart contract use id deployed on public block-chain and all code is expose at people good and bad , and all possible errors be usable from all.
      in addition the contracts use users’s money that will would suffer of the possibles attacks.
      in the end, the contracts are immutable and therefore it was hard of upgraded and modifier.
  2. Argue with your own words why clarity in your code is more important than performance.

    • in the research of performance, we can use a more Complexity, that makes more difficult doing a efficent control on the variable, because we have plus variable in more case. in addition one clarity code is code is easier to maintain
  3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?

    • one can think that use “private” on variable on function, they are “private” but they are allocate in memory blockchain and if we take that specific portion of memory, we have call data from a “private” variable. on chain all information are public.

4 Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?

  • why like the system adapts to the function, the our code must adapts more possible at his purpose.
1 Like

1. Why does smart contract development require a different mindset than regular programming?
Samrt contracts are public and therefore also contain public information. Also you cannot unilateraly make changes after deployment as you need approvals by the other parties involved inn the project. As large sums of money also play a role errors will be expolited by individuals trying to steal tokens.

2. Argue with your own words why clarity in your code is more important than performance.
It is better to keep functions and contracts small to make upgrades, modularity and readability easier

3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
One might falsly believe, that private functions mean that their tarnsactions are kept private.

4. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
Because of the nature of smart contracts it is not possible to take them down after deployment. Maybe one single contract would be cheaper to deploy but this also brings the risk, that future upgradeablity becomes severly more difficult

2 Likes
  1. Why does smart contract development require a different mindset than regular programming?

Because there are additional considerations such it being a new ecosystem that’s constantly in development, the higher risk due to dealing with large amounts of money and being open source. In general, there’s more at stake and it’s higher risk.

  1. Argue with your own words why clarity in your code is more important than performance.

Clarity and simplicity in code makes the code easier to understand. When the code is easier to understand there’s a lower risk of it having bugs. Don’t be clever.

  1. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?

One might think that a function or variable declared as private isn’t accessible to the outside world. That’s not necessarily true. While it may not be intentionally accessible through the ABI, if it’s stored on chain then it’s publicly visible.

  1. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?

There’s no single best practice that applies nicely to all situations. Depending on the situation, the contract, the use, the risks, etc. You need to think about the various considerations and make the call that makes the most sense. Know what your code does and how it will be used and then where on the spectrum of various tradeoffs makes the most sense.

2 Likes
  1. Why does smart contract development require a different mindset than regular programming?
    Because it is a new language and is highly experimental.

  2. Argue with your own words why clarity in your code is more important than performance.
    Clarity in code will allow you to manage updates more effectively as upgrades and changes are made to the language. Plus, complexity increases the likelihood of errors.

  3. As the article says, all data and functions are public in a smart contract. What false beliefs might someone have around private data and private functions in a smart contract that could have dangerous consequences?
    Believing that their code is private may lead to malicious attacks / loss of funds.

  4. Why do you think all the fundamental principles mentioned in the article comes down to tradeoffs?
    Because with these contracts, we are managing the risk of attack and we always must use the knowledge we have about smart contract security to minimize the probability and impact of any kind of attack.

2 Likes

1:
Smart contracts require a different mindset than regular programming because they are harder to upgrade and the money is handled by the code.

2:
So that other programmers can read and understand my code

That their private data is not readable by the public when it is.

Different Smart Contracts require different functions and solutions so you have to make a tradeoff to which best suits the Smart Contract that you are building.

2 Likes