PDA

View Full Version : Very first language.




redking31591
Jul 3, 2009, 11:57 PM
I needed a summer project and I decided to learn my very first computer language. I picked up a teach yourself C++ book at the bookstore. Was this a bad move should I have learned something else first or was this a good move just to dip my toes into writing programs? I have no aspirations to be a dev I just wanted something new to do and maybe help me with college math. Of course I have a mac. Would it have been better to have started with C or Objective-C or was this a good jumping off point?



chrono1081
Jul 4, 2009, 04:12 AM
C++ is generally seen as not the best choice for a beginner. Reason being is it takes a long time to be able to do anything useful and there are a million pitfalls along the way. Programming can get discouraging if you can't see results in the beginning.

Also it depends what you want to learn to program as well (games, etc). Python is great for a beginner. Java is good for beginners as well.

richard.mac
Jul 4, 2009, 04:22 AM
Java is easier than C which C++ is an enhancement on.

Jayomat
Jul 4, 2009, 04:49 AM
learn JAVA

cube
Jul 4, 2009, 04:51 AM
http://htdp.org/

GorillaPaws
Jul 4, 2009, 06:17 AM
Based on your stated goals, it sounds like either Java or Python would be good choices. Good luck, and have fun.

lazydog
Jul 4, 2009, 06:43 AM
If you're interested in maths then you might find something like Maple or Mahematica more rewarding and useful. Both of these have their own programming language too.

b en

redking31591
Jul 4, 2009, 04:11 PM
So would I be okay to start with say Python and then move on to C++? I have maybe a future goal of iphone development but I am in no hurry to get there. I just kind of want to know how programs work. So would this be a good route
Python/Java to C++ to Objective-C to Cocoa? I just don't want the book I bought for $35 to go to waste. Also what would be the best language to first learn on windows xp. My younger brother wants to learn some language but he uses windows.

miles01110
Jul 4, 2009, 04:17 PM
So would I be okay to start with say Python and then move on to C++? I have maybe a future goal of iphone development but I am in no hurry to get there. I just kind of want to know how programs work. So would this be a good route
Python/Java to C++ to Objective-C to Cocoa? I just don't want the book I bought for $35 to go to waste. Also what would be the best language to first learn on windows xp. My younger brother wants to learn some language but he uses windows.

That would work. Generally languages fall into one of two broad categories: compiled and scripting languages. Compiled languages like C, C++, etc tend to be more "powerful" and robust, but scripting languages (perl, tcl, etc) are, in my opinion, more intuitive when you're first starting out.

The more important thing is to learn the general structure of programs and the methodology. Once you've got that down it's just a matter of adjusting syntax to fit whatever language you're working in.

redking31591
Jul 4, 2009, 04:24 PM
That sounds good. while I said I don't want to be a full blown dev, i don't plan to quit at the end of the summer and I plan to continue this through college and on for fun maybe write a few basic programs. thats why I want to learn cocoa since thats a primary language for macs. I also figured since Cocoa is based on objective-c that learning C++ before objective-c would be easier since I have read they have similarities but that c++ is easier but that it isn't hard to jump from c++ to objective c

Eldritch
Jul 4, 2009, 05:15 PM
Personally, I would go straight to Objective-C and then to C++. I found that I got a much better grasp of OOP this way than the other way around.

cromwell64
Jul 4, 2009, 06:03 PM
That sounds good. while I said I don't want to be a full blown dev, i don't plan to quit at the end of the summer and I plan to continue this through college and on for fun maybe write a few basic programs. thats why I want to learn cocoa since thats a primary language for macs. I also figured since Cocoa is based on objective-c that learning C++ before objective-c would be easier since I have read they have similarities but that c++ is easier but that it isn't hard to jump from c++ to objective c

There are certainly similarities between the two, but I would recommend just going straight into objective-c, especially if you would like to eventually create a few iphone or mac apps.

Once you learn one programming language, picking up others is usually fairly easy. If you are starting with C++ and then move to Objective-C, some of the object oriented syntax might look strange or seem hard to grasp at first, even though most of the syntax is pretty similar.

redking31591
Jul 4, 2009, 06:52 PM
There are certainly similarities between the two, but I would recommend just going straight into objective-c, especially if you would like to eventually create a few iphone or mac apps.

Once you learn one programming language, picking up others is usually fairly easy. If you are starting with C++ and then move to Objective-C, some of the object oriented syntax might look strange or seem hard to grasp at first, even though most of the syntax is pretty similar.

Well I was planning on switching to python as my first language so you think I should go python to objective-c to c++ right? Just want to know if I should return this book I got the other day. I have read that it takes about a month or two to learn python so if I went to C++ i would keep the book but if I went into objective-C I would return it or should I just keep it no matter what so I don't have to re-buy it. Is there even a point in learning c++ after objective-c and am I better giving the book to my brother who wants to learn on windows?. I'm not really in a hurry to write mac apps, I just want to take a nice and relaxed approach that can function as a hobby throughout college.

