Earlier quoted context omitted.
My apps almost never crash since I switched to Swift. That alone gives it the edge over ObjC for me.
How do you do DSP work in Swift?
Bringing Objective-C to the Amiga
31–40 of 113 posts
Re: Bringing Objective-C to the Amiga
#32Does anyone else look at Objective-C code, and just want to puke?
It’s not puke inducing, but it is verbose. The language designers just took a different approach to how to write code. Just for some background, it came out at a similar time to c++. Both were designed to be a ‘better c’
This is all laid out in great detail in the wonderful Object Oriented Programming: an Evolutionary Approach.
Re: Bringing Objective-C to the Amiga
#33Earlier quoted context omitted.
I actually prefer Objective-C to Swift.
My apps almost never crash since I switched to Swift. That alone gives it the edge over ObjC for me.
Re: Bringing Objective-C to the Amiga
#34Earlier quoted context omitted.
Personally I prefer the brackets of ObjC to the colon overload of C++
> the colon overload of C++ There's a lot of colons here too: - (id)outputImageProviderFromBufferWithPixelFormat:(NSString *)format pixelsWide:(NSUInteger)width pixelsHigh:(NSUInteger)height baseAddress:(const void *)baseAddress bytesPerRow:(NSUInteger)rowBytes releaseCallback:(QCPlugInBufferReleaseCallback)callback releaseContext:(void *)context colorSpace:(CGColorSpaceRef)colorSpace shouldColorMatch:(BOOL)colorMatc…
Re: Bringing Objective-C to the Amiga
#35Does anyone else look at Objective-C code, and just want to puke?
Rant:
Objective-C is a wonderful language, once you learn it properly. There's a lot of Swift fanboiism (is that a word?) and a lot of Objective-C hate. I have an opinion on why.
The vast majority of people that used Objective-C were drawn to the success of iOS. They were developers, used to languages like Javascript, Java or C++. Coming to Objective-C, their immediate reaction was "WUTT??? Brackets!" Instead of properly learning the idioms, they fought the language on a daily basis and cursed Apple for forcing them to use a language unlike the one they were used to, in order to jump on the iOS bandwagon. These people, once Swift was released, jumped boat immediately because they never really understood Objective-C and Swift is familiar.
Another group of people: the seasoned Objective-C developers, with a clue, went: "hmmm... this doesn't solve any of my real problems," but they weren't stupid and Apple was quite clear that Swift was the future. They learned Swift, got used to the bad, learned how to like the good and went along their business.
Another group of people actively dislike Swift, and really enjoy Objective-C. These are considered dinosaurs and have to either hide their opinion or face hiring difficulties, or even dismissal from companies where they are currently employed. Hiring managers, usually incompetent and non-technical in nature, ask: "Do you use Swift? Do you like it?" If you want a job, you must say yes. Disagree with me? Try a no.
All new documentation is Swift oriented. All conferences and talks are in Swift. All new books are in Swift. You would have to be crazy to stick to Objective-C, but not for technical reasons.
The Objective-C vs Swift debate is similar to vi vs emacs, except that vi and emacs would be built by the same company and that company explicitly said "emacs is the future."
Nat, went like: screw this, and built https://www.mulle-kybernetik.com/weblog/2015/mulle_objc_a_ne...
Objective-C has warts. It is also fast. And stable. And quick to compile. Did I mention stable? It is also: stable. My code from 20 years ago still runs.
Objective-C is a marriage of my two favorite programming languages: C and Smalltalk.
Objective-C is message oriented, like Alan Kay envisioned, instead of object oriented. The focus should be messages and messaging to nil is a FEATURE. I actually quite like it.
In Objective-C you can drop to C at any given time and have access to all the insanely fast libs. You can also write such insanely fast code yourself.
Swift is immature, unstable, bloated, overengineering and extremely complex as a language. Complex as in C++ complex, but without the speed.
Ever heard of Objective-C++? Yup. Everything I said, except exchange C for C++.
Swift sacrifices LOTS of things and introduces new ideas that have yet to be proven efficient, and you get to rewrite your code all the time. Have something you wrote 2 years ago? Good luck with that.
All productivity "supposedly" gained by Swift is lost to slow compiles, rewriting older code and migrating to the new version when it comes out.
Swift is safe and everything. Right. Except developers with deadlines will just ! all the optionals when they get in the way.
Prototype a new idea? Prepare to fight the compiler the entire time.
Now, Swift does have some cool things, but so could a new version of Objective-C. In fact, ARC, which is pretty cool was born out of the development of Swift.
In my opinion, Swift is not a great language. I would even say that it's not good. It's OK. Maybe one day it will be good, but this day is not today.
All the love I hear is based on developers that resist learning something new (like Objective-C's way of doing things) and that's a good thing?
I love Cocoa. There's an impedance mismatch between Swift and Cocoa. Objective-C + Cocoa is wonderful.
Oh well. Objective-C is as good as dead and I'd rather write Go, Kotlin, C, Ruby, Erlang or even C++ than Swift.
Re: Bringing Objective-C to the Amiga
#36Re: Bringing Objective-C to the Amiga
#37I "brought" Objective-C to the Amiga sometime in ~1986/1987.
I had recently acquired one of the first Amigas in Germany, still a US NTSC model, and also seen Objective-C discussed in a BYTE article. The beautiful OO structure of the Amiga Exec kernel and the higher OS levels built on top of those abstractions (except the abomination that was AmigaDOS) was almost certainly an inspiration.
Having also recently purchased my first C compiler, Manx Aztec C, I initially had some fun with implementing OOP via some Macros and the Amiga shared library mechanism, which was essentially an array of function pointers/C++ vtable.
I don't quite remember when I got the crazy idea of actually implementing an Objective-C runtime and preprocessor, before or after getting the book. I do remember that it felt very much "here goes nothing", and it really was nothing. I was in high school, I had no CS training, didn't know about compilers, hadn't programmed in C for more than a couple of months.
So I wrote a weird lexer that used a bitmap and two counts to cover all the regex cases, a syntactic recognizer that could tell the Objective-C constructs apart most of the time (it had a hard time distinguishing a method send with a cast from indexing into the return of a function call). And a runtime and basic object library. My dictionary implementation turned out to be ordered almost by accident, I have grown very fond of ordered sets and dicts. It also had automatic serialization ("passivation" as it's called in the book), something Apple has only gotten around to just now, and only for Swift.
It worked and I never looked back. I later ported it to i386 and QNX + MS-DOS for a project, replacing the assembly-language messenger function with a pure ANSI-C one returning the function pointer of the method (a technique later rediscovered for the GNU runtime).
When NeXT came out I knew I had to have one. And ditched my implementation in a heartbeat: SEP!
Interestingly, there was another Objective-C implementation from Germany in around the same timeframe called M:OOP, which actually got a little bit of press coverage:
https://ekartco.com/wp-content/uploads/2012/11/m_oop.pdf
As far as I could tell, it never got the fully generic objc_msgSend() running, with only a limited number of arguments supported.
Fun times, but also valuable lessons:
- Go tackle "crazy ambitious" projects.
- A language that can be implemented by a kid with a C compiler is a gem.
- An architectural approach to language is really valuable.
Re: Bringing Objective-C to the Amiga
#38Funky! I "brought" Objective-C to the Amiga sometime in ~1986/1987. I had recently acquired one of the first Amigas in Germany, still a US NTSC model, and also seen Objective-C discussed in a BYTE article. The beautiful OO structure of the Amiga Exec kernel and the higher OS levels built on top of those abstractions (except the abomination that was AmigaDOS) was almost certainly an inspiration. Having also recently p…
Re: Bringing Objective-C to the Amiga
#39Does anyone else look at Objective-C code, and just want to puke?
No, and if you do, then I suggest you visit a doctor. Rant: Objective-C is a wonderful language, once you learn it properly. There's a lot of Swift fanboiism (is that a word?) and a lot of Objective-C hate. I have an opinion on why. The vast majority of people that used Objective-C were drawn to the success of iOS. They were developers, used to languages like Javascript, Java or C++. Coming to Objective-C, their imme…
In John Oliver’s voice : “Fuck you Apple, fuck you.”
Re: Bringing Objective-C to the Amiga
#40Earlier quoted context omitted.
I prefer to keep the dynamism over unreadable fp "expressiveness" or safety that was not needed in the first place.
There's nothing stopping you from writing dynamic Swift code or functional programming in Objective-C.
In Swift, you cannot currently create classes in code, enhance and swizzle, implement proper proxies. You couldn’t even load a nib without the ObjC runtime. Not even reflection. It’s telling what their priorities were with that language. What good is the language when you cannot implement most of the system frameworks (Cocoa, Core Data, etc.) without nasty hacks?