SolidityIn

Solidity is Weird: 5 Quirks That Drive Traditional Programmers Crazy

November 10, 2026 · admin · Uncategorized


At first glance, Solidity looks deceptively familiar. It has curly braces, contract blocks that resemble classes, inheritance, and a syntax clearly inspired by C++, JavaScript, and Java. You might think, “I know TypeScript and C#; how hard could writing a smart contract be?”

Then you actually try to write something. Within hours, your instincts are betrayed, your architectural assumptions crumble, and you realize that the Ethereum Virtual Machine (EVM) is one of the most hostile, peculiar compute environments ever conceived.

Here are five quirks in Solidity that regularly make traditional software engineers question their sanity.


1. Decimals Don’t Exist (Welcome to 1e18 Math)

In virtually every mainstream programming language, if you want half of something, you write x = 5 / 2; and end up with 2.5. In Solidity, trying this yields an infuriating truth: there are no floating-point numbers.

// In Python or JS: 5 / 2 = 2.5
// In Solidity:
uint256 a = 5;
uint256 b = 2;
uint256 result = a / b; // result is 2. The 0.5 vanished into thin air.

Because floating-point arithmetic is inherently non-deterministic across different hardware architectures, deterministic consensus engines like the EVM completely forbid it.

Instead, smart contract developers simulate decimals using massive integer scaling. 1 Ether is not 1.0; it is 1,000,000,000,000,000,000 Wei (18 zeros). If you want to calculate percentages, say 2.5% of an asset, you don’t multiply by 0.025. You multiply by 250 and divide by 10,000 (basis points).

Get your order of operations wrong (e.g., dividing before multiplying), and integer truncation will silently zero-out user funds.

2. The Bizarre Nature of mapping: Infinite, Non-Iterable, and Blind

Every developer knows the Hash Table—Map in JavaScript, dict in Python, HashMap in Java. You insert keys, look up values, query .length, or iterate through keys.

Solidity has a mapping keyword. It does none of those things.

mapping(address => uint256) public balances;
function check() public view {
// You cannot do:
// balances.length; // ERROR: Doesn't exist
// balances.keys(); // ERROR: Doesn't exist
// for (k in balances) {} // ERROR: Impossible
}

In the EVM, every possible key conceptually already exists and points to bytes initialized to zero. A mapping does not store keys; it computes a keccak256 hash of the key and the storage slot to find where the value lives.

Because of this:

  • You cannot check if a key exists versus it merely holding a default value (0, false, or empty address).
  • You cannot iterate over a mapping.
  • You cannot clear a mapping without knowing every key that was ever touched.

Want to list all token holders? You’ll have to manually track them in a separate dynamic array, doubling your storage costs.

3. storage vs. memory vs. calldata: Explicit Memory Layout Purgatory

Traditional high-level languages abstract physical memory away. Even in C/C++, you mostly differentiate between stack and heap. Solidity, however, forces you to declare the exact storage subsystem of complex types (arrays, structs, strings) in function signatures:

function updateUser(
string calldata name, // Read-only, gas-efficient input directly from tx
uint256[] memory scores // Temporary heap allocation (erased after call)
) external {
User storage user = users[msg.sender]; // Reference pointing directly to disk (state)
user.name = name;
}

This isn’t just an optimization detail—it is fundamental to whether your code compiles or mutates state:

  • storage: Modifying a storage variable writes directly to the blockchain’s permanent state tree. It is slow and astronomically expensive.
  • memory: Temporary heap that lives only for the duration of the external call. Modifying a memory copy does not modify the state on disk.
  • calldata: An immutable, non-allocatable slice representing the original payload sent with the transaction.

Accidentally assigning a storage pointer to a memory struct creates an entirely disconnected duplicate. Beginners spend days chasing bugs caused by modifying a copied struct in memory, only to wonder why the contract’s state didn’t change on-chain.

4. Unbounded Loops Are a DoS Vulnerability

In web and backend development, looping through an array of a few thousand elements takes milliseconds and costs virtually nothing. In Solidity, an unbounded loop is a ticking time bomb.

// A catastrophic mistake in production:
address[] public subscribers;
function payDividends() public {
for (uint256 i = 0; i < subscribers.length; i++) {
payable(subscribers[i]).transfer(1 ether);
}
}

Every single opcode executed by the EVM consumes a unit called Gas. Ethereum transactions and blocks have a strict block gas limit.

If your array grows large enough that iterating through it requires more gas than the block limit permits, the transaction can never complete. It will fail with an Out of Gas error every single time. Because transactions are atomic, failing means everything rolls back.

Congratulations: your smart contract is permanently bricked, and all stored funds are locked forever. In Web3, you never push work to an unbounded array; you design “pull-over-push” architectures where users withdraw their own shares individually.

5. “Code is Law”: There is No git push --force to Production

The modern software world lives on continuous integration and continuous deployment (CI/CD). Did a race condition slip past QA? No problem: patch it, merge the pull request, and roll out a hotfix to Kubernetes in ten minutes.

In Solidity, once you deploy a contract to an address, that bytecode cannot be altered. Not by you, not by the node operators, and not by Vitalik Buterin.

If your contract has a vulnerability that allows an attacker to drain its liquidity pool, you cannot just redeploy and redirect traffic instantly. You have to watch the exploit happen in real-time on public block explorers.

While patterns like the Transparent Proxy or UUPS (Universal Upgradeable Proxy Standard) allow state separation using delegate calls (DELEGATECALL), they are complex beasts filled with slot collision risks, initialization traps, and administrative governance baggage. You aren’t really updating code; you are tricking the EVM into executing logic located at another address while preserving original storage.


Embracing the Madness

Solidity feels weird not because it was poorly designed, but because its design constraints are radical:

You are running untrusted code on a globally distributed, decentralized, adversarial virtual machine where every step costs actual money, every user is a potential attacker, and mistakes cannot be undone.

Once you stop viewing Solidity as “bad JavaScript” and start viewing it as a state-machine execution engine for high-stakes cryptographic consensus, its weird quirks start to make a strange, beautiful kind of sense.

Tags: , , ,