John Siracusa

Siracusa Says

A fun collection of things John Siracusa has said on podcasts

Revenge Namespacing

If you're going to call your thing view, John is going to call his app. Deal with it.

Podcast: Accidental Tech Podcast
Episode: 510: It’s Occupied by Bears

One of the accidental booby-trap, bear trap, accidental pitfalls that lies lurking in the Perl programming language - yeah, I know everyone is saying “yeah, among the many” - if you’re writing like a little test thing where you’re like “I just want to try something out” and you just make up class names or whatever. If you call your classes foo and bar you’re fine, but if you have the misfortune to decide “I’m going to name a class A, B, C, and D”, you know what I mean? Uh, there already is a B class and it’s kind of important to the way Perl works.

”Why isn’t this working right, what is it doing?”, because of course Perl will let you do whatever you want to the B namespace but guess what, the B namespace is occupied and it’s occupied by bears. B does not stand for bear.

I don’t even know enough about how Swift namespacing works to know how they get away with it, I’m assuming like all the names are scoped to the module or something like that, but I just go with the Swift convention. If they’re going to call their things in SwiftUI “view” and stuff like that, well I’m calling my thing “app”. Deal with it.

Buy me a coffee