GOTO - The Brightest Minds in Tech cover image

Zig Programming Language & Linters • Andrew Kelley & Jeroen Engels

GOTO - The Brightest Minds in Tech

00:00

The Importance of a Global Variable in Imperative Code

I think that the bulk of imperative code would have a not necessarily a global variable. All of these functions, you know, let's say the A, B, C, D, E, or whatever, they'd be methods. They would all take as the first parameter a mutable pointer to some shared state. This is called referential transparency. Okamel is a functional language, but it doesn't have purity. So for instance, whenever it tries to do list.map, it will always try to keep the order of the individual function calls the same. That's the essence of a pure functional language. Is allowed to rely on that property.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app