Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Objective-C

Name: Anonymous 2012-11-05 8:21

Can I get a tl;dr of what exactly is wrong with Obj-C (besides it being used by macfags)? I took a brief look and it seems to me it gets rid of a lot of chronic C++ headaches, though the syntax seems rather unintuitive. But I don't know if that's just me not being used to it.

Name: Anonymous 2012-11-05 8:41

Forget it, it's for macfags.

Name: Anonymous 2012-11-05 9:26

The only /prog/s that uses Objective-C are, arguably, developing for the Mac and/or iOS. They are using it because that's what Apple dictates. Objective-C Is used virtually nowhere else. There are obvious reasons why this is so, but the first thing that comes to my mind is: it's pretty fucking verbose, moreso than Java.

Name: Anonymous 2012-11-05 9:31

Read SICP.

Name: Anonymous 2012-11-05 9:52

You won't curtail my essential rights and my freedom of speech with anti-cryptography laws and proprietary binary blobs. Die in a fire freedom hating cretin.

Name: Anonymous 2012-11-05 10:16

>>5
STOP FUCKING COPYING ME YOU MOTHERFUCKING PIECE OF SHIT.

Name: Anonymous 2012-11-05 11:01

The safety of C with the blazing speed of Smalltalk!

Name: Anonymous 2012-11-05 14:07

Objective-C is gr8!

Name: Anonymous 2012-11-05 14:11

>>8
Maybe so, but is it Abelson gr8?

Name: Anonymous 2012-11-05 14:15

You will take my photolithography equipment over my dead body.

Name: Anonymous 2012-11-05 14:34

It seems like a pretty nice language.

Some people sperg out about the [ ] but I don't mind them that much.

My face when the default install of OpenBSD comes with an Objective-C compiler, but on Mac OS X you have to register for their ``developer program'' and download a gigabyte of IDE.

Name: UMH memesmith 2012-11-05 14:44

>>1
At first glance it seems >>7-san is joking, but he has actually formulated legitimate criticism of the language in the guise of a joke. (Mind you, Smalltalk is faster than its reputation suggests, so don't take the joke at face value.) Consider his post the "tl;dr" summary of mine.

All of Obj-C's extensions revolve around the dispatch system. Any moderately competent C++ programmer will tell you that compile-time polymorphism with templates yields better performance than runtime polymorphism with virtual methods. Any systems programmer familiar with Ruby or Javascript will also tell you that dynamic types and mutable classes greatly exacerbate the problem. At this point you're not just taking performance hits from a single pointer indirection like in C++'s vtables; you actually have to look up function names in a linked hash table on every invocation, because the dispatch tables are actually mutable at runtime and new classes can be introduced at any time in a running program.

This is, in a nutshell, what they don't tell you about Obj-C. As far as the runtime is concerned, it's a dynamically typed language with mutable dispatch tables. You can actually remove all the type information from your method implementations and (at least in the last version I used) it will still run. They're really only there for documentation and static analysis. The runtime still has to check the type of an object on every method invocation. If you think I'm bullshitting you, check out the MacRuby project (http://macruby.org/) which uses a Ruby interpreter instead of making literally everything a native extension method. The languages are so similar on a semantic level that they just ditched all the standard Ruby classes for Obj-C equivalents.

Now, this is all completely fine for GUI code, and really that's not a problem, because after all you'll never need it for anything else. If there's another language where it's easier to call into C libraries for heavy lifting, I've never heard of it. Hell, even if you're neck deep in Apple's proprietary Core Whatever libraries, it's very straightforward (little more than a search and replace macro + some manual memory management) to peel away the method invocation layer and just use the underlying C APIs. The result will be noisy, but hey, what C program isn't?

So as long as you know this shit, and you're a competent C programmer, you're all set. Obj-C will actually be pretty painless for you.

Here's the fun part though: They don't tell you this unless you ask! Apple just figures you should already be competent with C. An inexperienced programmer could dive right into learning Obj-C, and then go his entire career without figuring out why his object-oriented XML parser is SLOW AS BALLS. This is the single worst thing about the way Obj-C is documented. I can't say anything outright bad about the language itself (shit, man, programming is hard and everything has horrible warts) but the way this is handled by Apple is just really embarrassing and it makes me cringe to know that >90% of Obj-C code is written by people who fall into this trap.

Name: Anonymous 2012-11-05 14:50

http://en.wikipedia.org/wiki/Objective-C
Designed by Brad Cox
kike.

typical Cox:
http://en.wikipedia.org/wiki/Alfred_Koch
In 2008, he financed a scholarly point-by-point refutation of Holocaust denial materials. Denial of the Denial (Отрицание отрицания), with Pavel Polian, is the first book on the subject published in Russia.


there are also a few more Coxs ain Russia. And they all Jews.

Name: Anonymous 2012-11-05 16:34

>>12
This is, in a nutshell, what they don't tell you about Obj-C.

Huh? The fact that it's a dynamically typed language is widely advertised, as it's the very feature that allows the cool things you can't do with fixed pointer+offset languages like C++.

And yes, you're right in that Objective-C message dispatching is slower than C++ function calls, but look at what eg. Qt has to do to offer even part of what Objective-C has built in right from the start. Going back to anything C or C++-based toolkit after writing applications with Cocoa is a huge kick in the balls, even with Apple's idiosyncrasies. Looking at the shit-show that is the C++ standard, I'd also say having one entity in control of the language can be a pretty good thing.

Name: Anonymous 2012-11-05 16:41

All you ever need is C, LISP, and Bash. Everything else is just superfluous.

Name: Anonymous 2012-11-05 16:49

>>13
JEW COCKS

Name: Anonymous 2012-11-05 17:06

>>15

bash

Name: Anonymous 2012-11-05 17:31

>>15
s/Bash/ksh/

Name: Anonymous 2012-11-05 19:40

>>15

C

Name: Anonymous 2012-11-05 19:56

>>19
Well yeah, what else are you gonna program your toaster in?

Name: Anonymous 2012-11-05 20:48

Wait a minute, it's dynamically typed? Then why did I have to switch through C types after NSInteger only to find out I was supposed to use some nonsensical NSNumber to parse some damn integers? And you couldn't see that on documentation, I ran into some sample code somewhere with that by chance.

Coming from FIOC having to do an iPhone app, I vividly remember spending more than half my time by transforming some meaningless structure to another shitty intermediate struct. I'd rather program in Java.

Name: Anonymous 2012-11-05 21:03

s/.+sh/sh/

Name: Anonymous 2012-11-05 21:15

>>21
The object system is dynamically typed, but there's actually a scalar-vs-object kind dichotomy like in Java. So you can't use an int where it expect an NSString.

I have no idea what you mean by your example though.

Name: Anonymous 2012-11-06 5:58

>>23
I was just baffled by the existence of such a nonsensical type as NSNumber. Redundant as fuck.

Name: Anonymous 2012-11-06 6:05

>>12
but wouldn't it be true that if objective-c was a community supported free and open source language, then the issues of documentation and proper compiler implementation would be solved?

i suppose i'm a little bit confused why i can't just 'download' objective-c

oh wait... apple

Name: Anonymous 2012-11-06 7:20

>>1
ONE WORD: APPLE

Name: Anonymous 2012-11-06 9:50

>>25
The two main Objective-C compilers (clang, GCC) are both open source.

Don't change these.
Name: Email:
Entire Thread Thread List