Introduction to programming

2»

Comments

  • Reply 21 of 35
    spotbugspotbug Posts: 361member
    [quote]Origanlly posted by irish:

    <strong>However, PB is certainly not a Mac only dev platform. If you notice, it is also great for Java.



    Now to say that it only runs on OSX would be correct.</strong><hr></blockquote>



    The original poster was interested in C/C++/Java.



    [quote]Originally posted by thuh Freak:

    <strong>Some1 said that Project Builder can only make MacOSX progs. I haven't tried it, b/c when i went X i didn intend on going back, but you can make carbon progs (which should work on OS9, and possibly 8.x with carbon extensions).</strong><hr></blockquote>



    Nope. You can write Carbon apps, of course, but PB will only build Mach-O executables (ok, I'm not counting Java here ). You need CFM for Carbon apps to launch in pre-X Mac OSes. So your PB-built Carbon app will only work in OS X.
  • Reply 22 of 35
    [quote]Originally posted by thuh Freak:

    <strong>



    i think rb is bad for learning because, when ur beginning prog'g, u shouldn' do GUI shyt.

    </strong><hr></blockquote>



    Well, the UI is the only thing a prospective user will see, so it is very important that this is done right.



    [quote]Originally posted by thuh Freak:

    <strong>



    theres a lotta under the hood shyt a person should learn.

    </strong><hr></blockquote>



    What exactly is this "shyt" you refer to? REALbasic teaches you just about everything you need to knbow, and it even teaches you more than Cocoa does!



    [quote]Originally posted by thuh Freak:

    <strong>



    plus, apps made with better languages are faster (especially those in procedural c), and can take advantage of lower level things..

    </strong><hr></blockquote>



    REALbasic allows you to do just about anthing you want, with the Declare statement. Yuo can call just about any Toolbox function with it.



    Also, while Procedral may be faster, event-based programs are more responsive to user interaction. Ever try to load a webpage in IE while the mouse is down? It can't be done. Now try it in OmniWeb. See? It works.



    Also, event-based programs are easier to make, because you don't have to check for every possible event that could occur - the environment does it for you.



    [quote]Originally posted by thuh Freak:

    <strong>



    finally, the way my teacher explained it to me when i was learning to prog was: the easier the language the less power it has. and rb is just too easy .</strong><hr></blockquote>



    That would be an opinion. You obviously haven't played around enough with REALbasic, have you? It can be more powerful than C in some cases!



    [ 06-18-2002: Message edited by: graphiteman ]</p>
  • Reply 23 of 35
    thuh freakthuh freak Posts: 2,664member
    [quote]Well, the UI is the only thing a prospective user will see, so it is very important that this is done right.<hr></blockquote>



    yea, but people should know/understand whats actually happening (or what could b happening) in their b4 they put makeup on it.



    [quote]What exactly is this "shyt" you refer to? REALbasic teaches you just about everything you need to knbow, and it even teaches you more than Cocoa does!<hr></blockquote>



    pointers, for 1. admittedly, i haven't done very much in rb (tho i have done a bunch in vb), but i don't think they have any concept of pointers. c-style strings also. a prog'r should know how to use/manipulate a c-string w/o the need for a wrapper class.



    [quote]Ever try to load a webpage in IE while the mouse is down? It can't be done. Now try it in OmniWeb. See? It works.<hr></blockquote>



    that works not because omni is event-based and IE isn't. they are both GUI apps and therefore are event-driven. i don't actually have their source, but i think that the reason that omni works thru menu-holds is because it is threaded better. so, it works b/c of unix's great threading capabilities, not event-driving. by-the-by, i think omniweb is made in objc, not rb.



    also, procedural programming doesn't mean not event-driven. event-driven progs can b written w/o OO aspects. also, procedural-c progs can respond only to the events they care to. they can sieve out what should be handled by some1 else or the OS.



    it seems we've taken this thread out of its intended area tho.
  • Reply 24 of 35
    amorphamorph Posts: 7,112member
    [quote]Originally posted by thuh Freak:

    <strong>finally, the way my teacher explained it to me when i was learning to prog was: the easier the language the less power it has. and rb is just too easy .</strong><hr></blockquote>



    I can't speak one way or the other for RealBasic, but this statement is completely wrong. All powerful languages have their dark corners and arcana, but some are much, much easier to learn than others. Millions of lines of Python code are used to handle enterprise- and military-grade CORBA applications, for example, and Python is a cinch to learn next to the gratuitously obtuse, designed-by-committee sprawl that is C++. Similarly, here in the hospital, there are lots of old Macs running HyperCard stacks that allow researchers to control, and read results from, sensitive, custom instruments. Languages don't make toy applications; programmers do.



    More on topic, C is not the best language to start with, and although it is an excellent reference and a great tutorial for experienced programmers, The C Programming Language is not written for or suited to newbie programmers. Dave Mark's Learn C on the Macintosh got good after a few editions, but I'm not sure if it's been updated for Carbon. O'Reilly's Practical C Programming is good, if dense. Avoid anything by Herbert Schildt, written "for Dummies," or which promises to teach you something like C is a set number of days. It will take you months, if not a solid year, to get really comfortable with C. It's a small, elegant language, but in some areas (pointer arithmetic, declaration and expression syntax and semantics, advanced string manipulation, preprocessor wierdness) it can get hairy quickly. Once you're at least conversant with C you can also branch to Objective-C, which is an elegant OO language used by a lot of Cocoa programmers.



    I think that learning something like Python or Ruby would be better. They're clean, clear, and object-oriented, so you can concentrate on the things that really matter for new programmers (code organization, design, algorithms and data structures) without getting tangled up in minutiae and low-level details, and once you're comfortable in those languages you can apply what you've learned to any modern language (including C++, which you should eventually learn just because everyone uses it). Java isn't a bad choice either, although it's not quite as well-designed as the former two.



    O'Reilly has Learning Python, which is excellent. Unfortunately, they haven't published a corresponding book for Ruby yet, which is a strike against that language.



    Another option is AppleScript, which is OO in its own idiosyncratic way. On OS X, it will allow you to build (OS X) applications quickly that can leverage the power of other applications or automate tasks, but the techniques you learn don't apply as directly to other programming languages.



    [ 06-18-2002: Message edited by: Amorph ]</p>
  • Reply 25 of 35
    [quote]Originally posted by thuh Freak:

    <strong>

    yea, but people should know/understand whats actually happening (or what could b happening) in their b4 they put makeup on it.



    </strong><hr></blockquote>



    Maybe, but users will not judge your application based on that. They judge it on how easy it is to use.



    [quote]Originally posted by thuh Freak:

    <strong>

    pointers, for 1. admittedly, i haven't done very much in rb (tho i have done a bunch in vb), but i don't think they have any concept of pointers. c-style strings also. a prog'r should know how to use/manipulate a c-string w/o the need for a wrapper class.

    </strong><hr></blockquote>



    Pointers: REALbasic doesn't really have a need for pointers, but you can create them with MemoryBlocks. If you need to pass a pointer to another method, just declare it ByRef.



    CStrings: REALbasic has an insentric (sp?) String data type that is not object oriented. What is so great about a CString?



    Also, I should point out, that though RB is similar to VB, RB is a lot more object oriented than VB is. Maybe you should download the demo and write an app with it. Then write the same app in C/C++. Tell me how long ewach takes, from a clean, empty project file.



    [quote]Originally posted by thuh Freak:

    <strong>

    that works not because omni is event-based and IE isn't. they are both GUI apps and therefore are event-driven. i don't actually have their source, but i think that the reason that omni works thru menu-holds is because it is threaded better. so, it works b/c of unix's great threading capabilities, not event-driving. by-the-by, i think omniweb is made in objc, not rb.

    </strong><hr></blockquote>



    True, but I was pointing out a flaw in procedural code.



    [quote]Originally posted by thuh Freak:

    <strong>

    also, procedural programming doesn't mean not event-driven. event-driven progs can b written w/o OO aspects. also, procedural-c progs can respond only to the events they care to. they can sieve out what should be handled by some1 else or the OS.

    </strong><hr></blockquote>



    RB and Cocoa does all of this automatically, without having to use a sieve.



    Also, procedural programs must implement an event loop to catch evnets. While, admittedly, RB and Cocoa do this, it is hidden from the programmer.



    [quote]Originally posted by thuh Freak:

    <strong>

    it seems we've taken this thread out of its intended area tho.

    </strong><hr></blockquote>



    Perhaps we have.
  • Reply 26 of 35
    cooopcooop Posts: 390member
    What can be used to compile Python or Ruby?



    I purchased Absolute Beginner's Guide To C by Greg Perry and C for Dummies. I usually loathe the series because it tends to leave me wanting more but I bought one because I thought I needed something on that level, though I haven't started it yet and might return it. I purchased CodeWarrior and downloaded Apple's development tools also and am spending every waking moment trying to absorb as much as I can.



    I'm planning to move on to Java and AppleScript before hitting C++ but this is a lot of foward-thinking on my part. I also heavily considered RealBasic but I chose C because I want to learn something a tad more standard and something that will likely be taught in college computer science courses. I'll play around with the GUI stuff after I get more comfortable with coding, similar to how I moved to GoLive only after learning the ins and outs of HTML.
  • Reply 27 of 35
    gilboitgilboit Posts: 6member
    I'd like to suggest something to all



    would it be possible to make a list of languages and their proper uses or ideal uses and possibly provide links. I know for sure that as beginners in programming we would appreciate it. Please provide details on how the language is used and what for, along with any other info. Please don't make it a "mine is better than yours or that sucks because of this" type deal. All we need is to be informed about the breadth of languages and who is using which for what and pro and con arguments based on how industry sees and uses it.



    This would be a truly great help for all of us. One more thing, maybe there can be categories of software programming/engineering ( like, AI, Robotics/Defence/Interfaces/OS-applications etc) and then have the associated languages listed under that. I know this a lot to ask but speaking for myself, I would find this VERY helpful. Hope someone can accomodate this request for new users. Thanks to all for any help -jt
  • Reply 28 of 35
    amorphamorph Posts: 7,112member
    [quote]Originally posted by cooop:

    <strong>What can be used to compile Python or Ruby?</strong><hr></blockquote>



    python and ruby. You get the runtime with the language. Incidentally, both are freely downloadable, not commercial.



    Note that both are not static, compiled languages in the way that C and C++ are. They can be interpreted or compiled to bytecode, so like Java and JavaScript Python and Ruby applications are portable to any system that the runtime has been ported to (which is almost all of them, especially in the case of Python) without a recompile.



    [ 06-18-2002: Message edited by: Amorph ]</p>
  • Reply 29 of 35
    Cocoa - Uses the Objective-C language

    Apple's new Object-oriented language. Can create apps ranging from simple utilities to full fledged commercial products. Fairly easy to learn.



    REALbasic

    Alternative environment that can compile apps for OS 9, OS X, and Windows. Focus on graphical interface. Easy to learn.



    C++

    Older language, but very common. Runs on just about any computer, although you must use routines for the target OS. Steep learning curve, but taught at many schools (on PC's though).



    [edit: formatting was screwing the whole page up]



    [ 06-18-2002: Message edited by: graphiteman ]</p>
  • Reply 30 of 35
    thuh freakthuh freak Posts: 2,664member
    i couldn't possibly come up with all kinds of categories for ya (maybe smoe others can help me out), but heres some:

    games. by, and far, c (or cpp) is used for games. c and cpp are not interchangeable and i don't mean to portray them as such, but they are the most common for games. the reason c is used is because games are very processor intensive, and (virtually?) nothing makes faster executables than c. game prog'g is what i do mainly (aside from my 9-&gt;5). as far as links go, <a href="http://www.gamedev.net"; target="_blank">www.gamedev.net</a> and gamasutra.com are great for game prog'g. they aren't specific to any language tho (but they do have a peecee leaning).



    c and cpp are not only for games. c is (i believe) the most well-known prog' lang, and used in various apps.



    rb (realbasic) could be used to make quick 'n' easy GUIs over src if u can quickly make a plugin out of it (or somehow add it into an rb project; i'm not a rb expert).



    objective-c (objc) has a pretty small following outside of apple (and macx). but it is very good for making cocoa (mac os x) programs.



    java is also good for macx progs, but personally i dont use it. if ur making a prog that has to be multi-platform java is definitely something you should look into. apple's cocoa libraries are (i think) only accessible in java and objc.



    i think fortran was originally developed to be used for science apps. i dont know it at all tho, so i can't really comment further.



    and for all kinds of prog'g i suggest more advanced and intermediate prog'rs to goto sf.net (sourceforge). beginners may find it daunting, as its not really a place to learn a lang. but, they have 100s (1000s?, more?) of open-source programs/libraries/everything. full-src. nothings better than full src.



    haq the planiht.
  • Reply 31 of 35
    Assembly Language



    What it is:



    Assembly language translates one-to-one into the binary your computer actually runs, and allows you to exploit all public features of a processor and other hardware (and some hidden ones).



    Assembly isn't for beginners: it doesn't shield you from the implementation of your system. Different processor families use different assembly languages, and different members within a processor family have different features. For instance, a G4 has AltiVec instructions, but a G3 doesn't. Also, the same instruction may vary in speed across these different family members -- plus, they don't always get faster! :eek:





    Ideal uses:



    Assembly language is useful in creating low level parts of operating systems. Also, coupled with an intimate knowledge of the processor you intend to use it on, it can be used to get excellent performance from critical applications -- such as games.



    However, the biggest speed boosts you can get in programming are from using better algorithms. Also, unless you know a lot about what you're doing, assembly language just might not be worth the time spent coding. So why learn it?



    For most programmers, assembly language's real use is in uncovering how things really work on their computer. A number of questions curious programmers might ask themselves can be answered by learning assembly:



    - What happens when I compile a program?

    - How does hardware interact with an operating system?

    - How does protected memory work?

    - What is the difference between object-oriented code and procedural code at the processor level?
  • Reply 32 of 35
    wormboywormboy Posts: 220member
    Perl

    What is Perl?

    From the Perl FAQ



    Perl is a high-level programming language with an eclectic heritage written by Larry Wall and a cast of thousands. It derives from the ubiquitous C programming language and to a lesser extent from sed, awk, the Unix shell, and at least a dozen other tools and languages. Perl's process, file, and text manipulation facilities make it particularly well-suited for tasks involving quick prototyping, system utilities, software tools, system management tasks, database access, graphical programming, networking, and world wide web programming. These strengths make it especially popular with system administrators and CGI script authors, but mathematicians, geneticists, journalists, and even managers also use Perl.



    The thing I've always liked about it is that it lets you do things the way that you want to do it. Also, because it compiles at runtime, you get stuff done quickly. If you really know nothing about programming, an interpreted scripting language like Perl or Python might be a good place to start. You don't need a compiler at all. And if your using a Mac with OSX you already have Perl!
  • Reply 33 of 35
    gilboitgilboit Posts: 6member
    thanks for all the cool stuff so far, but is it possible that there are no Mac using roboticists anywhere?
  • Reply 34 of 35
    you may be interested in the

    Open University's Computing: an Object oriented approach (course code M206)



    <a href="http://www.open.ac.uk"; target="_blank">www.open.ac.uk</a>
  • Reply 35 of 35
    rick1138rick1138 Posts: 938member
    As I said go to <a href="http://www.spiderland.org,all"; target="_blank">www.spiderland.org,all</a> Mac and Linix,great stuff,Jon Klein is an incredible programmer.



    Another great language is php-simple fast flexible and very powerful,the whole language can be learned in a couple of hours if you are familiar with programming.Other languages that haven't been mentioned are the logic programming languages,such as Prolog and LISP,much different than imperative languages.
Sign In or Register to comment.