Thinking About Developing, Or Well, Programming

24

Comments

  • Reply 21 of 63
    Quote:

    Originally posted by iShawn

    I stole my father's book for a while since he said he wouldn't need it in the meantime and I've been messing around with it. I really enjoy it.



    Is there a way to see the source code to applications? How do you go about doing this?



    And also only last thing...

    I want to have little snippets of code that might make my applications run better for me and maybe for others... is there a way (or is it illegal) to take something like iTunes and add a little thing to it - this is my goal - that might make it work better for me... without having to applescript it (because from what I know you have to click on something to activate a script) and just having it install itself into the code. Is this considered illegal work? Or is this what developers do?



    As always, thanks!




    No expert here, but from what I know:



    - Unless the source code is provided by the developers (i.e. open-source software), it is impossible to get the source code. The applications out there usually come pre-compiled, reading the binary code is kind of hard.



    You could reverse engineer the code. But using or altering the code usually is illegal due to copyrights and terms of use.



    - The application might have been developed to allow third parties to write add-ons (as far as I know, iTunes is) or an API (application programming interface) is provided so you can use this application's functionality in your projects (i.e. all the Core stuff Apple will be providing in Tiger and QuickTime in the current versions of OS X).



    Most of the Mac OS X apps are Apple-Scriptable.



    - What kind of enhancement do you have in mind for iTunes that would not require the user to trigger it? It usually is a bad idea to develop something that kicks in without the user's knowledge (i.e. spyware, virii, trojan horses).
     0Likes 0Dislikes 0Informatives
  • Reply 22 of 63
    toweltowel Posts: 1,479member
    Quote:

    Originally posted by RolandG

    Are there any tutorials out there or a good book covering the XCode IDE and the Cocoa framework (maybe Objective-C as well)?



    There are a number of web tutorials out there (inlcuding from Apple) that will show you how easy it is to copy-and-paste their two lines of code to make a functional (web browser|text editor|calculator|etc.). But Cocoa is just too deep an environment to learn by tutorial, unless all you want to do is whatever the tutorial did.



    If you want to learn Cocoa, and don't have any prior C/ObjC/Cocoa experience, I highly recommend a pair of books, one which teaches the basics of Objective-C, the other of which guides you through the nuts and bolts of the Cocoa API:

    - Programming in Objective-C by Stephen G. Kochan

    - Cocoa Programming for Mac OS X by Aaron Hillegass



    Both take some time to get through, but they're extrememly approachable and reasonably thorough. Hillegass's book is the standard for learning the Cocoa APIs. But Kochan's was the real find for me, because every other book on Cocoa or ObjC assumed that you already knew C, and I didn't. Kochan's book teaches you all the C basics, as well as the ObjC-specifics, all aimed directly at budding Cocoa programmers. Great book.



    The other thing I recommend to anyone wanting to learn Cocoa is to have an objective. It's really difficult to teach yourself something in a vacuum, since you don't know exactly what you need to learn or why. So have some software project in mind that you'd like to develop, either for yourself, for your family, or for the community. After reading through the books the first time to get a feel for the basics, use that project to guide your deeper learning.
     0Likes 0Dislikes 0Informatives
  • Reply 23 of 63
    Quote:

    Originally posted by Towel

    If you want to learn Cocoa, and don't have any prior C/ObjC/Cocoa experience, I highly recommend a pair of books, one which teaches the basics of Objective-C, the other of which guides you through the nuts and bolts of the Cocoa API:

    - Programming in Objective-C by Stephen G. Kochan

    - Cocoa Programming for Mac OS X by Aaron Hillegass




    Thanks a lot! Funny thing: Those two books were suggested by Amazon when searching for the Objective-C one.



    Quote:

    Originally posted by Towel

    The other thing I recommend to anyone wanting to learn Cocoa is to have an objective. It's really difficult to teach yourself something in a vacuum, since you don't know exactly what you need to learn or why.



    This is so true... not only for learning how to programm thought, but for all other things as well.
     0Likes 0Dislikes 0Informatives
  • Reply 24 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by a_greer

    because once you know the basics, each new language that you learn is, essentially, just different syntax imho.



    That is only true if you're learning similar languages. Most people will stick with C/C++/Objective-C/Java and that's just fine, and the languages are not that different to write even if different things go down behind the scenes. However, it's very different when you jump into languages such as LISP, Prolog, Haskell. You might have no clue about what's going on!
     0Likes 0Dislikes 0Informatives
  • Reply 25 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by RolandG

    I'd like to use an IDE - plain text editors without syntax formating/highlighting become confusing with more complex projects. I am now on a Mac (still OS X 10.2) and would like to use XCode.



    Or you could use a not-so-plain text editor that knows how to do syntax highlighting and a ton of other things.



    Can you use make to automate a build? When you can, there's no longer "pressure" to use an IDE, you can assemble "your own IDE" instead, starting from the editor and make, armed with just a text editor.
     0Likes 0Dislikes 0Informatives
  • Reply 26 of 63
    ishawnishawn Posts: 364member
    Quote:

    Originally posted by RolandG

    - What kind of enhancement do you have in mind for iTunes that would not require the user to trigger it? It usually is a bad idea to develop something that kicks in without the user's knowledge (i.e. spyware, virii, trojan horses).



    Something that I thought would be a good goal to get to is something where at the bottom of the screen is all the song info being size, count, and time of continuous play. I thought something that would be cool to add to it is have it so that you can click on that (Like an invisible field) and it could cycle through other options like maybe artist count, genre count, etc.

    Something simple, but something where I could be like, yeah that's a cool idea....
     0Likes 0Dislikes 0Informatives
  • Reply 27 of 63
    Gon, he's NEW to programming. Don't throw makefiles on him yet. Those should only be used if absolutely necessary, which is like 2% of the time.



    I really recommend learning Objective-C and Cocoa. It's probably the easiest/cheapest way to get started.



    From there, you can check out C++. Objective-C has some nice things (a really smooth syntax for functions) and C++ has some nice things (method overloading, operator overloading, speed, and of course cross-platform compatibility) but neither are perfect.



    I'd stay away from Java. It's not any easier than C++, and the crossplatform thing's sort of a joke. And it crawls.



    You said you already know JavaScript, which means you're like 60% of the way there. Good luck/have fun!



    PS: I wouldn't buy books yet. There's lots of free tutorials around for the basics. When you get to the point where you're really serious, then get a book or two.
     0Likes 0Dislikes 0Informatives
  • Reply 28 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by gregmightdothat

    Gon, he's NEW to programming. Don't throw makefiles on him yet. Those should only be used if absolutely necessary, which is like 2% of the time.



    My last post was aimed at RolandG, not iShawn. When I suggested a "learning plan" to iShawn earlier, I did mention makefiles but I said those would be the logical next step after he already has a working project put together which encompasses many files - in another words, not very soon.



    I think it's a good idea for anyone to understand how the build tools work, before hopping into an IDE. It is my opinion that my own learning was hindered by being boxed in an IDE. I should have learned the basics of build tools, and a decent editor, earlier.
     0Likes 0Dislikes 0Informatives
  • Reply 29 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by gregmightdothat

    I'd stay away from Java. It's not any easier than C++, and the crossplatform thing's sort of a joke. And it crawls.



    Those are half-truths at best. Java is absolutely, clearly easier and more bombproof than C++. In C++ you have the chance to write every memory leak and pointer bug that you can write in C, and then you have the C++ original features which compilers can and often do screw up. I know lots of professional programmers and very few of them can deal with the full C++ featureset with any kind of confidence. Of course you can use it and even earn a living with it without thorough understanding, but then you are coding "C with objects", not using the possibilities of C++, and many gotchas are still waiting for you even if you don't go looking for the difficult features.



    Java, when ran on a good virtual machine with hotspot optimizing, can be as fast as C++ and in any case has been reasonably fast for years. Most of the "slow" reputation comes from Swing UI elements AFAIK.



    A good book is never wasted.
     0Likes 0Dislikes 0Informatives
  • Reply 30 of 63
    toweltowel Posts: 1,479member
    Quote:

    Originally posted by gregmightdothat

    PS: I wouldn't buy books yet. There's lots of free tutorials around for the basics. When you get to the point where you're really serious, then get a book or two.



    You'd be amazed what some public libraries stock.



    Yeah, hold off on buying the books until you're sure you're $50 serious, but at least check out what your library has available. Tutorials won't get you very far.
     0Likes 0Dislikes 0Informatives
  • Reply 31 of 63
    giantgiant Posts: 6,041member
    If the library doesn't have it you can interlibrary loan it. Most libraries offer the service for free or dirt cheap (a couple cents/copy). I always interlibrary loan a bunch of books and then buy the ones that are actually useful. Especially with programming books there are some real useless ones and some real gems, so it's a good idea to try before you buy.
     0Likes 0Dislikes 0Informatives
  • Reply 32 of 63
    Purchase GCC-The Complete Reference by McGraw Hill

    ISBN 0-07-222405-3



    At Amazon:



    http://www.amazon.com/exec/obidos/tg...glance&s=books



    This book will help you understand how GCC works to help you speed up all the annoying times when your builds fail.



    Learning Cocoa: Books



    Top 3 Books listed in the following link:



    http://www.amazon.com/exec/obidos/tg...523049-6488922





    Programming in Objective-C by Stephen Kochan (assumes no Objective-C/Cocoa experience)



    http://www.amazon.com/exec/obidos/tg...88922?v=glance





    Learning C is a must as well. K&R has already been mentioned.



    There are countless books in pdf format available on C and algorithm development, data structures, design patterns and what not.



    GCC has papers and resources http://gcc.gnu.org/readings.html



    Make sure you have the PDFs from Apple



    http://developer.apple.com/documenta...al/ObjectiveC/



    on the Run-time, ObjC Language, etc..



    What none of these books can teach is Discrete Mathematics, Logic, Set Theory, Graph Theory, Algorithm design, etc..





    Expect to fail constantly until stuff starts making sense.



    Expect to read a crapload of documentation and know that Apple's Frameworks provide a massive amount solutions to your needs, after the fact. You may write some classes to fill certain requirements, feel proud only to discover that Apple provides an even more elegant solution, with less code to do that and much more.



    Expect to fail and fail and fail.



    Learning Software Testing is another art.



    Useful tools:



    http://www.sente.ch/software/ocunit/



    Introspection Tools



    http://www.fscript.org/
     0Likes 0Dislikes 0Informatives
  • Reply 33 of 63
    ishawnishawn Posts: 364member
    I should be able to focus on C and start from there (Along with maybe Java on the side) so that I can star understanding how programs work. I am still a little confused about a hierarchy sort of system with languages and I would really understand it if I new how everything worked in a tiered sort of way.



    Like...

    C has Objective-C and C++ and I'm sure tons of more branched off of it but it takes a certain understanding of C to understand anything else... but then I run into things like "Darwin" (Why does the Terminal say this?) Cocoa, and Carbon which (from what I understand) are versions of C?



    I'll do a little googling but if a picture explained how each one is used... I would greatly understand it within seconds.
     0Likes 0Dislikes 0Informatives
  • Reply 34 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by iShawn

    I should be able to focus on C and start from there (Along with maybe Java on the side) so that I can star understanding how programs work. I am still a little confused about a hierarchy sort of system with languages and I would really understand it if I new how everything worked in a tiered sort of way.



    Like...

    C has Objective-C and C++ and I'm sure tons of more branched off of it but it takes a certain understanding of C to understand anything else... but then I run into things like "Darwin" (Why does the Terminal say this?) Cocoa, and Carbon which (from what I understand) are versions of C?




    There is no guarantee that if you know language X, you can (or should!) solve the same problem in the same way in language Y. As an example, in C++ you can do almost anything you can in C, but many things you should not do the same you did them in C, because C++ offers you more advanced tools for the same problem that solve it better. Other languages generally differ from each other more than C and C++ do. Bottom line: don't worry about what is different and what is the same in languages. Just learn one and things will be much clearer.



    When you program, you don't do everything from scratch. You use various libraries and frameworks (nicer word for a collection of related and interoperating libraries) to do things from your own code. Some of the libraries and frameworks might be available to you in source code form. Most are binaries, which you can't touch, but you get the interfaces in source code that you can use in your own code. Cocoa, for instance, is an UI framework and (if I'm not mistaken) you can use its functionality from Objective-C, C++ and Java because Apple has provided interfaces for all those languages.



    As for Darwin, it's the core of OS X, you could even say Darwin is the "operating system". All the graphical stuff lies on top of it.

    What Apple says about Darwin

    Again, don't worry about it.
     0Likes 0Dislikes 0Informatives
  • Reply 35 of 63
    sorry for bringing an old thread alive. and this is my first post, so hi guys!



    i am interested in learning more about programming in Apple environment. i have experience in building business applications java, asp.net, and also in relational database like oracle.



    and i was wondering if:



    a) i can do similar things (build business components) in apple (simple example: an application that queries the database, does some simple calculation, and splits out reports as the end-result)?



    b) does it make sense to do it in apple, or mac os x for that matter?



    c) what exactly is object-c? i have coded in C before. how is cocoa compared to the existing window-based IDE/SDK? i have read some websites about both but dont quite understand.



    thanks in advance for reading my questions. any input is welcomed.
     0Likes 0Dislikes 0Informatives
  • Reply 36 of 63
    Quote:

    Originally posted by iShawn



    C has Objective-C and C++ and I'm sure tons of more branched off of it but it takes a certain understanding of C to understand anything else... but then I run into things like "Darwin" (Why does the Terminal say this?) Cocoa, and Carbon which (from what I understand) are versions of C?




    You need only a rudimentary knowledge of C before you move into anything else. Just learn the typical Hello World, how functions work, and try to start learning about pointers (they're confusing but oh so important), and then move onto C++ or ObjC. Because C isn't object oriented, you'll have to relearn program design and style if you spend too much time with it.



    Don't worry about Darwin, that's part of the operating system and not something you'll need to touch unless you're going to program for Apple.



    Cocoa and Carbon are frameworks (or libraries if you prefer). Cocoa is MUCH MUCH easier. Ridiculously easier. Carbon is targeted towards those who have lots of old code to maintain, which you do not, so I would stick to Cocoa.



    One last quick tip: most/all C tutorials will start you off with text-only programs. In XCode, this is the equivalent of a "Standard Tool" style project. It'll start you off already with a "Hello, World!".
     0Likes 0Dislikes 0Informatives
  • Reply 37 of 63
    Quote:

    Originally posted by hltommy2

    sorry for bringing an old thread alive. and this is my first post, so hi guys!



    i am interested in learning more about programming in Apple environment. i have experience in building business applications java, asp.net, and also in relational database like oracle.



    and i was wondering if:



    a) i can do similar things (build business components) in apple (simple example: an application that queries the database, does some simple calculation, and splits out reports as the end-result)?




    You would need a library that accesses the database. There's some for MySQL, and I'm sure for others as well, but I don't know much about working with databases since I've only done this from Perl many moons ago.



    OS X Tiger is supposed to have a database framework called Core Data built into the OS and freely available to developers, but they're being super secret about this.



    Quote:

    b) does it make sense to do it in apple, or mac os x for that matter?



    You tell me. The tools are there, I'm sure there's companies that could use something like this, but you'd have to find that out yourself.



    Quote:

    c) what exactly is object-c? i have coded in C before. how is cocoa compared to the existing window-based IDE/SDK? i have read some websites about both but dont quite understand.





    Objective-C is an object-oriented varient of C. It has a really nice syntax (in my opinion) but if you already know Java, C++ might be a bit closer to what you know.



    You can also, of course, just keep using Java, and still have access to all the Mac GUI and System libraries.
     0Likes 0Dislikes 0Informatives
  • Reply 38 of 63
    gongon Posts: 2,437member
    Quote:

    Originally posted by gregmightdothat

    You need only a rudimentary knowledge of C before you move into anything else. Just learn the typical Hello World, how functions work, and try to start learning about pointers (they're confusing but oh so important), and then move onto C++ or ObjC. Because C isn't object oriented, you'll have to relearn program design and style if you spend too much time with it.



    I disagree. If you quit C after learning what a Hello World does, and mucking around with a few pointers, it won't do you much good. At the very least, the aim should be to do a small project that requires a data structure like a linked list or tree, and has everything distributed intelligently into more than one file. This requires understanding both of pointers/memory and modularization - the best lessons that C has to offer. If this was a very long term endeavour and the goal was to become an overall good programmer, it would make a lot of sense to carry on with C in bigger projects and learn about toolchains, builds, version management before going into next language... but since the end goal is well defined (graphical OS X software) I'd change languages at that point, if I had started with C in the first place. Java would actually be a good place to start too, since the road to OS X development is shorter from there.



    C's biggest advantage as a learning language is that the libraries are so tiny. You have to learn memory management, you have to learn a tiny bit of input/output handling, and that's it. You never have the illusion the system does not "let you" do something, since you do pretty much everything yourself.



    Object orientation is just a form of modularization. Nothing prevents you from writing object oriented code with C. Nothing prevents you from writing code in Java and C++ that has absolutely no modularization, much less object orientation. In the latter two, though, you might get the illusion that you are writing OO code even when your modularization is actually weak. "It's all in classes, isn't that good enough?"
     0Likes 0Dislikes 0Informatives
  • Reply 39 of 63
    kickahakickaha Posts: 8,760member
    If I may jump in here...



    Decide what you want to learn first. Are you wanting to learn OO? Low level machine programming? Good procedural design? Pick *ONE*, and learn it. Trying to bounce from C to Java to C++ and so on is just going to be a waste of time in the end.



    Why spend your time learning how to create linked lists from pointers in C, if in a month you're going to be using std::vector?



    Why spend your time learning how to model a system in objects, if you're going to end up using raw C, and use files and Makefile for modularization?



    Pick your end goal *first*. If it's Cocoa, then skip as much of C as you can, dive right into Obj-C and grok the objects first. The procedural will come quickly.



    Sorry Gon, while I'm also of the old school that brought ourselves up by our bootstraps (heck, I can still whip up a mean 680000 assembly snippet when I need to ), I'm also an academic who teaches programming and more importantly systems design.



    OO is not just syntactic sugar over procedural, and there actually *is* one thing that you can absolutely enforce in OO that you simply can *not* in procedural in any way I've ever been able to find. (Hint: when does an object become usable?) The conceptual models are quite different *if* one gives each their due, and doesn't try to shoehorn one into the other. They are related, but different, tools.



    Spending time learning how to do modularization and encapsulation in C is *only* useful if you're going to be working only in C. The amount of low-level raw C that one actually needs these days to work effectively in C++ or Obj-C is... minute. auto_ptr and such are taking over, and doing a nice job of it. Telling someone they have to learn how to use printf 'just because' is a waste if they have std::cout sitting right there. Frankly, the two mean just as much (and as little) to the new programmer. They have no baggage coming into it, so why weigh them down?



    No sense forcing new folks to reinvent the wheel just because we did. At that point, it's just hazing.



    And this is coming from someone who is still appalled that most CS grads haven't the faintest clue how a computer works. I came from a physics background, so I started with transistors, then up to CPU design, building a rudimentary 68000 machine on a breadboard, interfacing it with ultrasonic range finders, *THEN* progamming the sucker in raw assembly, *THEN* learning modern computer architecture, and moving into C, C++, Java, Eiffel, and finally into language theory and software engineering research. I firmly believe that the more you know about the entire ball of wax, the better off you are... BUT... you've gotta start somewhere, and if the end goal is to write a Cocoa app, then that's the goal, not a PhD in CS.
     0Likes 0Dislikes 0Informatives
  • Reply 40 of 63
    Quote:

    Originally posted by MCQ

    You can do Cocoa Java programming, if you want... here's a intro tutorial/app:

    http://developer.apple.com/documenta...uid/TP30001111



    If you just want to run through a Java programming book and do examples, then I'd suggest using the Eclipse IDE.




    We'll see how well I am at adaptation. I'll modify this (If I understand it well enough) to be able to transcribe one note to another.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.