Programming in OS X

2»

Comments

  • Reply 21 of 29
    jousterjouster Posts: 460member
    I just finished a semester of C#.



    I thought my head would explode.



    But then, I am a medieval history major, so hardly qualified to have an opinion.



    But I do enjoy reading those who are.......
  • Reply 22 of 29
    cubistcubist Posts: 954member
    <rant>

    Of Cocoa (Objective-C), C++ and Java, Java has the cleanest syntax. But frankly, I'm displeased with all of them. All three are clunky and verbose. It takes so much code to do the simplest things. I think the MVC model is part of the problem, actually. Why do I have to have a UI object with a data source that links it with a backend class that gets synchronized through events or whatever you call them... Why can't the stupid UI object CONTAIN the data, let the user manipulate it, and let me have the results?



    I think it's time for us to develop the next step beyond these really stupid objects we have to write all this boilerplate for. And before you scoff, I was writing programs while most of you were in diapers. I'm tired of having to handle clicks and scrolls and mousedowns and drags myself. Why can't we have any objects that have INTELLIGENCE?

    </rant>



    C++ and Objective-C are really kind of a kludge on top of C. I'm not convinced they save a lot of coding over straight C. But NextStep's class libraries, which they call "frameworks", do save a lot of work. Cocoa isn't just Objective-C, it's also those "frameworks". Simply put, you'll get more done with less work using Cocoa than with Carbon.



    Now do we have any fans of wxWindows out there?
  • Reply 23 of 29
    Quote:

    Originally posted by jouster

    I just finished a semester of C#.



    I thought my head would explode.



    But then, I am a medieval history major, so hardly qualified to have an opinion.



    But I do enjoy reading those who are.......




    I'm just curious how the Mono Project will be in the next few years. I set up the compiler in my Gentoo Linux box.



    According to the projects page, most of the functionality of C#, ADO . Net, and ASP.NET is present. Unfortunately, Visual Basic .Net implementation is still lacking some core features. You can download the source at the above link and compile it to run under PPC in Mac OS X or Linux.
  • Reply 24 of 29
    programmerprogrammer Posts: 3,457member
    Quote:

    Originally posted by Kickaha

    Riiiiiiiight, but what do you think you're doing when you roll a highly optimized C++ method that eschews RTTI, templates, STL, etc, and all the rest of the bugaboos that are known speed killers in C++? You're left with C. Obj-C does precisely the same thing - don't use the selector method calls, and you've stripped off the Obj part, leaving you -C. Er, C. There's really no difference in my experience.



    A lot of those "known speed killers" are urban myths. Templates and STL can often be used in high performance code with no problems, assuming a relatively modern compiler.





    Quote:



    C++ definitely has its place - learning OO isn't one of them, IMNSHO.




    OO doesn't inherently have to mean a dynamic runtime binding system (a la ObjC, SmallTalk, etc), either. Restricting OO to that kind of a solution dramatically limits its usefulness.



    I do agree that C++ is not a good language to teach programming novices, however.
  • Reply 25 of 29
    Quote:

    Originally posted by cubist

    <rant>

    Of Cocoa (Objective-C), C++ and Java, Java has the cleanest syntax. But frankly, I'm displeased with all of them. All three are clunky and verbose. It takes so much code to do the simplest things. I think the MVC model is part of the problem, actually. Why do I have to have a UI object with a data source that links it with a backend class that gets synchronized through events or whatever you call them... Why can't the stupid UI object CONTAIN the data, let the user manipulate it, and let me have the results?




    The MVC model exists for a reason and is a good thing for a lot of reasons. The main problem with it is that the languages & tools available to support are still not that great. Personally I think ObjC/Cocoa's support for it is increadibly hoakie. I haven't learned C# myself but from what I've heard from my co-workers it sounds like MS has gotten closer to the mark. We still have a ways to go, however, before MVC is implemented cleanly and naturally.



    It is still much better than trying to have the GUI hold the data. Believe me, I know -- I've done it both ways and every time I put the data in the GUI I regretted it severely.
  • Reply 26 of 29
    Quote:

    Originally posted by cubist

    I think the MVC model is part of the problem, actually. Why do I have to have a UI object with a data source that links it with a backend class that gets synchronized through events or whatever you call them... Why can't the stupid UI object CONTAIN the data, let the user manipulate it, and let me have the results?



    the problem would be this (atleast, this is what i think i learned in class): suppose you have a set of data, like maybe a number of records from a database. your gui is a table, and datasource is tightly bound to that table. the user says "i dont care about column X from the data." so your gui drops the column. a second user comes up and says, "hey, give me the X column." your program now regenerates the data because it isn't there (remember your data was so tightly bound to your gui table, that part of it was lost with the missing column). your second user is annoyed at the slow performance. your boss finds out, and now you've been fired. a mass of hackers had unwittingly followed your lead, and similarly get fired. massive unemployment ensues. strife and starvation run rampant. world collapses on itself.



    with mvc: by separating the model, your data isn't manipulated, contorted and lost with a user's whim. their view may be different, but luckily the view doesn't have any control over the data (model). only the control can alter the model, and it can be completely independant of anything the user does with the interface (view). all of your users love the speed and verility of the program, as they remove and add columns with wild abandon. your boss hears about your programming prowess. you get a raise. you spend your money on lavish electronics. economy booms. world saved.



    basically, mvc is good because it will stop the world from collapsing on itself.
  • Reply 27 of 29
    Quote:

    Originally posted by Programmer

    The MVC model exists for a reason and is a good thing for a lot of reasons. The main problem with it is that the languages & tools available to support are still not that great. Personally I think ObjC/Cocoa's support for it is increadibly hoakie. I haven't learned C# myself but from what I've heard from my co-workers it sounds like MS has gotten closer to the mark. We still have a ways to go, however, before MVC is implemented cleanly and naturally.



    i've used c#, c#.net and other microsoft languages, and i dont find them to be much better. we don't stress good programming concepts at my job, so things like mvc are pushed to the side while deadlines and budgets get tossed around. i'm inclined to think that a lot of the responsiblity for good programming design, stuff like mvc, lies on the programmer. the languages can only do so much, and with every abstracted attempt they make, they are taking away cycles from useful lines of code.



    i think objc does a pretty darn good job. example: the Cocoa class `NSTableView' is the view. the dataSource is the model. and the delegate is the controller. all a programmer needs to do write 2 classes, to put into the datasource and delegate places. and Cocoa does it without much of a performance hit. a little bit of law of demeter and all is handled well.
  • Reply 28 of 29
    Quote:

    Originally posted by thuh Freak

    i've used c#, c#.net and other microsoft languages, and i dont find them to be much better. we don't stress good programming concepts at my job, so things like mvc are pushed to the side while deadlines and budgets get tossed around. i'm inclined to think that a lot of the responsiblity for good programming design, stuff like mvc, lies on the programmer. the languages can only do so much, and with every abstracted attempt they make, they are taking away cycles from useful lines of code.



    Good design is much easier if you don't have to deal with the shortcomings of the language and detailed mechanics of the machine. This is why people don't code in machine language.



    Quote:

    i think objc does a pretty darn good job. example: the Cocoa class `NSTableView' is the view. the dataSource is the model. and the delegate is the controller. all a programmer needs to do write 2 classes, to put into the datasource and delegate places. and Cocoa does it without much of a performance hit. a little bit of law of demeter and all is handled well.



    ObjC does a reasonable job, and Cocoa is a pretty well designed set of frameworks. There are examples of languages which do a better job, however, and that leads me to think that Apple should apply those languages or improve ObjC with those techniques.



    The example you describe isn't something unique and wonderful in Cocoa -- I've seen similar facilities in other languages and frameworks, with both less and more performance and memory hits.
  • Reply 29 of 29
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by Programmer

    Good design is much easier if you don't have to deal with the shortcomings of the language and detailed mechanics of the machine. This is why people don't code in machine language.



    *bing bing bing*



    Which is why I point new OO students to a dynamic language with a good simple syntax, like Obj-C, or Smalltalk. (I'd recommend Eiffel, but while the covariant return typing makes polymorphism a *dream*, it's the only stinkin' language that does it, meaning moving to anything else is paaaaaaaainful.) Java is 'mostly dynamic' in that it tried to be too similar to C++ for convenience, and lost a critical little bit of its dynamic soul in the process. *snif* Rest In Peace, oh valiant project Oak.



    Quote:

    ObjC does a reasonable job, and Cocoa is a pretty well designed set of frameworks. There are examples of languages which do a better job, however, and that leads me to think that Apple should apply those languages or improve ObjC with those techniques.



    The example you describe isn't something unique and wonderful in Cocoa -- I've seen similar facilities in other languages and frameworks, with both less and more performance and memory hits.




    Yup, the frameworks are good in Cocoa, but not perfect.



    Of course, they predate anything I saw anywhere else by nearly ten *years*... talk about your wasted leads. *sigh*





    Out of curiosity, what other language facilities do you see as interesting or better enough that you'd like to see Apple adopt them?



    I hate to say it, but C#'s delegate is pretty slick.
Sign In or Register to comment.