Coding for X in Objective C and C++

2

Comments

  • Reply 21 of 44
    I mostly agree with bawjaws. Object-oriented programming is good. C++ is overly complicated and bad. Java is good. However, I would not suggest Java or any object-oriented language as your very first language. Ya gotta learn the basics first. Rightfully, most CS departments feel the same way. First, they teach you C, Pascal, or Fortran. Then, they move on to Java or C++. I suggest getting into object-oriented programming very early, but not as your very first language.



    Also, although Java is a great language, it is currently too slow and too much of a memory hog for many situations. In my experience, even with native compilation, Java applications are much slower and use much more memory than their C/C++ counterparts. Soooo... C/C++ is still (unfortunately) the most popular programming language. And serious programmers need to know it.



    [ 02-23-2002: Message edited by: Brian J. ]</p>
  • Reply 22 of 44
    [quote]Originally posted by applenut:

    <strong>

    while I'm at it.. wat's the basic difference between Computer Science, Computers Systems Engineering and Electrical Engineering with a Computer Hardware Focus?</strong><hr></blockquote>

    CS is usually a liberal arts degree while the other two are engineering degrees. In CS, you learn mostly about software. You only learn hardware design at the logical level, and don't learn anything about physics or electricity. In EE, you learn mostly about hardware, physics, electrons, etc... And you learn very little about software. Computer Engineering is in between the two. I did CS, but took as many hardware courses as I could. If you want to be a systems level programmer, such as an OS X engineer or a device driver programmer, you need a decent understanding of hardware.



    No offense to hardware engineers, but IMHO CE or CS is definitely the way to go. It takes a lot of capital to develop hardware, so hardware engineers often get stuck being a "cog" in a big company.



    [ 02-23-2002: Message edited by: Brian J. ]</p>
  • Reply 23 of 44
    [quote]Originally posted by applenut:

    <strong>wow guys. that was great and really helped a lot. Really appreciate it.



    So, considering I have no programming experience but definitely want to get into it deeply what would you guys reccomend as a starting language?</strong><hr></blockquote>



    I highly recomend <a href="http://www.realsoftware.com/"; target="_blank">REALbasic</a>. Many people will argue against it, but it makes developing apps for Mac OS X, Mac OS 9 (Cocoa can't do this, and with C it's somewhat difficult), and even M$ Windows simple (i.e., only minor changes to code in a very large project). It is also a very good teacher of Object Oriented programming.



    Check it out. <a href="http://www.realsoftware.com"; target="_blank">http://www.realsoftware.com</a>;



    [And no, I don't work for REAL Spftware, I'm just a loyal customer.]
  • Reply 24 of 44
    No,stay away from RealBasic,it's slow and buggy,and after learning it you'll still have to learn real languages,it's better to start directly by learning high powered languages.
  • Reply 25 of 44
    For a starting language I would recommend plain QBasic. Once you get the let statement down, everything begins to make sense. It is an easy way to learn loop and other things. This is what I took last year as a sophomore in high school. Now I am taking AP Comp. Sci. in C++ of course, and it is very easy since all of the concepts are basically the same until you get to OOP. I think it would be very hard to start out completely on your own though. I would not have enough the patience for that.
  • Reply 26 of 44
    amorphamorph Posts: 7,112member
    I wanted to post this yesterday, but the boards were inaccessible:



    C++ is evil, especially as a learning language, for a number of reasons:



    Good didactic languages (like Pascal, Modula, Java, Smalltalk, Python) are clean, straightforward and built to encourage one programming paradigm. You don't want to distract students with convoluted grammars riddled with inconsistencies and exceptions, lots of fiddly things to remember, and no gestalt - no overarching, unifying paradigm. Unfortunately, C++ has a convoluted and inconsistent grammar, convoluted semantics, lots of fiddly things, and no gestalt. It's the most designed-by-committee language that I've ever seen, and I've seen a lot of them (including old warhorses like PL/I and COBOL).



    C++ is built on C. Unfortunately, while C is elegant on its own terms, it's difficult to master, and its strengths have very, very little to do with OO programming - or for that matter, with contemporary coding standards. Furthermore, its terms aren't terribly relevant anymore - not many people choose languages that were designed to be easy to write compilers for. C++ is so vast and so complicated - in addition to inheriting C's complications - that there are large gaps in feature implementations between compilers, countless bugs, and a shortage of accurate and readable books.



    I have two C++ books, one well-known and regarded, that totally flunk out when attempting to describe the behavior inherited from C. They're simply wrong. The OO coverage in both is good, fortunately, but this illustrates where C++'s attempt to please everyone starts backfiring: It brings to mind the old joke that every COBOL (or PL/I or Ada) programmer writes in a different language. And the world is littered with "C++ programmers" who know maybe 50% of the language. Maybe. This is the source of endless quantities of bugs, because one of the most difficult aspects of C (and therefore C++) to master is the way it handles expressions, and (obviously) that's also one of the most basic functions of the language. If you don't know how expressions work in the language you're using, all the OO methodology in the world isn't going to help you. And expressions are precisely where the book I referred to (Practical C++ Programming - admittedly, an older edition) goes wrong!



    OK. Now onto the other major disadvantage: C++ is not an object oriented language. It isn't. It has, as part of its endless list of bolted-on features, objects and classes and inheritance, but you have to have a very clear vision of how you want to organize your code, and what features you want to use how (and the caveats from the above paragraph applies: You have to know how they work, and you have to hope the compiler implements them) in order to use the language well. And, of course, if you're just learning to program, you don't have any of those abilities at your disposal.



    The argument that students need to learn on C++ because the market uses C++ is absurd: Programmers need to learn how to program, and that is essentially applied mathematics. A good programmer can design software on the back of a napkin, and then implement his design in whatever language he chooses to. That is what students should learn to do, and the best languages for the job are the ones that get out of the way and let the concepts shine through clearly. Java is OK for this (it's a bit too C++-ish). So is Python. Purer, simpler languages like ML, Prolog, Scheme, and Smalltalk are best (remember, it doesn't matter if you never use them professionally) because they allow you to clearly and concisely explore the logical and organizational aspects of programming, which are by far the most crucial.



    For actual development, you might want to learn C++ just because it will help put food on your table (for that matter, so will Visual Basic - and don't get me started on Visual Basic). The advantages of "slower" languages like Java, Objective-C, Python and Perl lie in the time it takes to develop programs with them, and the ease with which those programs can be augmented, debugged and supported. If you're planning on working by yourself or with a small team, they're by far the best choices.



    The debate about the intrinsic speeds of languages is by and large moot. A talented programmer with an interpreted language can beat a mediocre programmer writing in C or FORTRAN every time, because appropriate choice of algorithms and program design are the most effective optimizations. If you want to pick nits, though, Objective-C has several advantages over C++: Its class hierarchies are much flatter (less searching the inheritance trees), and you can use it almost like a pure OO language to rapidly develop a fully functional - if slow - version of your program and then take advantage of optimization to make it fully functional and fast. At full speed, Objective-C is every bit as fast as plain C is.



    If you do decide to learn C++, I'd recommend studying C alongside. Be patient: By my estimation, it takes at least a year to get really comfortable with C. The <a href="http://www.eskimo.com/~scs/C-faq/top.html"; target="_blank">FAQ for the comp.lang.c newsgroup</a> is a great help with some of C's more common gotchas. Kernighan and Ritchie's <a href="http://shop.barnesandnoble.com/textbooks/booksearch/isbninquiry.asp?userid=0IGMVG9LW0&mscssid=6XPCFX69 8QM19MN9LQ2XU3N2BM4N85W5&isbn=0131103628" target="_blank">The ANSI C Programming Language</a> is an invaluable reference, although it's a bit too dense to be a tutorial. Stanley Lippman's <a href="http://shop.barnesandnoble.com/textbooks/booksearch/isbnInquiry.asp?userid=0IGMVG9LW0&mscssid=6XPCFX69 8QM19MN9LQ2XU3N2BM4N85W5&isbn=0201485184" target="_blank">Essential C++</a> and <a href="http://shop.barnesandnoble.com/textbooks/booksearch/isbnInquiry.asp?userid=0IGMVG9LW0&mscssid=6XPCFX69 8QM19MN9LQ2XU3N2BM4N85W5&isbn=0201824701" target="_blank">A C++ Primer</a> are the best books I've seen on C++.



    If you start with Objective-C you'll need to know less C, but the above recommendations still hold. Your best resources here, besides Apple's documentation, are the comp.lang.objective-c newsgroup, OmniGroup's mailing lists, <a href="http://www.stepwise.com/"; target="_blank">Stepwise</a>, and <a href="http://mac.oreilly.com/"; target="_blank">O'Reilly's OS X pages</a>. I've heard a lot of good things about Aaron Hillegass' <a href="http://shop.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=0IGMVG9LW0&mscssid=6XPCFX69 8QM19MN9LQ2XU3N2BM4N85W5&isbn=0201726831" target="_blank">Cocoa Programming for Mac OS X</a>, so I'll pass that along. You'd think that Apple's own offering, Learning Cocoa, published by O'Reilly, would be good, but it underwhelmed me.



    Hope this ridiculously long-winded post was of some help.
  • Reply 27 of 44
    I have Aaron Hillegass's book,it's excellent,well worth the money-much better than Learning Cocoa.There's also a book called Programming Cocoa written by Scott Anguish and a few others that will be released within the next month or so that should be worth getting,I plan to buy it.



    I sort of mentioned it before,but if anyone is interested in programming for the pure fun of programming a language that is worth learning is steve, a very pure OO language used for the Breve artificial life simulation enviroment.steve has a lot of interesting features,such as vectors as a native data type,plus there is a lot of sample code written by Jon Klein,a fantastic programmer,his code is very concise and well-organized.Breve is available here:



    <a href="http://www.spiderland.org"; target="_blank">www.spiderland.org</a>
  • Reply 28 of 44
    [quote]Originally posted by Rick1138:

    <strong>No,stay away from RealBasic,it's slow and buggy,and after learning it you'll still have to learn real languages,it's better to start directly by learning high powered languages.</strong><hr></blockquote>



    Could you elaborate please? I've been using it for years (since version 1), and I've had no problems with speed or bugginess.
  • Reply 29 of 44
    *Bump*



    Well, it looks like no one wants to touch this one with a 10 foot pole.



    Seriously, I think that REAlbasic has a very undeserved reputation of being slow and buggy, both of which it is not.
  • Reply 30 of 44
    I've seen programs that didn't know where RealBasic apps and when I found out, I as really surprised... Most of my experiences with RealVasic apps have been incredibly slow games and apps and you can tell just from opening them that they are made with RealBasic (that is if they even have custom icons).



    But you're quite right, that is prolly more the coders' fault and not RealBasic's.
  • Reply 31 of 44
    [quote]Originally posted by graphiteman:

    <strong>*Bump*

    Well, it looks like no one wants to touch this one with a 10 foot pole.



    Seriously, I think that REAlbasic has a very undeserved reputation of being slow and buggy, both of which it is not.</strong><hr></blockquote>

    Well, I really don't want to start a flame war, but Basic is an inelegant, ugly language. And I don't like when IDEs automatically generate code. It's nice for trivial tasks, but it gets in the way when doing something challenging. I'd rather interface a clean API myself, rather than have some convoluted "magic" performed automatically. I mean, typing is not the hard part of programming; design is. Also, a tool which automates everything is not going to help a newbie learn the fundamentals of programming.



    [ 02-26-2002: Message edited by: Brian J. ]</p>
  • Reply 32 of 44
    airslufairsluf Posts: 1,861member
  • Reply 33 of 44
    I didn't have time to reply earlier,but RealBasic is too slow for any app that puts any serious demands on the processor,such as animated graphic apps,3d graphics,any type of scientific computing app,or any app that has to access a database of any size.Generated code just isn't fast enough.
  • Reply 34 of 44
    Well, we just did templates in C++ yesterday and I'm very quickly beginning to see how disgusting this language is... Just hack upon hack to make it 'work', there is no obvious way yet to do dynamic binding (that will come apparently, but Objective pretty much started with it) and the arrow notation '-&gt;' is just crude.

    Thanks for the heads up guys (and gals?)!
  • Reply 35 of 44
    A long term benefit of C++ templates is that they're hard to remember.
  • Reply 36 of 44
    [quote]Originally posted by Brian J.:

    <strong>

    Well, I really don't want to start a flame war, but Basic is an inelegant, ugly language. And I don't like when IDEs automatically generate code. It's nice for trivial tasks, but it gets in the way when doing something challenging. I'd rather interface a clean API myself, rather than have some convoluted "magic" performed automatically. I mean, typing is not the hard part of programming; design is. Also, a tool which automates everything is not going to help a newbie learn the fundamentals of programming.



    [ 02-26-2002: Message edited by: Brian J. ]</strong><hr></blockquote>



    Are you referring to BASIC code (with line numbers, GOTO statements, etc) or REALbasic code (with complete object orientation, strong typing, etc)?
  • Reply 37 of 44
    [quote]Originally posted by AirSluf:

    <strong>And there are several things in any BASIC implementation that are just plain bad concepts for cranking out reliable code. BASIC had it's place 30 years ago, but today it does a newbie more harm than good in unlearning bad habits that are required to use BASIC. The IDE's just pour a syrupy layer over the top of that.</strong><hr></blockquote>



    What kinds of bad concepts and habits are you referring to, exactly? ANd could you elaborate on that 'syrupy layer' that you brought up?



    REALbasic is completely different from the BASIC of 30 years ago. It's completely object oriented, has proper flow control, etc.



    NOTE TO EVERYONE: I'm not trying to start a flame war either, I'm just trying to undo some of the misconceptions about REALbasic that exist.
  • Reply 38 of 44
    [quote]Originally posted by Rick1138:

    <strong>I didn't have time to reply earlier,but RealBasic is too slow for any app that puts any serious demands on the processor,such as animated graphic apps,3d graphics,any type of scientific computing app,or any app that has to access a database of any size.Generated code just isn't fast enough.</strong><hr></blockquote>



    This is true. REALbasic is not quite as fast as a C++ application. But this is changing. REAL Software has been hard at work creating a brand new complier that will address many of these issues. And you can test drive it right now; it's included in REALbasic in the form of RBScript, runtime-compiled version of the REALbasic language.



    <a href="http://www.realsoftware.com/"; target="_blank">http://www.realsoftware.com/</a>;
  • Reply 39 of 44
    [wow, 4 replies in a row!]



    Please, everyone, before we continue this discussion, if you haven't already done so, download the REALbasic demo and play with it for 5 minutes. I think you will be somewhat surprised at what you see.



    <a href="http://www.realsoftware.com/"; target="_blank">http://www.realsoftware.com/</a>;



    [ 03-01-2002: Message edited by: graphiteman ]</p>
  • Reply 40 of 44
    airslufairsluf Posts: 1,861member
Sign In or Register to comment.