

Apple Could Power the Web - kcl
http://kevinlawler.com/objective-c

======
mooism2
[Reference counting] _No garbage collection. Objective-C could still do more
with respect to reference cycles, but that is primarily a non-issue, and
easily solved in future versions._

I think if you solve this, you've implemented GC.

Which is not to say that you might not want some hybrid, but ref counting has
its own downsides (caching, multi-threading) which the author does not
mention.

 _[I]n a comparison with any popular scripting language, Objective-C will win,
since while the scripting language may have superior syntax, it is also sure
to be incapable of accomplishing many things which are trivially accomplished
in Objective-C._

Such as?

The article is full of assertions which it doesn't attempt to justify, even
with a link.

~~~
mgile
Objective-C already has garbage collection in OS X, but it has been deprecated
as of v10.8 in favour of ARC.

<http://en.wikipedia.org/wiki/Objective-C#Garbage_collection>

~~~
kcl
A good point. Coming from the iOS side I missed this. I mentioned Xcode's
garbage collection in passing, but pointing out that garbage collection is
deprecated on OS X would've made a strong argument that ARC is the better way
to do things.

------
bitcartel
Doubt it.

Today, Apple can't even power themselves, iCloud runs on Amazon Cloud Services
and Windows Azure.

In terms of language, can't see Apple wanting to take on the additional
responsibility of supporting the Objective-C runtime and foundation frameworks
on Linux and Windows. They can't even keep up with RADAR bug reports from
existing developers.

~~~
kcl
Apple's track record on the web has been poor. Their websites are not first
class. So they could have to build expertise there. I think, for backend
services, networking expertise on the OS teams would go a long way.

In terms of staffing and responsibility, I don't see that as an issue, since
if this does make sense for Apple, Apple is large enough that handling the
workload wouldn't be a problem.

------
rabenfrass
This post has many generalizations and little technical content. The subject
is interesting (for ObjC programmers mostly), but arguments are shallow.

> _it was never an issue to port correct C/C++ code_

In C/C++ there is no such thing as a portable application only applications
that have been ported, even with standard compliant code. Try porting between
Linux/Solaris/Windows and see by yourself.

> (paraphrased) _Backend apps should be written in Objective-C instead Java,
> let's rewrite them!_

Before making such bold statements about rewriting applications, what can you
tell me (if anything) about the speed of a server JVM compared with
Objective-C? And this is really a broad question, since for starters,
languages don't scale, architectures do. Your outdated SO link doesn't begin
to answer. See this general benchmark
[http://shootout.alioth.debian.org/u32/which-programs-are-
fas...](http://shootout.alioth.debian.org/u32/which-programs-are-
fastest.php?calc=chart&gpp=on&ifc=on&gcc=on&java=on&ghc=on&csharp=on&sbcl=on&v8=on&hipe=on&vw=on&lua=on&jruby=on&php=on&yarv=on&python3=on&perl=on)
and add to that Objective-C message passing. And then think how it translates
to server code. Just food for thought.

> _Java API replicates the entirety of the UNIX system layer in Java-ese,
> obscuring any helpful C idioms or UNIX-system knowledge in the process_

Because you think that those idioms and platform specific code won't be an
issue when ported, or they will be plenty of devs familiar with that, which
isn't the case. Most programmers out there use Java because they couldn't code
their way out of a paper bag.

> _You cannot postpone garbage collection forever. This is a disaster for
> applications that need to scale._

Nope, GC happens incrementally, and it's not a disaster for scalable Java
applications that are deployed now in the real world.

> _Oracle now owns Java and is a hostile entity. Java is done. Its future as a
> product is finished. Whatever your relationship is with Java now, expect it
> to deteriorate._

Completely wrong. JDK 8 lambdas will be feature completed in January 2013, and
if you are an Objective-C programmer, you know how much of a change it brings
to the language. And we have Jigsaw, project coin, java.util.concurrent with
CAS, and countless JSR. Java has better health than ever, ask around.

> _Web shops won't go for Apple servers. All the development, all the
> monitoring, all the operational knowledge is based on a few varieties of
> Linux._