Also how hard is the jump from objective-c to cocoa and cocoa touch?

admanimal
Jul 4, 2009, 10:00 PM
Also how hard is the jump from objective-c to cocoa and cocoa touch?

Cocoa and Cocoa Touch are Objective-C frameworks, not languages on their own. If you know Obj-C, using them is just a matter of understanding the design patterns they follow to and being able to look up the correct classes/methods to use in the documentation.

Objectivist-C
Jul 4, 2009, 11:39 PM
I liked Learn C on the Mac, it has followup books for Obj-C and Cocoa / Cocoa Touch as well.

cromwell64
Jul 5, 2009, 05:57 PM
Well I was planning on switching to python as my first language so you think I should go python to objective-c to c++ right? Just want to know if I should return this book I got the other day. I have read that it takes about a month or two to learn python so if I went to C++ i would keep the book but if I went into objective-C I would return it or should I just keep it no matter what so I don't have to re-buy it. Is there even a point in learning c++ after objective-c and am I better giving the book to my brother who wants to learn on windows?. I'm not really in a hurry to write mac apps, I just want to take a nice and relaxed approach that can function as a hobby throughout college.

Also how hard is the jump from objective-c to cocoa and cocoa touch?

If it were me, I would just start out going straight for C, then any other language you want to pick up will seem like a breeze since most will use a C-style syntax. I think that if anyone really wants to learn to program, C is easily one of the best foundations. Objective-C is essentially C with some extensions added to it, and as the previous poster noted Cocoa is a framework built with Objective-C. So if you want to eventually use Cocoa, then definitely go straight for C or Objective-C.

Not Available
Jul 6, 2009, 07:25 AM
I find C++ to be an easy language if you've got the right material. I, for one, am using Brian Overland's C++ Without Fear (http://www.amazon.com/Without-Fear-Beginners-Guide-Makes/dp/0321246950/ref=sr_1_1?ie=UTF8&s=books&qid=1246882679&sr=1-1). It's probably the most basic and gentle introduction to the language. It teaches you more of the basic PROGRAMMING concepts, instead of getting into C++ specific language features.

Next, you could go for Bruce Eckel's Thinking in C++ (http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html), which has two volumes, teaches you many advanced concepts, and probably the best of all, it's FREE :)

And of course, Bjarne Stroustrup's The C++ Programming Language (http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_1?ie=UTF8&s=books&qid=1246882872&sr=8-1).

But if you want to see results fast, I'd say web programming is the best fit. You'll spend some time (the more the better) on HTML/XHTML and CSS, which are not programming languages, but you'll get to JavaScript, PHP and SQL, which will give you a gentle introduction to programming.
The main advantage is that you will see how your web pages evolve from plain HTML, to fancy CSS and AJAX effects, to your own server-side scripts.

I've also heard on other boards that your book has many wrong lines of codes and so on.

Howiieque
Jul 6, 2009, 07:59 AM
c is a subset of objective-c
so learning c from the beginning is a good idea
pick this: C Programming: A Modern Approach, 2nd Edition

and then i think objective-c is much easier than c++

Duke Leto
Jul 6, 2009, 08:20 AM
Don't stress too much, though, it really is not *that* important. Personally, I hopped around randomly. I started with VB, then BlitzMax, then Actionscript, then Java, then C++, then finally ended up in Objective C.

Each language has a different feel, and each has its own advantages. However, for math, you can make simulations in Java by using Greenfoot, solve problems with C++ by making a command line tool, or make a simulation app in Objective C.

Personally, I enjoyed my time with C++. I found it interesting, and it was a tool for me to solve math problems. For example, you could make a simulation of water running through cups with holes. (User sets volume and flow rate, and the program tells you how much volume is in each container, or if one overflowed ... etc.)

lee1210
Jul 6, 2009, 08:26 AM
Sometimes when this question gets asked (which is about 1-2x/week), people just say to search the forum and read the guides linked at the top. Every once in a while, everyone jumps in and restates what has been said many times before.

As far as I'm concerned C->Objective-C is best, but it really doesn't matter. Just get programming. Don't spend a lot of deciding what to start with, you're just wasting time that you could be learning. You're not going to be eternally, irreparably crippled by picking a particular language (recovering from Fortran or BASIC might take some time, but i believe it's possible).

Just choose one and go. When you have questions, ask. Good luck!

-Lee

GorillaPaws
Jul 6, 2009, 09:20 AM
Sometimes when this question gets asked (which is about 1-2x/week), people just say to search the forum and read the guides linked at the top. Every once in a while, everyone jumps in and restates what has been said many times before.

I agree in general, but the OP's situation is a bit different than most:
...just to dip my toes into writing programs? I have no aspirations to be a dev I just wanted something new to do and maybe help me with college math.

Usually, the question is more about how to get started writing Cocoa apps. From everything I've heard about Java and Python, I think either one would be a great place to start for someone just looking to learn fundamental programming concepts in general and don't really have any aspirations to learn Cocoa.