Register to reply

Did I make the right choice?

by jbmiller
Tags: choice
Share this thread:
jbmiller
#1
Apr29-12, 11:11 PM
P: 122
Hey everyone.

I recently decided which language I wanted to start programming with, C, and I also bought a book for guidance/referece. http://www.amazon.com/gp/product/067...ls_o00_s00_i00

I have never programmed before and after doing an extrenious amount of research I have concluded that C would be the best language to start with. Also that the book would be the best to have bought for a guidance/reference.

I was wondering if I had made the right choice on starting out with C and buying that book.

Thanks in advance!
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
hamsterman
#2
Apr30-12, 12:19 AM
P: 74
The book looks okay from what amazon allows to skim through and C is definitely a good language to know. Note though, that when you're learning C, you will need to know more about the internal details than you would in, say Java. It can be a pain, unless you enjoy it.
jbmiller
#3
Apr30-12, 12:29 AM
P: 122
I'm not too worried wether or not its a pain. I've done a little with Python and I've found that I really enjoy programming.

Once I become really good with C what would I be capable of doing? As in how will it benefit me and what exactly is the point of doing it?

Adyssa
#4
Apr30-12, 03:44 AM
P: 188
Did I make the right choice?

You can do ANYTHING with C, and from my limited experience (I'm still at uni), learning C makes learning everything else easier. It's close to the metal, if you are processing a string you will know about every character in that sucker, you'll terminate it yourself and you'll manually allocate and free the memory it uses. I like to think you learn some good practises coding in C. Good luck!

If you get stuck for something interesting to code, look up Project Euler, or do some text processing (encryption, HTML parsing, compression). Graphics is fun too, but you'll need to learn some extra libraries for that (OpenGL or something).
chiro
#5
Apr30-12, 04:18 AM
P: 4,572
Quote Quote by Adyssa View Post
You can do ANYTHING with C, and from my limited experience (I'm still at uni), learning C makes learning everything else easier. It's close to the metal, if you are processing a string you will know about every character in that sucker, you'll terminate it yourself and you'll manually allocate and free the memory it uses. I like to think you learn some good practises coding in C. Good luck!

If you get stuck for something interesting to code, look up Project Euler, or do some text processing (encryption, HTML parsing, compression). Graphics is fun too, but you'll need to learn some extra libraries for that (OpenGL or something).
Not quite everything unless you include inline assembler or link to libraries that have assembler routines like communicating with I/O directly.

It's close enough though for bare metal since only with the exception of device drivers, super-optimized routines for particular chipset types or extensions, it's good enough for the kind of micromanagement required for fast software and with a good compiler, nowadays the results are good enough performance-wise.
Whovian
#6
Apr30-12, 07:52 AM
P: 642
The only problem with C is that it teaches "bad habits" in the world of Object-oriented programming.
jbmiller
#7
Apr30-12, 05:11 PM
P: 122
Object-oriented programming? Could you please explain what you mean.
Hobin
#8
Apr30-12, 06:14 PM
P: 194
Quote Quote by jbmiller View Post
Object-oriented programming? Could you please explain what you mean.
Wait. Didn't you just say you had done a lot of research and concluded that C would be the best language to start with? I think, my friend, that your research might have been somewhat incomplete.

Also, Google is your friend.
LorenzAtrctr
#9
Apr30-12, 06:47 PM
P: 4
Depends on what you want to do.

C is closer to the metal, yadda yadda, but you lose some functionality and don't gain much over the equally fast but object oriented c++. Before anyone corrects me by saying c is more basic and therefore faster than c++, remember that c++ is so popular, and a lot of money and effort has gone into optimizing it, while c optimization has been pretty stagnant.

To answer your question about object oriented programming, or OOP, first of all c is procedural i guess, and c++ is OOP. In C++ you can create a class, say a triangle class, and create different instances of triangle. These are all part of the triangle class, but operations on triangle_1 don't effect triangle_2 don't effect..... The class also defines methods or operations you can do on the triangles, like if you wanted to stretch triangle_4, or access what the base of triangle_6 is or whatever. You're modifiyng and accessing "instance variables" of the different "instances" of the "class". Each triangle is an instance of the triangle class.

Basically OOP creates a more pretty way to keep track of many "objects", and their seperate instance variables. Otherwise you might have to do some ugly multidimmensional arrays or something, but those have there purpose, don't get me wrong.

Most video games are written in c++ btw.

If I'm trying to throw together a quick program, python is still great for simple scripts, to even modeling, and it's really easy.

If I was writing an intense physics engine with 3d visualization, I'd pick c++.

If I was writing code for a microcontroller, I'd probably use C.
LorenzAtrctr
#10
Apr30-12, 06:58 PM
P: 4
All that said, you can do anything with C :) It's just a matter (how long it takes to program) vs (how important is performance) for a task by task basis. You can't go wrong with learning C
rcgldr
#11
May1-12, 12:27 AM
HW Helper
P: 7,033
Quote Quote by LorenzAtrctr View Post
C is procedural i guess, and C++ is OOP.
C++ is an extension of C. Object oriented programs have been written in C, and procedural programs in C++. Even in the case of OOP, member functions of an object end up being procedural, so the innermost code of most well designed programs doesn't end up that much different.

Quote Quote by jbmiller View Post
Once I become really good with C what would I be capable of doing? As in how will it benefit me and what exactly is the point of doing it?
Unless you plan to be a programmer, or your studies or a future job involves programming, I'm not sure what the point is, but the same applies to a lot of subjects you learn in school, some of which are more for academic purposes as opposed to having a practical purpose.

You didn't mention what your plans are that might involve programming.

Quote Quote by jbmiller View Post
Did I make the right choice?
There's no reason that C can't be the first programming language you learn. If your studies or a future job involves programming you should find out what language is being used and perhaps start with that language, or switching to that language after spending enough time with C to get an idea of how to write programs.
jbmiller
#12
May1-12, 12:38 AM
P: 122
Quote Quote by rcgldr View Post
Unless you plan to be a programmer, or your studies or a future job involves programming, I'm not sure what the point is, but the same applies to a lot of subjects you learn in school, some of which are more for academic purposes as opposed to having a practical purpose.

You didn't mention what your plans are that might involve programming.

This may sound a little far-fetched, but I've heard from a couple of peolpe that you can do something with physics equations that involves programming? I'm not completely sure, but I found myself to be interested in what they were telling me so I decided I would give it a shot. I'm really interested in physics and by the time I start my physics course next year I was hoping I would be pretty good at programming. I am studying physics this summer, so no rush. I just think that it would be really cool, and why not persue my interest?
rcgldr
#13
May1-12, 12:46 AM
HW Helper
P: 7,033
Quote Quote by jbmiller View Post
This may sound a little far-fetched, but I've heard from a couple of peolpe that you can do something with physics equations that involves programming?
For physics or engineering, you might find a very high level language like Matlab, which is more of a mathematical tool than a programming language, to be useful. There's no reason you couldn't learn both C and Matlab.
jbmiller
#14
May1-12, 12:50 AM
P: 122
Oh ok, thanks.

I've been so lost on deciding which language to learn first. Everyone tells me something different... I will probably learn C then Matlab.

Thanks for the help!
LorenzAtrctr
#15
May3-12, 12:38 PM
P: 4
Python has some nifty Matlab modules.
Hobin
#16
May3-12, 01:14 PM
P: 194
Quote Quote by jbmiller View Post
I've been so lost on deciding which language to learn first. Everyone tells me something different... I will probably learn C then Matlab.
Since you mentioned you were in it mostly because it'd be useful in physics, I recommend staying away from C. Matlab is a good choice, but I would still recommend (as I do to practically all beginners) to learn Python. It's a real programming language (somewhat unlike Matlab), and it's powerful yet easy (unlike C, which requires you to do all the nasty memory allocations by hand).

This is not to say that you should never learn C or Matlab (you will most likely learn the latter in college anyway), but *starting* with Python is highly recommended.
jbmiller
#17
May3-12, 04:51 PM
P: 122
Quote Quote by Hobin View Post
Since you mentioned you were in it mostly because it'd be useful in physics, I recommend staying away from C. Matlab is a good choice, but I would still recommend (as I do to practically all beginners) to learn Python. It's a real programming language (somewhat unlike Matlab), and it's powerful yet easy (unlike C, which requires you to do all the nasty memory allocations by hand).

This is not to say that you should never learn C or Matlab (you will most likely learn the latter in college anyway), but *starting* with Python is highly recommended.
Too late, the book just arived. And I'm really interested in C, and I've done a little of Python. Would you reccomend learning C, then Python, then Matlab?
Hobin
#18
May3-12, 05:29 PM
P: 194
Quote Quote by jbmiller View Post
Too late, the book just arived. And I'm really interested in C, and I've done a little of Python. Would you reccomend learning C, then Python, then Matlab?
No. I'd go for Python (which can easily be learned by using tutorials on the internet), then C (since you already bought the book), then Matlab (since Matlab is awesome).


Register to reply

Related Discussions
Did I make a good choice? Academic Guidance 3
Can you make an object have a stronger graviational pull if you make is denser? General Physics 29
Choice of variable to make matrix rank = 1 Calculus & Beyond Homework 0
Need help about a choice I have to make... Academic Guidance 1
Choice 1: get help here Choice 2: throw this damn laptop out window Computing & Technology 7