Objective-C is just, like, a leaky abstraction over C
Objective-C is described as a "leaky abstraction" over C, integrating modern programming features and enabling interoperability. Its design is effective, with Objective-S proposed as a streamlined variant.
Read original articleThe blog post discusses the nature of Objective-C as a programming language, describing it as a "leaky abstraction" over C. The author reflects on a decade-old perspective by Robert Atkins, comparing Objective-C to Jimi Hendrix in terms of its revolutionary features that are now commonplace. The post emphasizes that while Objective-C introduced modern programming concepts like dynamic messaging and runtime introspection, these were not entirely new, having been present in languages like LISP and Smalltalk. However, Objective-C distinguished itself by integrating these features with a minimal extension to C, making it more practical and efficient. The author argues that Objective-C serves as a glue layer for various programming languages, allowing for interoperability. Despite its ad-hoc nature, the author believes that Objective-C's design is effective, and its utility has led to its dominance in the Apple developer ecosystem. The post also touches on the potential of Objective-S, a variant that removes the C component, focusing on a streamlined approach to programming. Overall, the author appreciates Objective-C's historical significance and its ongoing relevance in modern programming.
- Objective-C is viewed as a "leaky abstraction" over C, integrating modern programming features.
- The language is compared to Jimi Hendrix for its revolutionary impact on programming concepts.
- Objective-C's design allows for interoperability with other languages, enhancing its utility.
- The author highlights the effectiveness of Objective-C despite its ad-hoc nature.
- Objective-S is introduced as a streamlined variant of Objective-C, focusing on efficiency.
Related
Weekend projects: getting silly with C
The C programming language's simplicity and expressiveness, despite quirks, influence other languages. Unconventional code structures showcase creativity and flexibility, promoting unique coding practices. Subscription for related content is encouraged.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
When Objects Are Not Enough
Tony Messias examines Object-Oriented Programming's foundations, emphasizing actions in Laravel, historical context from Smalltalk, and critiques modern interpretations, advocating for a deeper understanding of OOP principles and experimentation.
Objective-C is like Jimi Hendrix (2014)
The author compares Jimi Hendrix's influence on guitar music to Objective-C's impact on programming, noting how perceptions of its features have evolved as newer languages emerged, reflecting on programming history.
C Isn't a Programming Language Anymore (2022)
The article examines the shift in perception of C from a programming language to a protocol, highlighting challenges it poses for interoperability with modern languages like Rust and Swift.
Brad Cox's above book and Bertrand Meyer's Object-Oriented Software Construction (using the Eiffel language) were my guides to Object-Oriented Design/Programming and Software Engineering in general and i am eternally grateful to them.
C++? Not so much because, in essence, that is also a leaky abstraction where you have to care about even more issues. Static versus dynamic methods to give an example: code looks the same but works subtly very differently depending on whether the methods used are static or dynamic. So you cannot ignore how the mechanics of the language works underneath and there is a continuous high mental load.
IMO Objective C is simpler - the OO side of it is all dynamic. For performance optimisations you can drop to C and you can really know where you are and what to expect.
To be fair I haven't used Objective-C enough so perhaps there are things about it which would turn me off it in the end. I liked Go for example but the way modules work eventually wore me down.
That’s not really true of all Lisps! Common Lisp may be compiled straight down to assembly (that’s what SBCL does). It can call straight out to the host OS, just like a C program. Now, due to things like garbage collection you have to manage things a bit at the edges, but that’s no different from a language like Go, and I think that no-one would say that Go is its own machine.
It’s true of some Lisps, such as Emacs Lisp. Emacs is really a virtual Lisp machine with an editor as a shell.
I think that it’s also true of Smalltalk.
For example, we used template wrappers around NSArray for static type checking and "smart pointers" to avoid manual release/retain calls all over the place, which was glorious.
Also bonus points for mentioning the work of Piumarta, whose paper on extensible object models is my all-time favourite and has occupied my mind for years.
ChatGPT is giving me contrived examples or examples that could have been achieved with the knowledge of classes at compile time.
I don't remember what I did wrong but I somehow tripped over Objective-C's boolean which isn't a proper type but just a macro of an int value like it is now in C. I did probably something stupid like "if (b != TRUE) {}".
What made this so much more infuriating was that if I knew it was just a leaky abstraction over C I wouldn't have made that mistake. But I thought it was on the same level as languages from the Pascal family or Java or any other modern programming language.
Related
Weekend projects: getting silly with C
The C programming language's simplicity and expressiveness, despite quirks, influence other languages. Unconventional code structures showcase creativity and flexibility, promoting unique coding practices. Subscription for related content is encouraged.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
When Objects Are Not Enough
Tony Messias examines Object-Oriented Programming's foundations, emphasizing actions in Laravel, historical context from Smalltalk, and critiques modern interpretations, advocating for a deeper understanding of OOP principles and experimentation.
Objective-C is like Jimi Hendrix (2014)
The author compares Jimi Hendrix's influence on guitar music to Objective-C's impact on programming, noting how perceptions of its features have evolved as newer languages emerged, reflecting on programming history.
C Isn't a Programming Language Anymore (2022)
The article examines the shift in perception of C from a programming language to a protocol, highlighting challenges it poses for interoperability with modern languages like Rust and Swift.