4 ms·
I hate Obj-C with a fiery passion. My single biggest issue with it is that it simply does not make my life as a programmer any easier. On the other hand when I
by forrestthewoods 15y ago
I hate Obj-C with a fiery passion. My single biggest issue with it is that it simply does not make my life as a programmer any easier. On the other hand when I work in C# I am constantly amazed at how damned easy the language and the libraries make my life.
Not once when using Obj-C have I ever said, "Wow, that was so easy thanks to Obj-C!!!" I am more likely to curse the heavens as to why the debugger can't show me the contents of any basic container type.
Going forward my work will be as heavily cross-platform C++ as I can make it. The UI may be done through platform native interface constructs, but everything I can possibly make C++ I will.
- alexbell 15y agoWhat you care to provide an example? Are you referring to not being able to mouse over a var during debugging and having it displayed properly? I've never minded having to use gdb to type out "po items", but can understand that if you're used to mousing over and getting vars it would be annoying. I don't disregard your perspective, mine is just exactly the opposite (I would prefer ObjC/Cocoa to C++/<Framework of your choice>, no contest).
- forrestthewoods 15y agoMy perspective is one of a PC/console game background who works on iOS stuff on the side. The transition from VisualStudio/C++ to Xcode/Obj-C is eye stabbingly awful. Obj-C can absolutely accomplish most anything that C++ can, but I don't think the language makes of it easier. Once you've learned that GDB even exists and figured out many of the strange syntax nuances it's passable, but in my opinion not easier. By comparison going from C++ to C#, Lua, or Python (my personal experiences) is astonishingly easy. Not just easy at first but continuously surprising at how many wonderful things you can do and how easy it is. As I said in my root post not once have I ever said "holy shit Obj-C sure made this task easy!"
- alexbell 15y agoFair enough, and I can certainly empathize with wanting to use C++ so you don't have to rewrite everything for another platform. My perspective is going from the C/C++ (on Visual Studio for the most part) I used in school (so none of those nifty libraries/frameworks), to (for the most part) working on a data driven mobile application for iOS/Android. And after working with the Cocoa frameworks, I did say "Holy shit, Cocoa sure made this task easy!" :)
- xsmasher 15y ago>Once you've learned that GDB even exists and figured out many of the strange syntax nuances it's passable, but in my opinion not easier. You can mouse over an NSArray or NSDictionary and see its size and contents. You're not as familiar with the tools. I have your same complaint, but about C++. I'm frustrated that I can't easily see the contents of a std:set or std:map in xcode. I'd be thrilled to find out if it's just a gap in my knowledge, though.
- forrestthewoods 15y agoAn NSMutableArray full of nothing but NSStrings will not display the string values of those strings on either mouse over or the locals view. I can see the number of strings but not what those strings actually are. :(
- jbrennan 15y agoAre you comparing Objective-C to C# or C++? Those are two completely different beasts. I find Objective-C refreshing when compared to C++ ( take inheritance for example...in C++ I need to redeclare functions I'm overriding from my base class. Every change needs this. What a pain! Not so in Objective-C). Having said that, I can't say how it compares to C#.
- makecheck 15y agoNSArray* x = ... NSLog(@"x is %@", x); That shows you the entire array. And there are other ways.
- DrJokepu 15y agoAs someone who also used to really dislike Objective-C and also likes C#, I would urge you to reconsider your opinion about Objective-C. It's really not a bad language. It makes different trade-offs than C#, but I think once you understand the "philosophy" behind the language, chances are that you will discover that it's actually a pretty good tool for certain tasks (at least this has happened to me). I agree however that the current state of debugging Objective-C code is simply atrocious. I really hope that Xcode will address that soon.
- jbrennan 15y agoAs someone who spends most of their time in Xcode doing Objective-C work, I find the debugger to be particularly delightful. Between the gdb/lldb shell, mouse-over displays, variables view, "automatically run in the debugger when I set breakpoints without needing to be in a special Debug mode", the Static Analyzer, and Instruments, I find it to be a treat. What do you find atrocious about it? Perhaps it's something I'm missing as I haven't used Visual Studio's debugger in forever (or Eclipse, or Qt Creator)..
- DrJokepu 15y agoI have no complaints about the static analyzer and Instruments; they're both excellent tools. The debugger is stuck in the 80's, it's essentially GDB with a very light GUI rigged on the top of it. It doesn't allow for things like easy exploration of data structures; the complaint by the OP is very legit, you shouldn't have to jump through hoops just to see what's going on in an NSArray. The very fact that NSLog is so common in Objective-C code (and not used for error logging purposes but for debugging purposes) is indicating that it is very difficult get any useful information out of the Xcode debugger. Not to mention the lack of advanced features such as Visual Studio's historical debugger that can be very very helpful.