programming help question

Discussion in 'Mac Programming' started by austin908, Apr 19, 2009.

  1. austin908 macrumors newbie

    Joined:
    Apr 19, 2009
    #1
    Hi,
    I was wondering when I
    move to mac programming should I get a MacBook and keep my pc? and is there any way I can get a free macbook as a mac programmer? How long should I spend on c, c++, and c# before moving to mac programming? When I program cocoa will I still program c or any of the c's?
    austin908 is offline Reply With Quote
     
  2. WhiteRabbit macrumors newbie

    Joined:
    Jan 11, 2005
    #2
    A PC is not necessary for Mac programming.
    If you are employed, you employer probably should provide you with a Mac if they expect you to churn out code. Otherwise, you'll need to invest in your own needs.
    Cocoa uses neither C++ or C#. You need not learn either.
    Only a moderate knowledge of C is required.
    Objective C is not backward compatible with C.
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    Objective-C is a superset of C, so everything you can do in C you can do in Obj-C.
     
  4. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    I'll put it a little bit stronger: Take any C source file, rename it from "xxx.c" to "xxx.m", and you have a perfectly fine Objective-C file. Take any C++ source file, rename it from "xxx.cpp" to "xxx.mm", and you have a perfectly fine Objective-C++ file (the latter is handy if you have an existing C++ code base and want to add a few Objective-C things to it).
     
  5. WhiteRabbit macrumors newbie

    Joined:
    Jan 11, 2005
    #5
    I meant it the other way round. Obj won't compile as C code to answer my interpretation of the question: will my code still work on pc.
     
  6. austin908 thread starter macrumors newbie

    Joined:
    Apr 19, 2009
    #6
    programming

    Hi,
    I was wondering whats the point of learning all the languages like c,c#, c++, python, objective-c, objective-2 2.0, coca, scheme, hasketall. Why isnt there just one language that can do everything. Why should I learn whole different languages?
    Well I am only 12 years old so I have a lot of time to learn them. If I want to be a successful programmer and start my own successful company one day. If I am programming in c then cocoa aren't I going to forget things. why are there so many c's. Why not just one c???
    I hope someone can help me?


    Lastly, if I am going to learn everyone of those then should I buy books. I already have a lot of books covering c, c++, ect. Should I get the biggest book? What if I get a small one? THen I wont know all about it?

    Thank you!!!
     
  7. Chirone macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #7
    one you've learned one the rest are easy.

    the reason why there are so many is because most of them are built for different things

    also, people who weren't happy with how you would code in c++ said 'you know what? i'm going to do something better/worse' and BAM you have objective C

    some languages build things that are cross platform like java and python, while others are just specific to some platforms like objective c.

    c is the original c language, c++ introduces object orientated concepts, objective c is there because some bright spark in mac said 'hey lets be different and make our own little world here and make our language only apply to macs' (mind you someone in microsoft said the same thing), and c# is microsoft's counter attack to java.
    java is sun's solution to cross platform languages
    python is just some random scripting language that people are able to pick up easy



    why don't we all just speak one language? why do we have to learn all languages to understand everyone?
    why do we have so many burger chains? why not just stick with one?
    why are there so many brands of weedkiller? surely one is enough?
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    Machines do speak one languages, it's known as machine language and looks like this, 10001110011101010111010101. The 1s and 0s are actually on and off states which are transmitted as electron signals in the hardware of computers. (All programming languages eventually turn into this format during execution.)

    But as you might expect, it's very hard to code at this level, which is why assembly language was created, but it was still hard to use. So, higher languages were created, and higher ones. There's different languages because different languages are trying to make certain tasks easier. Chirone's post fills in other aspects of this.

    As for books, the biggest isn't always the best. Also, you likely won't ever need all aspects of any language. Read reviews of books to get a good idea of what the book does well. Practice counts more than just reading books.
     
  9. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #9
    My preference is to find the smallest book that contains al the information you need. Many books use to many words. The best writers can say a lot with few.

    What you need to learn is "programming" that means solving a problem by breaking it down into smaller problems and continuing this until you can write a few lines of code. Learning to think in terms of objects and how they interact and designing systems that are simple and easy to maintain is what you need to learn.

    What we call "languages" realy aren't. They are just variations in syntax. C++ and Perl are not that different. Once you learn to write in one the other is very easy. The use of the term "language" is well, we are stuck with it now, but it is really not coect. C++ is not like learning Spanish.
     
  10. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #10
    You have PLENTY of time to learn as many languages as you might like. There's not really good metaphors to other things, especially "real world" examples. I think of programming languages as tools, and some are a better fit for some problems than others.

    What you really have to worry about learning will apply to any languages you work with. Those things are algorithms, computability of a particular problem, breaking down a written problem specification into easily implemented units, managing resources, clearly communicating your ideas to yourself and others through in-code and separate documentation, etc. You have to deal with these things in every language, you'll need to apply them in practically every program you write, and you'll never stop learning to do them better (if you do, you're doing something wrong).

    The real problem right now is that all of the "other stuff" is not that fun when you're starting out. It could kill your interest in programming if you get bogged down in it without seeing any real results. What that means is right now you should probably pick one language, and learn a little bit about it and start writing a few simple programs and see what you can do. As you continue to learn, and branch out to bigger, more complex problems, then you might need to start spending time on the theory so you're able to tackle the larger problems in a better way.

    On the note of theory, *any* programming language that is turing complete can express the same thing. What that means is that you CAN solve most any problem with any language. Understanding that, you can step back from some of the ruts people fall into, arguing what language is better, and look more objectively at what sort of problems a particular language can solve more quickly, efficiently, etc.

    One final thing is some minor corrections to some things that Chirone said. His intentions were good, but some of the details were a bit off.

    Objective-C was conceived at around the same time as the Mac was released, completely independently. It wasn't used on the Mac until OS X in 2001, nearly 20 years later. It is certainly most widely used on the Mac, but it's had a longer history apart from the Mac than it has with it.

    The other thing is that Python is definitely not "a random scripting language". Its third major version was released recently, but it's been around for nearly 20 years. Even though I don't have a lot of experience with it, it has great documentation that makes it (to me at least) very accessible.

    The rest of the descriptions might have been a bit over-simplified, but weren't inaccurate. Note that this isn't meant to criticize Chirone, I just didn't want new-comers being negatively influenced against a particular language by incomplete information.

    -Lee
     
  11. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #11
    The simple answer is no. There are two more complicated answers, and they are intertwined:

    The first is that when you write a program for any platform that consists of more than just a simple command-line program then you use libraries that are platform-dependent. On MacOS X these are things like Carbon or Cocoa (an others like Foundation, CoreFoundation, QuickLook, etc...), on Windows there are others (Win32, WinForms, etc...), and on linux still others. These are generally non-portable, so you have to be on the proper platform for what you are working on.

    The second part of the answer is that there is an Open-Source project that is similar to Apple's frameworks (since it is based on the same NeXT frameworks that Apple's are). For some purposes you can take much of your code from MacOS projects, and easily translate it to use those frameworks. However, there are a of things that are not ported, and a I am not sure how well it works on Windows.
     
  12. austin908 thread starter macrumors newbie

    Joined:
    Apr 19, 2009
    #12
    Hi,
    This guy and me want to create this computer based off Archy. Check out these two websites -http://en.wikipedia.org/wiki/Archy-http://web.archive.org/web/20080107203731/rchi.raskincenter.org/demos/zoomdemo.swf We were going to create it after college so we would know how to create it and we would already be in college. But if I we want to build it we probably will have to now. nd we want to make the machine as cheap as possible, we have 2 choices for an OS if we don't want to write a new one.
    Windows CE, or QNX.And, QNX seems stable. Should we start building it now? and what would we have to learn? or should we focus on school and go to Standford to learn cs?

    Thank you hope you can please answer

    Hey,
    I am 12 years old and I want to go to Standford for cs and become a programmer. After I graduate I don't want to work for some big company. I want to be able to create my own company with my own ideas. What would be the best way to get to that?

    Hi,
    I was wondering which computer languages I should learn first and in order from first to last. I am 12 years old and want to become a programmer and create some of my ideas. The languages I have heard are good are- c, c++, c#, objective-c, cocoa, unix-y type language,Python, Scheme or Lisp,Haskell. What programming languages should I learn now before I go to colledge for a cs. and any info for me would help to!

    Thank you so much!!!!
     
  13. aaronw1986 macrumors 68030

    Joined:
    Oct 31, 2006
    #13
    First of all, why did you start 3 seperate threads with the same title, but slightly different questions. Just put them all in 1. You don't need to know languages before college, but you would be at an advantage. The ones I've used most have been Java, C, Scheme, MIPS
     
  14. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #14
    Since this is the only of the 4 related, and identically titled threads with an existing response, hopefully people will stick to this one. You can add additional information or start separate, more sensibly titled threads if necessary.

    I always say start with C. Others think its easier to start with something "newer" like Python. As was stated in your first thread, the language syntax is much less important that the ideas. Programming languages just allow you to express logic. They can pretty much all express the same thing (see Turing Complete). So really, you just need to pick one and get coding. You're not going to pick the "wrong" language and be crippled forever as a programmer.

    -Lee
     
  15. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #15
    I wish I had a computer at age 12 when I wanted to start programming : /


    Like others have stated there is no wrong language but I would suggest starting with C, Java, or Python. (Python will probably get you results the fastest).

    Once you learn one language its easy to switch to others. The concepts remain the same its just the syntax that changes. I would not suggest C++ as a starter language however. It can get messy very fast and takes a long time to become proficient at.
     
  16. austin908 thread starter macrumors newbie

    Joined:
    Apr 19, 2009
    #16
    so should I just learn like the c,c++, and c#- then learn other languages in colledge? like mac programmer
     
  17. aaronw1986 macrumors 68030

    Joined:
    Oct 31, 2006
    #17
    Well you have like 6 years, so I don't think you'll have trouble. Sure, start with C.
     
  18. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #18
    Objective-C was developed completely independently of C++. It is mainly inspired by Smalltalk. The first implementations were available at about the same time or earlier than C++ implementations.
     
  19. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #19
    Python or Visual Basic would actually probably be a better start then a C language or Java. Reason being is you will see results faster and not get bored and frustrated. When you see results, you program more, thus gaining more practice etc etc.

    If you start out with something like C++ you will probably get bored as soon as your out of the basics thus killing the fun that programming becomes.

    I started out with X86 assembler, THAT is not much fun.
     
  20. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #20
    I'm glad to see they've merged some of these threads. It keeps things a bit more tidy.

    One suggestion I might make is to work on developing your critical thinking and logic skills. This can be done without needing to know any programming languages at all, but will really help you down the road. Things like strategy games, logic puzzles, riddles etc. will indirectly help a lot with learning programming skills. Also, make sure to study hard in Math/Science and English (being able to communicate/organize your ideas and to write well are crucial skills you will need).

    As far as the language question, I can see it from both sides. Lee makes some good arguments for going for straight C, but I think the Python route may help with teaching basic programming concepts without as much friction from the syntax. I think if you were older, I would be more inclined to suggest C.
     
  21. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #21
    I generally advocate straight C when someone wants to "program the Mac", and is planning to learn Objective-C, then Cocoa, etc. because I think the understanding of pointers, control structures, etc. is a real boon. Others like Steve Kochan and many on this board disagree on this being a necessary step (and Steve is a published author with popular books, and I am not), and i'm sure it's possible to become proficient in Objective-C without learning C first.

    However, in this case the OP said they want to program. They just need an outlet for their ideas and expressing them in code, and want to know how to "get into" programming. For this case, my biggest concern would be seeing results fast and avoiding frustration when it comes to the programming language, but like myself and others have mentioned earlier, problem solving, logic, algorithms, etc. are what you're really going to carry with you forever when programming, any particular language syntax is just minutiae.

    With that said, Python seems like a nice place to start these days. It seems like you can focus less on resource management, less time on building your own data structures, and more time solving problems right off the bat. The documentation that I've read also seems well-written and clear, which I think is very important for a beginner.

    To reiterate a post earlier, though, don't stress over the language. Pick one and start coding. There's not a ruinous choice that will cause some irreversible damage. The worst thing a language could do at this point is stunt your interest, which is why perhaps something as "hard" as C might not be best. C punishes you for your mistakes in sometimes mind-bending ways, and as such it might be best to keep in on a list of "will-learn" languages, but start out elsewhere.

    Note that I have only mentioned a couple of languages to try to keep things simple. If you want to start with a functional language, scheme/lisp, haskell, etc. are fine choices (though python also supports functional constructs). If you want to start with C++, no problem. I would personally try to progress though the iterative features of a language first, then deal with OOP, then move to functional features or a functional language. I really only recommend this because it was the way i approached things and it "made sense" to me. Starting functional may have been helpful in the long run, but it seemed "hard" when it was introduced to me and that may have served as an early deterrent.

    -Lee

    EDIT: After looking back over the 3-4 things merged into this thread, a lot of questions centered around education in CS in the future. I am biased, as I studied CS and think it was a very positive experience. With that said, you can program without studying CS. However, a degree gets your foot in the door a lot of places. You stated that you want to start your own company, which is great, but you'll need capital to do that and if you plan to build that capital yourself you're going to need to work for someone else for a while. Along with the benefit of not having your resume thrown out some places because you don't have a degree, studying CS gives you a strong grounding in the theory behind everything you do, and how computers work. I think this is invaluable, but it can certainly be acquired outside of academia. As an aside, i think the school you're intending to reference is Stanford, http://www.cs.stanford.edu/.
     

Share This Page