HackerTrans
TopNewTrendsCommentsPastAskShowJobs

fleitz

no profile record

comments

fleitz
·há 8 anos·discuss
Eternal September.
fleitz
·há 9 anos·discuss
Why is it bad? Customers are buying 30% more CPU ;)
fleitz
·há 11 anos·discuss
Have you thought about switching to type script to get the benefits of type safety?

http://www.typescriptlang.org/
fleitz
·há 11 anos·discuss
I meant string as in char* not NSString, selectors specifically the SEL datatype are strings

They certainly don't have to be, however, they are.

    SEL selector = @selector(applicationDidBecomeActive:);
    printf("%s",(char*)(void*)selector);
    // Prints applicationDidBecomeActive:
fleitz
·há 11 anos·discuss
I think the biggest issue is that in a vtable you jump directly to the method by index, and with objc_msgsend it looks up a string in a hash table.

Mostly the difference is ints vs. strings in my opinion.

As well in C++ if you don't mark your method virtual you can bypass all the vtable crap.

I love ObjC but method resolution is far more expensive than in C++, especially non-virtual methods.
fleitz
·há 11 anos·discuss
By academic, I meant academic problems that Swift solves such as increased type safety...

Not academic research as in we did a study of developers who write iOS apps and determined that type safety as implemented in swift helps great developers write apps faster. (F# on the other than has a great type system that doesn't get in your way)
fleitz
·há 11 anos·discuss
It's certainly gotten much better with Swift 2.0, it feels like Apple finally tried to build an app with Swift 2.0 and fixed a lot of the stuff that is horribly broken.
fleitz
·há 11 anos·discuss
Yup, ObjC is light and scripty. Whenever you don't like what it's doing you just make it do what you want, categories, cast to id, swizzling, respondsTo, NSSelectorFromString, etc, and when it's too slow you write those functions in C/C++ which it integrates well with.

Swift you're always contorting yourself to express things in a way that the language wants, it reminds me of writing java, it worships far to heavily at the altar of type safety as if type safety was a goal in and of itself.

ObjC is practical, Swift is academic.
fleitz
·há 11 anos·discuss
Read the eulogy when the base libraries are Swift...

When swift code that interacts with the base libraries is faster, and when swift code compiles faster.

Swift so far is a language that over promises and under delivers...