3 ms·
This sounds neat, but I want to ask others here as I am not (yet) a Cocoa developer - is all Cocoa code this ugly? In these short examples I honestly can't fath
by eblume 14y ago
This sounds neat, but I want to ask others here as I am not (yet) a Cocoa developer - is all Cocoa code this ugly? In these short examples I honestly can't fathom what is happening due to the syntactic 'oddities'. Maybe my C-variant-fu is not as strong as it should be.
- poutine 14y agoHeh, welcome to the learning curve :) Yeah, it can be ugly, but once you know what's going on it all reads pretty quickly.
- FuzzyDunlop 14y agoIt's not so bad if you give it space to spread out a little. The wrapping in the column makes it much more difficult to follow, especially when used with Xcode's unusual indent style.
- aarontait 14y agoObjective-C has a higher learning curve. But once you learn it, you will see the elegant beauty in it.
- gte910h 14y agoObjective C is smalltalk on top of C. It looks extremely bad when you stick it in the super skinny columnar formats of many blogs. At 80-300 characters per line it's fine and very readable.
- berntb 14y agoSo Objective C programmers can't print code to read it? :-(
- gte910h 14y agoWhat? The blog is displaying the text narrower than it shows up in a source file. This makes it uglier than it is in actual practice e.g. What ? The blog is displaying the text narrow- er than it shows up in a source file . This makes it uglier than it is in actual prac- tice
- berntb 14y agoI got the point, sorry if I was unclear. My point was, it is hard to print 300 chars wide code. Ideal code width for printing is < 80 chars...
- UK-AL 14y agoEh. You get used to it, then it looks normal. I guess it's the same 'wtf' when beginners see a bunch of meaningless code.
- wsc981 14y agoI guess the blocks-in-blocks code can get quite unreadable at times. Personally I like to store blocks in variables in such situations and add the variable to a function that required the block parameter. Makes code so much more readable when blocks are nested.
- joshaber 14y agoYeah, we played around with a bunch of different styles, including defining the block before its use. It looked cleaner but the code locality of defining them inline won.
- stcredzero 14y agoThis sounds neat, but I want to ask others here as I am not (yet) a Cocoa developer - is all Cocoa code this ugly? I am a Cocoa developer, and I have to say that the presentation of this idea on the blog leaves something to be desired. It seems to be oriented towards people already familiar with Reactive Programming and FP, but it doesn't set up that expectation at all. At the same time, it's very confusing and a little unintentionally off-putting for devs who aren't familiar with those notions, even for those who already know Objective-C and KVO. It still might be a good idea, though.
- joshaber 14y agoThat was my fear while I was writing the post :\ The problem with Rx / RAC is there's a big learning curve, especially coming from procedural programming. It's much bigger than 1 blog post can cover. My hope at least is that it will drive at least some people to dive deeper.
- irrationalfab 14y agoIt appears to be personal, but for many the answer is yes... that's why RubyMotion is a big deal.
- pablasso 14y agoRubyMotions looks even uglier for me. It's just like someone stripped all the beauty of Ruby with libraries that weren't meant to pair with it.
- irrationalfab 14y agoThe Objective-C syntax doesn't look strange to me, yet its verbosity make the whole picture more difficult to grasp than in Ruby in my opinion. It's somehow like difference between a document and a bullet point reppresentation of it. However, I haven't made my mind yet about RubyMotion. There are some propositions for it and some against and a lot has to come in the next weeks. Let's see what will happen. Note: I have been coding in Objective-C for two years and in Ruby for 1-2 months.