Live data from Hacker News

WebAppKit - create web applications using Cocoa

webappkit.org

31–40 of 46 posts

Re: WebAppKit - create web applications using Cocoa

#32
post #3

Boy, I really don't know. I've actually enjoyed using Objective-C and Cocoa when used for Mac OS/iOS development (the dynamicity of Smalltalk data structures with the control flow of C), but I don't think I'd ever voluntarily choose it outside that context. Too verbose, too fragile.

What do you think is different about Mac OS/iOS context vs others that makes Cocoa's approach more or less appropriate?

I'm not convinced that Cocoa and Objective-C are the best approach for anything.

The only reason I use them is because they're what you have to use to make good apps on OSX/iOS.

There are debates on both sides when it comes to things like ruby-vs-python-vs-node or rails/django/aspmvc and reasonable people can take opposing views on those.

I don't see much of a case for Objective-C/Cocoa being a better language and platform than any of the others except for the fact that it's the only one we've got. (And yes, maybe I'm being unreasonable on this)

Re: WebAppKit - create web applications using Cocoa

#33

Earlier quoted context omitted.

Objective-C's incredibly verbose syntax for array and hash manipulation is my number one pain point with the language. A little syntactic sugar would go a long way here.

Try this set of macros that adds some syntactic sugar to obj c: https://github.com/petejkim/ConciseKit For example, this: [NSDictionary dictionaryWithObjectsAndKeys:v1, k1, v2, k2, nil] Turns into: $dict(v1, k1, v2, k2)

This looks promising, thanks for the tip.

I didn't know you could use $ in macros. Does the C preprocessor accept any other special characters?

Re: WebAppKit - create web applications using Cocoa

#34

Earlier quoted context omitted.

What do you think is different about Mac OS/iOS context vs others that makes Cocoa's approach more or less appropriate?

I'm not convinced that Cocoa and Objective-C are the best approach for anything. The only reason I use them is because they're what you have to use to make good apps on OSX/iOS. There are debates on both sides when it comes to things like ruby-vs-python-vs-node or rails/django/aspmvc and reasonable people can take opposing views on those. I don't see much of a case for Objective-C/Cocoa being a better language and pl…

Any chance of being able to distill concrete reasons why other environments are better?

Re: WebAppKit - create web applications using Cocoa

#35
post #23

Genuine question: what is the appeal here? I write iOS apps for a living, and appreciate what Objective-C and (especially) Cocoa have to offer, but why would anyone choose to use Objective-C when there are so many other great alternatives available? To consider just one example of the pain Objective-C developers like me have to deal with on a daily basis, why would I want to write: NSDictionary *d = [NSDictionary dic…

Relative runtime speed or compatibility with an existing Objective-C code base that you want to easily call from your web app are two possibilities that spring to mind. This isn't to say that conciseness of expression isn't a useful attribute, but I don't think it's so utterly critical to web development that the any tool suited for the job must provide such things as concise dictionary syntax. You use the best tool…

> I can at least conceive of situations in which I might care about the benefits that come with using Objective-C et al than I care about how verbose dictionary initialization is.

Fair enough. I'm interested to hear more about what these situations are.

For what it's worth, my point isn't limited to dictionary initialization. That example, though, does represent a lot of what makes Objective-C painful for me. That list also includes its extreme verbosity; the need to box and unbox native types when storing them in containers (or passing them to performSelector: and friends, and other uses); the necessity of separating header and implementation files; requiring forward declarations of methods to avoid compiler warnings; simply adding an ivar as a property requires touching code in a minimum of 3 different locations, and potentially across 2 files (@property statement, @synthesize statement, call to release in dealloc (until ARC), and, pre-iOS 4.0, actually declaring the ivar in the class definition); and, of course, manual memory management, which includes worrying about fairly esoteric edge cases like retain cycles.

None of these things are hard, including memory management. But it is code that has to be written, and more code means more bugs. In almost all other mainstream web languages, the computer takes care of these things for you, as it should.

Tack onto all of that the fact that if you're running Objective-C/Cocoa as a web app, you're probably on your own in terms of finding solutions to problems from the community online -- at least compared to mainstream languages -- and it feels to me like it's hard to justify the tradeoff unless you have a very specific need.

Re: WebAppKit - create web applications using Cocoa

#36
post #33

Earlier quoted context omitted.

Try this set of macros that adds some syntactic sugar to obj c: https://github.com/petejkim/ConciseKit For example, this: [NSDictionary dictionaryWithObjectsAndKeys:v1, k1, v2, k2, nil] Turns into: $dict(v1, k1, v2, k2)

This looks promising, thanks for the tip. I didn't know you could use $ in macros. Does the C preprocessor accept any other special characters?

It's actually a GNU C extension to the set of legal identifier characters.

Re: WebAppKit - create web applications using Cocoa

#37

Earlier quoted context omitted.

I'm not convinced that Cocoa and Objective-C are the best approach for anything. The only reason I use them is because they're what you have to use to make good apps on OSX/iOS. There are debates on both sides when it comes to things like ruby-vs-python-vs-node or rails/django/aspmvc and reasonable people can take opposing views on those. I don't see much of a case for Objective-C/Cocoa being a better language and pl…

Any chance of being able to distill concrete reasons why other environments are better?

The verbosity of the Objective-C language (and related Cocoa libraries) and manual memory management are the biggest reasons.

It's not a bad environment and has a certain weird elegance to it, but I would venture that very few people would use it if not for the fact that it's the defacto development environment for doing OSX/iOS development.

Re: WebAppKit - create web applications using Cocoa

#39
post #36
post #33

Earlier quoted context omitted.

This looks promising, thanks for the tip. I didn't know you could use $ in macros. Does the C preprocessor accept any other special characters?

It's actually a GNU C extension to the set of legal identifier characters.

Unfortunately XCode's definition of word characters doesn't include $, so cmd-double-click on an identifier like $dict doesn't work. Anyone know a fix?

Re: WebAppKit - create web applications using Cocoa

#40
post #19
post #16

Earlier quoted context omitted.

Yes, that's essentially what WebObjects was. However, WebObjects today is a mess, and it's written in Java. Also, we have a ton of conventions today, with regards to MVC development, REST APIs, etc. that we did not have in '95. Which means that therefore WebObjects is not suited to modern web development. The only company still using WebObjects in production today is Apple.

Your statement that Apple is the only company still using WO has no basis in fact. There is even an annual conference[1] for WO developers, in which Apple has zero involvement. [1] http://www.wocommunity.org/wowodc11/

You're right… let me rephrase. The only significant company.
Post reply on HN