TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Objective-C Lessons from Go

29 pointsby mackrossalmost 12 years ago

2 comments

objclxtalmost 12 years ago
&gt; <i>So, the next time you’re about to make a subclass. Think hard and ask yourself — what would Go do.</i><p>I enjoy using both languages (Objective-C by day, Go by night), but I&#x27;m not sure this advice is necessarily something I would follow.<p>Because at the root of it all, Go is procedural and Objective-C is object-oriented. But the word &quot;procedural&quot; (or &quot;imperative&quot;) isn&#x27;t mentioned <i>once</i> in this blog post...it seems as if maybe the author missed something here? For example:<p>&gt;<i>In Go, composition of existing classes is trivial</i><p>...classes simply don&#x27;t exist in Go. Composition of <i>interfaces</i>, yes, not classes. And maybe that&#x27;s me being picky, but I think it&#x27;s a really important distinction. One of the reasons I think the author found taking this further &quot;incredibly difficult&quot; is that the two methodologies <i>are</i> very different and perhaps shouldn&#x27;t mix.<p>Maybe other people will have differing views, but I honestly don&#x27;t know whether it is <i>worth</i> trying to impose a procedural viewpoint onto a overtly object orientated language (or vice versa). So to throw this open: am I missing something here?
评论 #5969742 未加载
评论 #5969622 未加载
评论 #5969604 未加载
评论 #5969975 未加载
tomlualmost 12 years ago
All well and good, but keep in mind there&#x27;s a fair bit of boilerplate to this way of composing classes and you don&#x27;t get any type checking when you use dynamic forwarding.