views:

268

answers:

4

Apple is the backing force of ObjectiveC.

However WebKit is written in C++.

Apart from portability (not all systems have ObjectiveC compilers/runtimes) is there any other valid reason for this? Performance, features?

Lately Apple does not seem to care of other languages than ObjectiveC.

+18  A: 

Aside from portability, the use of C++ is an historical artefact. WebKit wasn't started by Apple; it was a fork of KHTML, which was developed as part of the KDE project. The decision to use C++ was made by the KHTML team, likely because KDE itself is written in C++ using the Qt framework.

Jeremy W. Sherman
"the use of C++ is an historical artefact" <-- lies and misspellings
JimDaniel
Don't you think "lies" is a word both too strong and inadequate on SO?
Joseph Tura
"Artefact" is a common spelling, with about [320k hits](http://scholar.google.com/scholar?q=artefact) in the literature indexed by Google Scholar. As for "lies," please be so kind as to provide some sort of citation. "Lies" is inaccurate, as I am not stating something I know to be factually incorrect - in fact, I believe it to be factually correct, as KDE is a itself [written in C++ using Qt](http://www.kde.org/community/getinvolved/development/).
Jeremy W. Sherman
@JimDaniel: "Artefact" is no more incorrect than "colour" or "theatre." British English ≠ illiteracy
Chuck
I think JimDaniel may be using the misspelling tag to refer to the use of the indefinite article 'an' as opposed to 'a' before 'historical'. Just to clarify, this is correct.
El Ronnoco
"artefact" is actually preferred in British English. See: http://www.worldwidewords.org/qa/qa-art1.htm
Joseph Tura
Merriam-Webster's Dictionary of English Usage allows "both a and an are used in writing a historic an historic. See: http://en.wikipedia.org/wiki/English_articles and http://www.merriam-webster.com/dictionary/a[2]
Joseph Tura
@Chuck, @Joseph: Well played.
Stephen Canon
This discussion of British spellings is quite tyre-ing. *ducks*
mootinator
Okay okay, jeez. :) People still use C++ for new development, though.
JimDaniel
The original post resides in Atlanta. Isn't it common practice in programming to conform to the local style, even if you really don't like to add braces for single-statement `if` blocks? :)
Merlyn Morgan-Graham
I don't even think Jeremy was trying to say that the use of C++ is generally to be considered a thing of the past. Only that maybe, had Apple been the ones who started WebKit, they wouldn't have done it in C++.
Joseph Tura
@Joseph: Bingo. That WebKit uses C++ is a product of WebKit's history as a fork of KHTML, which was begun by KDE developers accustomed to using C++.
Jeremy W. Sherman
I quite liked this completely useless discussion. But that's just me :D
Joseph Tura
@Jim: he didn't say C++ is never used for new development. Just that its use in WebKit is for historical reasons.
jalf
Well, I'm going to hide under a rock.
JimDaniel
+1  A: 

WebKit is a fork of KHTML which was written in C++...

You will ask me... Why KHTML was written in C++ ? I do not know.

Xavier V.
KHTML was part of KDE, a (german based) project to port the mhh... let's say "Windows Desktop Experience" to Linux. The KDE project is C++ based.
ZJR
Ok, thanks ZJR. I like your "Windows Desktop Experience" quotes.
Xavier V.
I won't ask... Although KDE's C++ was weird (MOC)at least for KDE 1,2
Daniel Voina
+3  A: 

WebKit was originally forked from KHTML, which is written in C++. This, and the fact that it is "more" portable (not really, but it's hard to find ObjC developers for other platforms) probably contributed to Apple not rewriting it in ObjC. This has proven to be a good decision lately, after Google picked it up for their own browser, Chrome, which has resulted in several major contributions and thus a very up-to-date/on-the-edge renderer.

You
+1  A: 

Check the WebKit homepage. It is a branch of the KHTML library used in Konqueror, so Apple really had nothing to do with deciding what language it was written in.

mootinator
KHTML, not Konqueror. There's a difference between *browser* and *rendering engine*.
You
Edited before you pointed it out, but thanks. Having one of those days.
mootinator