It's the cost, not the knowledge. Also if you are a linux admin you get the
same toys in Mac. An Apple desktop makes sense because it's less likely to
interrupt the work of someone with a salary, but a farm of web servers based
on Linux is cheap and easily replaceable. The best contribution of Google to
the "open" world was to show that you can scale on Linux.

And this makes me think, given that Apple makes money selling hardware, where
is the motivation to compete with Java/.Net promoting server frameworks? This
is all about us buying Apple hardware people, don't forget.

> _developers who worked at Etsy when I was there, 100% either used a Mac to
> develop or use a Mac to develop now. This preference is standard in the
> industry._

Most devs in the planet are behind a cheap HP/DELL PC. Otherwise we would know
based on StackOverflow logs and sites like that. You could say best devs use
laptops, because that's at least what we see in dev conferences.

> _PHP is (or was) the dominant web scripting language by a large margin. This
> happened because of performance and ease of use,_

Java couldn't compete because JVM required 128MB RAM, and one app on a shared
JVM instance could bring down the rest, so Java was dangerous and cost
prohibitive for small sites.

------
serge2k
I like how you say oracle is a hostile entity and then propose that Apple
should charge licensing fees for using objective-c.

You state a lot of opinions as facts and give zero justification.

------
alecperkins
> _If I had to run a monolingual web stack, I would choose Objective-C for the
> sole language._

This article is severely undermined by its conflating internet and web.
Objective-C doesn't have a significant presence in the browser, and is
consequently a useless language for achieving a monolingual _web_ stack. The
article demonstrates a complete lack of awareness of the frontend side of the
web and assumes that iOS apps are this frontend. There is not a single mention
of JavaScript, or even the word "browser".

It also seems to be overly focused on the idea of computational performance,
when in many cases applications are IO-bound. The descending cost of compute
power means this efficiency edge in computation is decreasing in importance.
Also, no mention of things like PyPy? Overall, the article has a very narrow-
minded and misguided view of the web.

------
sauravc
Some people have crazy ideas, and the world needs that. However, trading in
Ruby or Python or [insert favorite scripting language] for Objective-C to
write server code is a foolish idea that's divorced from reality (with some
exceptions).

The vast majority of server code that is written is bit plumbing. Moreover,
it's written by not-so-great devs who aren't gdb experts. The performance
benefits of C-like languages are completely useless for all but a handful of
companies like Google and Facebook. Unless you're doing heavy number crunching
server side (which most web apps don't), there's no discernable benefit to
using Objectiv-C or C/C++.

There are plenty of benefits to using Java or a scripting language though. The
reasons are obvious to anyone techie enough to get this far.

~~~
kcl
Any dev who can write Java can write Objective-C, and there would be real
benefit in switching.

> for all but a handful of companies like Google and Facebook

I think this is a mischaracterization. A lot of companies need something at
Java's strength or above on the backend. It is a common problem. And
organizations with those needs will account for the majority of web traffic.

> heavy number crunching

Also a mischaracterization. Even simple tasks become computationally
challenging when you're doing them for a large audience.

~~~
superuser2
> A lot of companies need something at Java's strength or above on the
> backend. It is a common problem.

A lot of companies _believe_ they need "enterprise-class" software systems,
but that doesn't mean they really do. 100 employees working with a database
full of text are probably not going to overwhelm Python or Ruby on decent
hardware. 100,000 might.

------
plg
Isn't golang the new backend hipster? Compiled, concurrent, and google is the
mommy. I would bet on golang not obj-C. As long as Apple forces people to buy
apple hardware in order to make use of obj c it will not catch on.

------
Executor
I'd love for a c/c++-based platform to overrule Java... but Objective-c isn't
the right language:

\- Apple is a company that likes to take control away from people, why give
them more monopolistic power? \- You require a sub-decent xcode editor that
only runs on mac computers. After spending around 2 years using xcode I can
testify that its a piece of shit! \- Objective-c is overly verbose, horrible
syntax (i.e. gluing the method name + first parameter).

------
abolibibelot
What could "Grand Central Dispatch is a better way to handle threading, queues
("threading for OO")" possibly mean?

A better way than what? Erlang/Akka Actors? Java concurrent libraries? Clojure
STM? Single-threaded async callback fest?

Threading for OO?

I'm not even sure what the author is comparing Obj-C for web developement to.

