From Frontend to Smart Contracts: My Journey and Why I'm Making the Switch

Are you a frontend developer curious about smart contract development? Or maybe you're just curious about the differences between the two? In this post, I'll share my journey of switching from frontend to smart contract development, and the reasons why I made the switch.

My Story

In June 2021, I started my journey into software development by signing up for CryptoZombies.io and purchasing a blockchain development course from Udemy.com. After completing the CryptoZombies course, I began the Udemy course, which included learning about Hardhat.

CryptoZombies.io is a great starting point to learn the Solidity syntax
CryptoZombies.io is a great starting point to learn the Solidity syntax

However, at that point, I felt lost, as JavaScript was confusing to me, and asynchronous functions made no sense. Without any mentors or people to guide me, I thought that knowing JavaScript was a pre-requisite to learning Solidity.

So I decided to focus on learning JavaScript for the next 22 months. Although learning frontend development was a fun journey, I never lost my interest in smart contract development.

So, I made the decision to pivot back to learning Solidity. In this blog post, I'll share the similarities and differences between frontend development and smart contract development, and why I think it's worth making the switch.

Differences between Blockchain and Frontend Development

Frontend development focuses on creating user interfaces and client-side logic, while Solidity development focuses on creating smart contracts for the blockchain.

frontend UI calls deposit function on the smart contract
frontend UI calls deposit function on the smart contract

The screenshot above is a frontend interface that uses Ethers.js to call the deposit function on the "WETH9" smart contract. Below is code from the actual smart contract:

function deposit() public payable {
        balanceOf[msg.sender] += msg.value;
        Deposit(msg.sender, msg.value);
    }

Frontend development is typically done in TypeScript and React, while Solidity development is done in Solidity (or other languages like Rust or Vyper).

Frontend development requires a focus on user experience and design, while Solidity development requires a focus on security and reliability.

Differences between Solidity and JavaScript

  • JavaScript supports dynamic typing, while Solidity has static typing.

  • The syntax of JavaScript is similar to C-like languages, while Solidity's syntax is inspired by JavaScript but includes additional features unique to smart contract development, such as gas consumption and function modifiers.

  • JavaScript is executed by web browsers or server-side engines like Node.js, while Solidity code is executed by the Ethereum Virtual Machine (EVM).

function add(a, b) {
  return a + b;
}

Above is a JavaScript function adding 2 numbers

function add(uint256 a, uint256 b) public pure returns (uint256) {
  return a + b;
}

Above is a Solidity function adding 2 numbers

Similarities between Solidity and JavaScript

  • Both languages use curly braces and semi-colons to start and end code blocks, respectively.

  • Functions are used to organize and structure code.

  • Both support the use of if/else statements and loops for control flow.

  • Comments can be used in both languages to document code.

Understanding JavaScript fundamentals can make learning Solidity easier, as all programming languages boil down to computer science fundamentals. Additionally, frameworks like Hardhat and libraries like Ethers.js use JavaScript, so understanding JavaScript can be beneficial.

Why I Decided to Pivot to Smart Contracts

While there will always be a need for frontend development, I believe that many frontend developers will become obsolete with the development of AI and no-code tools.

It's possible to create user interfaces without knowing how to code 🤯
It's possible to create user interfaces without knowing how to code 🤯

On the other hand, I think there's more room for bleeding-edge innovation on the protocol layer of smart contracts. By staying up to date with the latest tech, I believe that humans can continue to be valuable in this space.

Conclusion

In conclusion, switching from frontend to smart contract development has been an exciting journey for me. Although there are differences between the two, understanding the fundamentals of programming can make the transition smoother. And with the potential for innovation in the smart contract space, it's a field worth exploring.

Subscribe to starrdev
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
Author Address
0x004b2cD7B812659…47A963E9191Be30
Content Digest
N0uXcI2Zt1ivh9z…Rqw0gK9myFIPxXo
More from starrdev

Skeleton

Skeleton

Skeleton