DEV Community

Discussion on: What language has the most beautiful syntax?

Collapse
 
envoy_ profile image
Vedant Chainani

I Guess Solidity as it is a mix of C++, Python and JavaScript It does not has that much use case as of C++ or JavaScript but it looks Beautiful. Here is an example

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

contract MyContract {
   uint8 j = 0;
   uint public num = 2;

   function whileLoop() public returns(uint) {
      while (j < 5) {
         j++;
         num *= 2;
      }
      return num;
   }
}
Enter fullscreen mode Exit fullscreen mode