• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:37
CEST 18:37
KST 01:37
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature3Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Maestros of The Game—$20k event w/ live finals in Paris10Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6
StarCraft 2
General
Geoff 'iNcontroL' Robinson has passed away RSL Revival patreon money discussion thread Weekly Cups (Aug 11-17): MaxPax triples again! What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : I made a 5.0.12/5.0.13 replay fix
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo) Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
Maps with Neutral Command Centers Flash Announces (and Retracts) Hiatus From ASL [ASL20] Ro24 Preview Pt1: Runway How do the new Battle.net ranks translate? Victoria gamers
Tourneys
[Megathread] Daily Proleagues The Casual Games of the Week Thread [ASL20] Ro24 Group C [ASL20] Ro24 Group A
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Stormgate/Frost Giant Megathread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2904 users

I want to learn to C

Blogs > Arnstein
Post a Reply
Normal
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 23 2012 14:09 GMT
#1
OK, now that we're done with that awful play on words(letter?), let me get straight to the point:

I want to learn to code in C! I have downloaded and installed Xcode on mac(it wouldn't complete though, what is that about? It said 2 minutes remaining for 12 hours, so I just turned the computer off, and when I started it again it was installed).

What I'm looking for is to get a better overview over the whole process(why the files and folders are where they are in a project), as well as just learning to code.

It would be awesome if anyone knew a site like http://www.codecademy.com/ but for C!


rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
TheToast
Profile Blog Joined August 2010
United States4808 Posts
April 23 2012 14:22 GMT
#2
Honestly, you're probably best off learning C#, learning a .Net language actually has some real world applications and can allow you to program software for anyone on an MS Windows platform. Microsoft has made it clear that's the direction they want to go with .Net, and the more complicated aspects of C++ such as writing to specific memory bits has been removed. MSDN has some really good tutorials and has a number of chapters of some good books on learning .Net languages for free.

If you're not interested in .Net, I would say 100% you should look to learn Java (not actually all that different from C++), that would actually be useful for programming apps and cross-platform software.
I like the way the walls go out. Gives you an open feeling. Firefly's a good design. People don't appreciate the substance of things. Objects in space. People miss out on what's solid.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 23 2012 14:26 GMT
#3
I want to learn C because I will be using it later in my education. What is the difference between C++ and C#?
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
emucxg
Profile Blog Joined May 2007
Finland4559 Posts
Last Edited: 2012-04-23 15:18:58
April 23 2012 15:17 GMT
#4
On April 23 2012 23:26 Arnstein wrote:
I want to learn C because I will be using it later in my education. What is the difference between C++ and C#?

C# is easier and for beginners, it has garbage collection just like java, so u dont need worry about memory leaks...

C is for advanced programmers, but C runs much faster than C# though

correct me if im wrong

edit. there are more difference between those, i just mentioned some most important.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 23 2012 15:52 GMT
#5
Ah, ok. But I'll just start with C anyways
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
virpi
Profile Blog Joined August 2009
Germany3598 Posts
April 23 2012 15:52 GMT
#6
Learning C++ is pretty hard, but also very rewarding. You can also easily transfer your knowledge to other languages, once you've mastered the "first levels". If you're entirely inexperienced with programming, I'd suggest that you might try one of the "easier" languages first (such as C#), because the sheer power of C++ is pretty intimidating sometimes.

Don't learn C, though, unless you're planning to study software engineering. C is used to design operating systems and other software that's "close to the hardware". (don't know how to put this in english sry)
first we make expand, then we defense it.
TheToast
Profile Blog Joined August 2010
United States4808 Posts
April 23 2012 16:12 GMT
#7
On April 24 2012 00:52 virpi wrote:
If you're entirely inexperienced with programming, I'd suggest that you might try one of the "easier" languages first (such as C#), because the sheer power of C++ is pretty intimidating sometimes.


Actually Visual Basic is probably one of the easiest languages to learn. I'm no CS major, and despite my short attention span even I was able to learn enough VB to make some simple desktop applications. It has some real world applications too, such as being able to write macros in MS Office. Plus many of the concepts transfer pretty easily to other .Net languages like C#.
I like the way the walls go out. Gives you an open feeling. Firefly's a good design. People don't appreciate the substance of things. Objects in space. People miss out on what's solid.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 23 2012 16:14 GMT
#8
Well, I will study technical cybernetics, and will do a lot of C, so I just want to start a year early trying to get the hang of it
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
JellowLight
Profile Blog Joined October 2011
60 Posts
April 23 2012 16:26 GMT
#9
I started learning c++ a year ago as my first programming language. Everything is going allright and I never found it intimidating or anything. IF you jsut start at the basics and slowly work your way upwards then it is doable.
Spikeke
Profile Joined October 2010
Canada106 Posts
Last Edited: 2012-04-23 16:36:46
April 23 2012 16:34 GMT
#10
I went to that codeacademy site, kinda dumb.
Just grab a programming book for noobs or google cprogramming and start coding. Don't know why you would want to learn old C first, but hey that's your choice. Even if you wanted to learn COBOL I wouldn't stop you. use google and your success is determined by your motivation and self-discipline. Good luck.
infey
Profile Joined August 2010
Canada64 Posts
April 23 2012 16:46 GMT
#11
If you have your heart set on C then my advice would be to grab a solid book on learning C for beginners and work through it from start to finish. C is closer to the metal than many languages and there is a lot of knowledge you'll need that can't be gleaned *easily* from reverse engineering existing programs such as memory management, memory structure layout, pointers, etc A good book will be able to introduce and explain in a way that you'll be able to pick it up more quickly.

Finding someone with a lot of experience in C that you can ask questions of would also be a big help.
palmerdabbelt
Profile Blog Joined October 2010
United States46 Posts
Last Edited: 2012-04-23 16:58:43
April 23 2012 16:58 GMT
#12
You definately want to learn C first (the book I link actually teaches you a simple RISC assembly, which I think is the best way to learn C), especially if you're just doing this as a hobby. While you won't be a productive as you would be learning a high-level language you'll understand a whole lot more.

The intro to programming class at my school used this

http://highered.mcgraw-hill.com/sites/0072467509/

and I highly recommend it. It's particularly useful if you're interested in learning programming just for fun, as it will teach you what's actually going on inside your computer.

Additionally, I would recommend learning to use a proper editor (I use emacs, but vim is fine too), make, gcc, and the command line. When you're learning how to program an IDE (like Xcode) can actually complicate things as it will hide a lot of what's going on. Learning to use a Unix-like operating system (I use Gentoo, a Linux distribution) is also a huge plus, but as your on Mac OS X you'll be alright (there's some Unix in OSX if you look hard enough ).

Good luck!
Snuggles
Profile Blog Joined May 2010
United States1865 Posts
April 23 2012 17:01 GMT
#13
I friggin bought an entire book to learn C. Only to learn that I have no talent whatsoever to do learn it, took me weeks just to learn how compile my simple lines of code.
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
Last Edited: 2012-04-23 17:47:51
April 23 2012 17:47 GMT
#14
--- Nuked ---
fire_brand
Profile Blog Joined October 2009
Canada1123 Posts
April 23 2012 17:48 GMT
#15
Don't start with C. It'll teach you the wrong stuff. You're better off learning something else that's actually useful. C actually will hinder your learning later on.
Random player, pixel enthusiast, crappy illustrator, offlane/support
Snuggles
Profile Blog Joined May 2010
United States1865 Posts
Last Edited: 2012-04-23 18:07:29
April 23 2012 18:05 GMT
#16
Rather than learning C or C++, how come you guys haven't suggest to just learn Java? I read that it's similar to C++ but better and more convenient. Correct if I'm wrong because I'm trying to learn too.

EDIT: just noticed that someone mentioned Java, can anyone further elaborate on it?
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
April 23 2012 18:06 GMT
#17
On April 24 2012 02:47 Inori wrote:
Show nested quote +
On April 24 2012 02:01 Snuggles wrote:
I friggin bought an entire book to learn C. Only to learn that I have no talent whatsoever to do learn it, took me weeks just to learn how compile my simple lines of code.

There's no such thing as "no talent to learn it". You might not have genius skills to hack google at 15, but to learn how to code and eventually get senior dev position - anyone can achieve that. Literally, anyone.

I agree that anyone can do it, but there is definitely talent or a particular way of thinking that makes progress much faster for learning how to code.
twitter: @terrancem
Melchior
Profile Joined January 2011
United States112 Posts
April 23 2012 18:18 GMT
#18
From my experience, Java or C# is probably easier to pick up and is good for teaching abstraction, etc. C requires a little more bookkeeping from the programmer in terms of memory management/pointers, but can be written to run faster than Java. C++ is extremely powerful but quite a bit different than the other languages to learn -- what is properly written code in C will often work on C++, but will almost inevitably be a suboptimal implementation in C++.

Of course, the language you should start with depends on what you want to do with it...
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
April 23 2012 18:23 GMT
#19
Nobody has mentioned it yet, but I'll even put in a vote for learning Objective-C if you happen to be on a Mac. Working with Objective-C and Cocoa is actually really nice and you can go from learning to making a real desktop/iOS application pretty quickly. Objective-C still lets you learn about object oriented programming, and you can also make use of C structures (and c++ but I would steer away from that if you're just learning) easily.

It might not be as valuable for employment, unless you're looking into iOS or Mac development. But once you've learned one language it's really not difficult to pick up more in the future.
twitter: @terrancem
GogoKodo
Profile Blog Joined April 2003
Canada1785 Posts
April 23 2012 18:25 GMT
#20
On April 24 2012 02:48 fire_brand wrote:
Don't start with C. It'll teach you the wrong stuff. You're better off learning something else that's actually useful. C actually will hinder your learning later on.

Learning C will not teach you the "wrong stuff", whatever that is, and C is definitely useful.
twitter: @terrancem
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 23 2012 18:29 GMT
#21
Thanks everyone!

And palmerdabbelt, thanks a lot, will definitely check that book out! (hopefully I can find it free online)
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
Marradron
Profile Blog Joined January 2009
Netherlands1586 Posts
April 23 2012 19:01 GMT
#22
Visual basic and C# are both quite nice to learn. Knowing the basic functions and capabilitys of c/c++ would give you a good idea of what kind of things you can do. Don't go to deeply into C though. Once you know the basic building blocks move on to C# or VB. The forms, threading, lists will make you never want to go back.
palmerdabbelt
Profile Blog Joined October 2010
United States46 Posts
April 23 2012 19:18 GMT
#23
On April 24 2012 03:29 Arnstein wrote:
Thanks everyone!

And palmerdabbelt, thanks a lot, will definitely check that book out! (hopefully I can find it free online)


If there's anything else I can do to help feel free to send me a PM.
hoot00
Profile Blog Joined October 2010
United States77 Posts
April 23 2012 20:21 GMT
#24
So let's say I'm a future genius who wants to hack google.

Which one should I learn?
LEGENDS NEVER GG
blade55555
Profile Blog Joined March 2009
United States17423 Posts
April 23 2012 20:40 GMT
#25
On April 24 2012 03:25 GogoKodo wrote:
Show nested quote +
On April 24 2012 02:48 fire_brand wrote:
Don't start with C. It'll teach you the wrong stuff. You're better off learning something else that's actually useful. C actually will hinder your learning later on.

Learning C will not teach you the "wrong stuff", whatever that is, and C is definitely useful.


From what I read when I was teaching myself programming most people agreed that learning C first would give you bad habbits that will cause many problems in c+ and what not.
When I think of something else, something will go here
sieksdekciw
Profile Joined April 2012
240 Posts
Last Edited: 2012-04-23 20:45:05
April 23 2012 20:43 GMT
#26
On April 23 2012 23:22 TheToast wrote:
1. Honestly, you're probably best off learning C#,

2. Java (not actually all that different from C++), that would actually be useful for programming apps and cross-platform software.

What is this, I don't even??!

C and C++ don't have any ACTUAL applications nowadays?
A quick look here :http://www.thewindowsclub.com/what-is-android-operating-system-a-beginners-read

A beginners read on this article shows that:
`Android OS consists of over 12 million lines of code written in C / C++ / Java and XML.`

`Java is not that different from C++`

Have you ever seen Java code and have you ever seen C# code. That is right, they look alike

Hello world in C#:

class Hello
{
static public void Main()
{
System.Console.WriteLine("Hello World");
}
}


Hello world in Java:

class Hello {
public static void main(String[]args) {
Systen.out.println("Hello World");
}
}



Hello world in C++

#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}


You better go to school, kids, cause if you don't you will end up saying in forums that Java is (not that different from C++, actually). Shame on you for being outright stupid.
divito
Profile Blog Joined January 2011
Canada1213 Posts
April 23 2012 20:48 GMT
#27
If you're looking to learn C, C++, or C# (or anything really), I have a ton of eBooks if you're interested. That goes for the OP or anyone.
Skype: divito7
olabaz
Profile Blog Joined April 2009
United States298 Posts
April 23 2012 21:11 GMT
#28
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!
TheToast
Profile Blog Joined August 2010
United States4808 Posts
Last Edited: 2012-04-23 21:20:58
April 23 2012 21:20 GMT
#29
On April 24 2012 05:43 sieksdekciw wrote:
Show nested quote +
On April 23 2012 23:22 TheToast wrote:
1. Honestly, you're probably best off learning C#,

2. Java (not actually all that different from C++), that would actually be useful for programming apps and cross-platform software.

What is this, I don't even??!

C and C++ don't have any ACTUAL applications nowadays?


Okay, you're just putting words in my mouth. I never said C++ didn't have applications. I was implying that C didn't have that many real world applications in terms of development of desktop applications. You do know he was talking about C and not C++ right?


You better go to school, kids, cause if you don't you will end up saying in forums that Java is (not that different from C++, actually). Shame on you for being outright stupid.


They're both object oriented programming languages, just because the syntax isn't the same doesn't mean they are drastically different. And if you want to discuss this further, try it without the attitude maybe?
I like the way the walls go out. Gives you an open feeling. Firefly's a good design. People don't appreciate the substance of things. Objects in space. People miss out on what's solid.
sieksdekciw
Profile Joined April 2012
240 Posts
April 23 2012 21:26 GMT
#30
On April 24 2012 06:20 TheToast wrote:
Show nested quote +
On April 24 2012 05:43 sieksdekciw wrote:
On April 23 2012 23:22 TheToast wrote:
1. Honestly, you're probably best off learning C#,

2. Java (not actually all that different from C++), that would actually be useful for programming apps and cross-platform software.

What is this, I don't even??!

C and C++ don't have any ACTUAL applications nowadays?


Okay, you're just putting words in my mouth. I never said C++ didn't have applications. I was implying that C didn't have that many real world applications in terms of development of desktop applications. You do know he was talking about C and not C++ right?

Show nested quote +

You better go to school, kids, cause if you don't you will end up saying in forums that Java is (not that different from C++, actually). Shame on you for being outright stupid.


They're both object oriented programming languages, just because the syntax isn't the same doesn't mean they are drastically different. And if you want to discuss this further, try it without the attitude maybe?


C++ is a OO language and java is also. Nice similarity. It's like saying an elephant is similar to a fish since they both are animals.

C# is far closer as idea and syntax and level of abstraction to Java than C++ is to any of them.
freelander
Profile Blog Joined December 2004
Hungary4707 Posts
April 23 2012 21:53 GMT
#31
Well I don't recommend java first if you want to learn programming more seriously in the future.
It's a badly designed language, in my opinion. Though for sure it has libraries for everything.

C first is nice.
And all is illuminated.
Melchior
Profile Joined January 2011
United States112 Posts
April 23 2012 22:59 GMT
#32
On April 24 2012 06:20 TheToast wrote:
I was implying that C didn't have that many real world applications in terms of development of desktop applications. You do know he was talking about C and not C++ right?

[Java and C++ are] both object oriented programming languages, just because the syntax isn't the same doesn't mean they are drastically different. And if you want to discuss this further, try it without the attitude maybe?

As far as I'm aware, plain C is still used for a lot of high performance computing applications. Desktop applications or web services? Yeah, go with C# or Java. But C's still around to stay.

Also, Bjarne Stroustrup (the original creator of C++) would disagree with your characterization of C++ as an object-oriented programming language. C++ supports object-oriented programming, but is also capable of much more. I had a pretty easy time learning Java after C, but learning proper C++ was an entirely different beast.
darmousseh
Profile Blog Joined May 2010
United States3437 Posts
April 24 2012 02:20 GMT
#33
On April 24 2012 05:43 sieksdekciw wrote:
Show nested quote +
On April 23 2012 23:22 TheToast wrote:
1. Honestly, you're probably best off learning C#,

2. Java (not actually all that different from C++), that would actually be useful for programming apps and cross-platform software.

What is this, I don't even??!

C and C++ don't have any ACTUAL applications nowadays?
A quick look here :http://www.thewindowsclub.com/what-is-android-operating-system-a-beginners-read

A beginners read on this article shows that:
`Android OS consists of over 12 million lines of code written in C / C++ / Java and XML.`

`Java is not that different from C++`

Have you ever seen Java code and have you ever seen C# code. That is right, they look alike

Hello world in C#:

Show nested quote +
class Hello
{
static public void Main()
{
System.Console.WriteLine("Hello World");
}
}


Hello world in Java:

Show nested quote +
class Hello {
public static void main(String[]args) {
Systen.out.println("Hello World");
}
}



Hello world in C++

Show nested quote +
#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}


You better go to school, kids, cause if you don't you will end up saying in forums that Java is (not that different from C++, actually). Shame on you for being outright stupid.



Have you seen it in ruby?


print "Hello World"



What are your goals? Choosing a language for learning is pretty important as it will shape your thinking process. I would reccomend choosing a language which is commonly used in areas you wish you utilize. For an all purpose language, I would say java is the way to go. If you want to do video games, go with c/c++/c#. If you want to do web stuff, php and ruby are the right choice.

If you have any questions, pm me.
Developer for http://mtgfiddle.com
NinjoOb
Profile Blog Joined November 2009
Canada128 Posts
April 24 2012 02:31 GMT
#34
Learning C as your first language might be more difficult than Java for example, mainly (at least for me) because you have to manage memory yourself and the use of pointers. If you have no programming experience, you might want to start with Java (in netbeans or something) then go to C. Alternatively, you could just jump right in C and deal with a slightly steeper learning curve.
Xyik
Profile Blog Joined November 2009
Canada728 Posts
April 24 2012 02:55 GMT
#35
Learning C is great if you ever want to do low-level stuff like writing an OS or doing any embedded programming / compiler stuff because it offers a lot of flexibility in manual memory management that can allow you to write some really efficient code. Some people aren't interested in that stuff with the web-craze nowadays brought on by google, facebook, twitter etc but that just means that there will be fewer people with that kind of skill. Don't turn away from C just because its an older language that appears to have fewer options in the real-world, it's a good place to start and will let you appreciate other languages that much more later on. It really depends on your motivation for programming and what you want to create.
VManOfMana
Profile Blog Joined December 2008
United States764 Posts
April 24 2012 03:04 GMT
#36
Since you have a Mac and you are installing X-Code, go all the way and get started on Objective C.

http://www.bignerdranch.com/book/objective-c_programming_the_big_nerd_ranch_guide

The Big Nerd Ranch guide will not teach you all of C, but the basics to get started before you start diving in to Objective C (Apple's prefered language for development). The book is very good for people who want to learn on their own pace, and prefer a more practical approach. For example, the book won't teach you every detail of vodoo black magic needed to master pointers and memory management, but just what you meed to understand and work with references in Objective C.

You can then proceed with the Cocoa (Apple's development libraries) books, that introduce you more into OSX and/or iOS programming.

Also, a very good motivator is to have a project you want to work on. Doesn't need to be very sophisticated, just something you can find useful and cook.



Personally I really appreciate programs that are small, but with a lot of attention to detail
Woo Jung Ho, FIGHTING! | "With the death of BW comes the death of an idea. And that idea, held by many BW fans, was that a computer game could actually outlive the Next New Game cycle. And to some extent it did." -Falling
Athos
Profile Blog Joined February 2008
United States2484 Posts
April 24 2012 03:21 GMT
#37
I've known java for a while, and I had a homework assignment given to me which was to write a quine in C. C really isn't that different from Java (besides the obvious difference of allocating memory through pointers and the different syntax, C being lower level, etc). Honestly, once you learn one language, picking up the rest of them is easy, as the stuff you build, and the skills you learn from 1 language give you a foundation for learning the others. So my advice is to start with java (what I did) but honestly if your heart is set on C, then go for it!
Anacletus
Profile Blog Joined April 2012
United States733 Posts
April 24 2012 03:57 GMT
#38
I'm a relatively new programming student just like you. I have minimal experience in C. However, I do have a lot of experience in C++ and am teaching myself Ruby right now. I don't think that there is any single best language to start with as you must learn to program before you learn any language in depth. That being said if you have Skype I think that I could help you out tremendously by just walking you through some basics and answering any questions you might have. You might even be able to help me with a cute little rocket ship game that I am working on.

If you (or anyone else) is interested or has any questions I have a fair amount of free time so send me a message on TL and I can send you my Skype info (not posting here).

Good luck with your quest for knowledge!
http://talk-to-stimey-please.1324083.n2.nabble.com/
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 25 2012 20:51 GMT
#39
Thanks everyone! Will add you Skype-folk when I have the time to start the C-learning!
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
April 25 2012 21:11 GMT
#40
On April 24 2012 06:11 olabaz wrote:
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!


I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion...

C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful.

If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language.
Brandish
Profile Blog Joined November 2010
United States339 Posts
Last Edited: 2012-04-25 21:39:13
April 25 2012 21:34 GMT
#41
On April 24 2012 05:40 blade55555 wrote:
Show nested quote +
On April 24 2012 03:25 GogoKodo wrote:
On April 24 2012 02:48 fire_brand wrote:
Don't start with C. It'll teach you the wrong stuff. You're better off learning something else that's actually useful. C actually will hinder your learning later on.

Learning C will not teach you the "wrong stuff", whatever that is, and C is definitely useful.


From what I read when I was teaching myself programming most people agreed that learning C first would give you bad habbits that will cause many problems in c+ and what not.



I'm a senior CS undergraduate student and I honestly wish that my University picked C or C++ as its main language instead of java. While java might be an easy language to pick up, I feel extremely gimped in regards to understanding dynamic memory management and trash collection. I am pretty fluent and Java and learning C++/C right now so I can actually get a job because there seems to be little demand for Java programmers in all the jobs that I have applied for so far. If anything learning Java first over C has taught me more bad habits than I think learning C would have. A good book to start with is http://www.amazon.com/Programming-Modern-Approach-2nd-Edition/dp/0393979504?tag=tealiq-20
This is the one I am using to guide my own studies.

As for differences, I think the most defining ones are
C++ is basically C with object orientation and a ton more tools to make your life easier
Java and C# are really similar in that they run with virtual machines and they are super high level languages that have a lot of automation and built in safety.

edit: spelling
darthcaesar
Profile Blog Joined June 2010
United States475 Posts
Last Edited: 2012-04-25 22:06:48
April 25 2012 22:06 GMT
#42
I think the most common starting language is either C++ or Java. I think C++ is better to start with. The basic syntax is far easier to understand. Take a C++ hello world:

#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}

compared to a Java Hello, World:

public class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello, World!");
}
}

In C++, you don't have to think about what public, static, void, or class mean. The other major part about C++ is pointers. Everyone should play with pointers and understand how they work. In Java, every object works essentially as a pointer. Java is an easier language to program in once you are familiar with programming, but C++ is easier to start and better for learning.
He is wisest who knows he does not know. | (┛OДO)┛彡┻━┻
Nizzy
Profile Blog Joined November 2010
United States839 Posts
April 26 2012 00:23 GMT
#43
No idea how old you are, but I guarantee if you go get some advanced certificates in Java programming you're going to get hired very fast in America. There's so many java programming jobs right now. I understand it decently but I just don't like programming enough to do it day-in and day-out. If you can stand it you could be making 80$/hour....
Scheme
Profile Blog Joined April 2011
United Kingdom210 Posts
April 26 2012 00:44 GMT
#44
I learned C as my first programming language and I can recommend to anyone to do it as well. It will give a solid foundation for learning other languages and well as forcing you to learn some computer concepts along the way. There are plenty of applications of C, like Linux programming, embedded devices, etc.
It will also be straightforward to learn C++ from there.

If you get a chance get K&R book either as your main book or as a companion to whatever book you are reading. It's a classic.

Scheme
Profile Blog Joined April 2011
United Kingdom210 Posts
Last Edited: 2012-04-26 00:49:40
April 26 2012 00:45 GMT
#45
Sorry for the double post. I blame TL iPhone app/
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
April 26 2012 00:59 GMT
#46
You could try this: http://cecilsunkure.blogspot.com/2011/02/i-want-to-learn-programming-but-i-know.html
olabaz
Profile Blog Joined April 2009
United States298 Posts
May 04 2012 21:40 GMT
#47
On April 26 2012 06:11 adwodon wrote:
Show nested quote +
On April 24 2012 06:11 olabaz wrote:
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!


I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion...

C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful.

If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language.

C is not useless for physics...
Anacletus
Profile Blog Joined April 2012
United States733 Posts
May 04 2012 22:49 GMT
#48
On May 05 2012 06:40 olabaz wrote:
Show nested quote +
On April 26 2012 06:11 adwodon wrote:
On April 24 2012 06:11 olabaz wrote:
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!


I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion...

C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful.

If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language.

C is not useless for physics...


C is the backbone language for SO many other languages and is still used for MANY applications and systems.


http://talk-to-stimey-please.1324083.n2.nabble.com/
MaGariShun
Profile Joined May 2010
Austria305 Posts
Last Edited: 2012-05-04 23:15:25
May 04 2012 23:12 GMT
#49
On April 26 2012 07:06 darthcaesar wrote:
I think the most common starting language is either C++ or Java. I think C++ is better to start with. The basic syntax is far easier to understand. Take a C++ hello world:

#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}

compared to a Java Hello, World:

public class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello, World!");
}
}

In C++, you don't have to think about what public, static, void, or class mean. The other major part about C++ is pointers. Everyone should play with pointers and understand how they work. In Java, every object works essentially as a pointer. Java is an easier language to program in once you are familiar with programming, but C++ is easier to start and better for learning.

This is complete and utter bullshit. C++ is far more complicated, feature rich and requires annoying memory and pointer management. It does not force you to use a certain style (object oriented, like java) and is generally probably the most beginner unfriendly language you could find (of the major ones, stuff like lisp and caml not included). Pointers are a bad argument, modern languages stray away from them, because they are a major source of errors.

No, I'm not bashing on C++ as a language in general, I just think that it's not suited for beginners. When you start out, you want to write programs that work, not fight with compilers, linkers, memory leaks, buffer overflows, header files etc.
I would recommend java, although not because of the language itself, but because the library and the IDE eclipse, which are very easy to use and learn with - plus there is a lot of material and the language is used widely. You can do pretty much everything in Java with the standard library.

I understand that you want to learn C, but I would really not recommend it. It does teach you a lot about hardware, memory management etc., but it does not teach you how to be a good programmer. To put it into an RTS anology:

Java is SC2
C++ would probably be Brood War
C is Dune2

which one would you want to learn RTS with?
allluckysevens7777
Profile Joined February 2009
United States53 Posts
May 05 2012 01:45 GMT
#50
Dunno why there's so little support for python or ruby. In terms of just learning to think the right way, those are probably the best bet. Very little getting between you and making stuff happen. Plus, interactive interpreter is great for experimenting and discovering new ideas. I personally don't really like ruby, but expect it's just because I'm not cool enough to "get" it. Several programmers I respect technically really like it.

I'd be interested to hear more about C/C++ teaching bad habits. I write C daily, and have worked with java, C++, perl (gak), and python codebases professionally. My first language happens to have been C++. I've found that most if not all "bad habits" arise from ignorance and poor instruction, and aren't really the sort of thing that a language forces on you.

If you're just learning to program, and particularly if you want to learn C, I highly recommend finding someone(s) that's willing to look over your code. Some things don't really communicate well in books and benefit greatly from having experience looking over your shoulder.
Anacletus
Profile Blog Joined April 2012
United States733 Posts
May 05 2012 04:32 GMT
#51
I really hate that Ruby forces no types. I find the lack of type fixing very useful at times, but at others it's extremely detrimental. My game is coming along quite nicely, and it is purely done in Ruby. (lol Ruby game)
http://talk-to-stimey-please.1324083.n2.nabble.com/
Abductedonut
Profile Blog Joined December 2010
United States324 Posts
May 05 2012 09:35 GMT
#52
It's really quite incredible how the OP clearly isn't showing an interest in any other languages and yet you guys keep rambling on about this language is better than that - blah blah blah.

Arnstein, C is a wonderful language. It is mainly used for systems programming, so it is a very low level language. Fortunately, it's a no-bullshit language, meaning code is usually very direct and easy to follow. C is not an object-oriented language, so you will not run into things like "classes" or "inheritence", which can sometimes lead to some very ugly and confusing code.

I will explain the difference between some higher level languages and C, and you could use that to decide where you would like to start, if your heart is not already set on C. This should give you a good perspective on what you will be embarking on. Most really high level languages have these:

- Object-Orientedness
- Garbage Collection/ Automated Memory Management
- Lack of pointers
- Security

Object-Orientedness
+ Show Spoiler +

Objects and object-oriented programming languages were something designed to make human design of programs simpler. The entire idea behind an Object is that you group similar properties and functions of a "real-life" object into one cute name.

Here's an example to give you a better idea. Suppose you were designing a video game and inside that video game there are tanks. We can even take the Seige Tank is starcraft as a concrete example. If were to think about the important PROPERTIES of a tank we could make a short list, something like this:

- Armor
- Damage
- Health
- Speed

And if we were to think of some important functions or actions of a tank we could come up with something like this:

- Attack
- Seige Mode
- Stop
- Move

Now I can create an "object" that groups all these properties together to make it easy for myself. I could say:

myTank.Armor = 3; <- This would change the armor value of the tank to 3
myTank.Damage = 10000; <- Holy crap that's STRONG!!!

C lacks the ability to create objects directly. However, in can still be done pretty similarly to most high-level langauages through the use of structures. You will learn about those eventually.


Garbage Collection/ Automated Memory Management
+ Show Spoiler +

As you may imagine, inside your program you will be creating a bunch of variables, objects, strings, and all sorts of stuff. Well, who is keeping track of all that stuff? When should stuff be destroyed and when should it be kept?

The answer to this question depends on what language you are programming in. Most really high level languages like java, C# and many others have what is called Garbage Collection and Automated Memory Management.

Garbage Collection and automated memory management is exactly what it sounds like. Your program will cycle through all the stuff you've made and delete things that it thinks you will no longer ever use. Most of the time this works pretty well, meaning you can program-and-go and not have to think about problems with memory space running out or using something you shouldn't be using.

C does not gave garbage collection. You will be doing everything manually, so you must keep track of all variables, pointers, and memory that you use. This may sound daunting, and sometimes it can be, but unless you're solo making software to manage an entire airplane that spans over a million lines of code it probably would not bother you too much.



Lack of pointers
+ Show Spoiler +

Pointers? What the hell is a pointer, anyway? A pointer is exactly what it sounds like. It's a VARIABLE that points to something. More technically, pointers point to addresses of memory inside a computer. Snooze. Sounds simple, right?

Apparently it's not. Pointers can be too compliated for some programmers, which is why languages like java and C# have allegidly gotten rid of them. I say allegidly because pointers are such a fundamental part of modern day computers that there really is so escpating them. Really high level languages like java HIDE all the pointer operations going on the background to make programming more trivial.

C does not. You will be dealing with pointers DIRECTLY, and often times even things you think are simple library functions will use pointers. To give a crude example, say you wanted to copy a string. Well. cplusplus.com has a great resource that lays out the common C libraries very nicely for you. You will be using these libraries very often, so keep this link handy!
Link is: http://www.cplusplus.com/reference/clibrary/

Let's take a look at strcpy() (Short for String Copy) Link is: http://www.cplusplus.com/reference/clibrary/cstring/strcpy/
" char * strcpy ( char * destination, const char * source ) "
This part is the meat of the function. Almost every time you see an ASTERISK (*) in a program in C, it's a pointer. So this function takes in two pointers and even returns a pointer! Just to copy a string!!

The truth about the matter is that pointers require getting used to, but living without them is impossible. They are wonderful and really amazing tools in a programming language.


Security
+ Show Spoiler +

I realize this probably doesn't matter for you, but higher level languages are generally more secure. That's because majority of low level control is hidden from you. You must realize that your program will be grossly insecure in C. So if you plan on writing an FTP server where people will be submitting personal information, I'd look into learning about how to program securely.


A quick word about C++. The thing that makes C++ interesting is that it's not really a very low level language nor is it a very high level language. C++ is object oriented, however, it doesn't not have memory management and still has pointers. It's really an "in-the-middle" programming language.

C is a great choice for a first programming language, especially if you're a computer scientist. Seems like your degree will be quite technical, so you might be dealing with low level issues and programming a lot. Might as well learn C. And the beautiful thing about C is that it transitions into other languages perfectly.
I wrote a post in the "Big Programming Thread" elaborating on this that got updated to the OP. Feel free to check it out.
http://www.teamliquid.net/forum/viewmessage.php?topic_id=134491

Let's get started on C! I won't be teaching you the "technical" part of programming because there are a million tutorials out there. I will be teaching you the most important part yet least covered and most confusing part. Setting up your compiler and compiling your first program. I'm going to teach you how to do it on WINDOWS, because most people will be using windows and I want this post to be general. Also, because codeblocks is abysmal trash. Same idea on any OS, really. So we have two things we want do.

Installing, compling, and understanding GCC, which is part of the GNU compiler collection, is our main goal here. Here are the steps:

- Get GCC/GNU via an IDE.
- Add the /bin directory to your PATH enviornment variable, allowing you access to a command line compiler as well as other programs.

In case you were wondering, the GNU compiler collection is a set compilers for multiple programming languages. GCC, which is probably the most famous C compiler, is part of the GNU compiler collection.

Part 1: Get GCC/GNU via an IDE

The IDE I'm going to be using here is called dev c++. In truth, this is not a very good IDE but it's great because it's simple to install and use. It's small, supports both C and C++, and contains a /bin folder with the entire GNU compiler collection, which we will use in part 2. So let's head over to dev c++'s site and download and install it.
Link:
http://sourceforge.net/projects/dev-cpp/files/Binaries/Dev-C++ 4.9.9.2/devcpp-4.9.9.2_setup.exe/download

Installing this is just like installing any program. If you can't figure this part out, you probably shouldn't be trying to program anyway. Once it's install, run it and you will see this.

+ Show Spoiler +

[image loading]


Go to File > New > Project... This will open a new tab.
Make sure you have Console Application Selection, and make sure C Project is selected at the bottom. You can choose to make it the default language as well. Give the project a name and hit OK. Copy and paste this into the big white portion where all the code is.

+ Show Spoiler +

#include <stdio.h>

int main(int argc, char *argv[])
{
printf("Hello World!! \n");
system("PAUSE");
return 0;
}


The four buttons I have boxed in red are really your favorite buttons. Compile, run, Compile and run, and rebuild. Hit the compile and run button, and your program should be up and running! Congradulations, you've compiled and ran your first program!

You can use dev to start programming and expiermenting with stuff. Have fun with it!

Part 2: Add the /bin directory to your PATH enviornment variable
Hit the windows key + r. This will open up run. Type in "cmd" and press enter. Welcome to command prompt! Now, if you've ever done something like type "ping google.com", then I'm sure you've wondered what the hell is going on. This is command prompt running the PING program, which happens to be a command line program. GCC is a command line compiler. Dev C++ makes it all dolled up and cute for you, but really it's just running the GCC command line compiler for you with your source code.

What we need to do is add "gcc" and all the accompanying programs to your windows PATH variable so you can call it for any directory. This will let you use the command line compiler to compile anywhere with any options you like, as well use the accompanying programs. This will come in handy because a lot of tutorials use the command line compiler and I don't want you to feel left out.

Check out the "C:\Dev-Cpp\bin" directory. Notice the gcc.exe and all the other wonderful programs? For those of you NOT using dev, head over to google and use it to download the GNU compiler collection. Install and navigate to the /bin folder. Make sure it has gcc and ld inside that directory. Copy the path, as you will be adding it to your PATH variable to call it from anywhere.

To add that entire directory to your PATH environment variable, go to system properties ( shortcut: windows key + pause|break ) Click "Advanced System Settings" and click the "Enviornment Variables" button.

Warning: Do not randomly change stuff in here. You WILL break your computer.
Under "system variables" scroll down until you find PATH. Edit it, and at the end append ";C:\Dev-Cpp\bin"
The semicolon seperates paths. Mine, overall, looks like this:

+ Show Spoiler +

C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Dev-Cpp\bin

WARNING: DO NOT COPY MINE. JUST AN EXAMPLE.


Click okay, save, blah blah blah, and reopen command prompt and type "gcc -v". Some of you might need to restart your computer. You should see a bunch of info if it worked.

Now create a file on your desktop and call it main.c. Copy the code from above. Change the command prompt directory to your desktop, and type "gcc -o myfile.exe main.c". Congrats! You've succesfully compiled using the command line compiler. For those of you need help with the command prompt commands:
+ Show Spoiler +

"cd" changes your directory.
Example 1: cd C:\Windows
Example 2: cd Desktop

"dir" lists all files in the directory.
Example: dir

Use these to navigate to your desktop.


For those of you wondering why this might be useful, it's because you can now use GCC's full potential without IDE restriction. What do i mean? Well... in the same above scenerio, type "gcc -S main.c" and find a file called main.s on your desktop. Gasp! Voodoo magic, what kinda of code is THAT? Blasphemy, says I!

Enjoy. Hope this helps some of you. Feel free to IM/PM me if you ever need any help.
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
Last Edited: 2012-05-05 11:03:59
May 05 2012 11:02 GMT
#53
On May 05 2012 06:40 olabaz wrote:
Show nested quote +
On April 26 2012 06:11 adwodon wrote:
On April 24 2012 06:11 olabaz wrote:
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!


I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion...

C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful.

If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language.

C is not useless for physics...


Care to elaborate?

If you want to learn physics, learn physics, don't add complex programming languages on top of that. You'll have a much easier time, and find it easier to apply something like Java to a physics undergrad course.

I'm sure you can find some use for C, but I've never come across a physicist in academia that uses C, it's not the ideal language and most physicists want to do physics, not programme, but if you think you can somehow squeeze 8 extra hours out of each day to double up your discipline then go ahead.

Why not just do a Computer Science degree?

Don't say I didn't warn you.
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
Last Edited: 2012-05-05 11:13:19
May 05 2012 11:11 GMT
#54
On May 05 2012 18:35 Abductedonut wrote:
It's really quite incredible how the OP clearly isn't showing an interest in any other languages and yet you guys keep rambling on about this language is better than that - blah blah blah.


Maybe thats because the OP asked about learning to code in C then went on to ask what the difference between C++ and C# is.

Sorry, but if you don't know that yet you probably shouldn't be diving right into C, its like saying hey the kid wants to learn to ski down black diamond routes, I see no reason why not, it's what he asked for! It's far easier, especially when learning under your own steam to learn more about the different types of languages and start with something easier, which is what people are recommending which also has fun applications.

Especially since a lot of us probably remember wanting to learn a language, in most cases probably C / C++ and not knowing the differences just blindly went into it only to find out it was completely the wrong language to learn at the time.

The only circumstance I would think learning C first would be appropriate would be if you were on a CS course, learning all the other things about computer systems and being taught in a formal manner, otherwise you're just going to make mistakes.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
May 13 2012 13:25 GMT
#55
Thanks for so many replies people! You are all good sources of information, and very helpful!

For those wondering why I absolutely wants to learn C: Next year I'm hopefully starting to study technical cybernetics, and the first language I will learn there is C. I want to start now so the first semester won't be THAT tough(even though people say it's the most intense and theoretically hard study after nanotechnology).
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
og8456
Profile Joined May 2012
Korea (South)26 Posts
Last Edited: 2012-05-13 21:16:06
May 13 2012 21:15 GMT
#56
You really should go for C++ and not C, C is really outdated! ^_^

/Just my opinion!
my stream: http://ko.twitch.tv/prismccorby/
Anacletus
Profile Blog Joined April 2012
United States733 Posts
May 13 2012 21:17 GMT
#57
On May 14 2012 06:15 og8456 wrote:
You really should go for C++ and not C, C is really outdated! ^_^

/Just my opinion!


This could not be farther from the truth.
http://talk-to-stimey-please.1324083.n2.nabble.com/
Vector Jay
Profile Blog Joined February 2012
10 Posts
Last Edited: 2012-05-13 21:20:48
May 13 2012 21:17 GMT
#58
I wonder if anyone actually reads OP's posts here? More than once he clearly said he is going to work with cybernetics so it's obvious he is going to need some low-level grip, C is probably the best language one could ask for that.
MaGariShun
Profile Joined May 2010
Austria305 Posts
May 13 2012 21:29 GMT
#59
On May 14 2012 06:17 Anacletus wrote:
Show nested quote +
On May 14 2012 06:15 og8456 wrote:
You really should go for C++ and not C, C is really outdated! ^_^

/Just my opinion!


This could not be farther from the truth.

It's from 1970. That alone should probably tell you that it's outdated

Is it still widely used and has its own niches where it is best? Absolutely!
Does that make it a good modern programming language? Nope!
IMlemon
Profile Blog Joined May 2008
Lithuania296 Posts
May 13 2012 22:18 GMT
#60
While it's definately true that C has many areas of application its also true that as a beginner, you'll be spending way too much time worrying about various C quirks rather than PROGRAMMING. Language is but a tool and ultimately it won't matter what you started out with but by choosing beginner friendly language you'll assimilate core programming ideas much faster. If you go with C you'll have to learn about pointers and other shit and generally waste your time. Go learn C when you have some development experience under your belt and you'll save yourself a lot of time.
My future's so bright, I gotta wear shades.
Anacletus
Profile Blog Joined April 2012
United States733 Posts
May 14 2012 00:12 GMT
#61
On May 14 2012 06:29 MaGariShun wrote:
Show nested quote +
On May 14 2012 06:17 Anacletus wrote:
On May 14 2012 06:15 og8456 wrote:
You really should go for C++ and not C, C is really outdated! ^_^

/Just my opinion!


This could not be farther from the truth.

It's from 1970. That alone should probably tell you that it's outdated

Is it still widely used and has its own niches where it is best? Absolutely!
Does that make it a good modern programming language? Nope!


C has been updated since then. And saying C is outdated means it's obsolete - it most definitely is not obsolete as it is still widely used today. I feel like I'm just arguing semantics, but dammit C is NOT outdated no matter how old it is!
http://talk-to-stimey-please.1324083.n2.nabble.com/
MaGariShun
Profile Joined May 2010
Austria305 Posts
May 14 2012 01:36 GMT
#62
On May 14 2012 09:12 Anacletus wrote:
And saying C is outdated means it's obsolete

I never said it's obsolete, because it isn't. Its concepts and design are outdated. Sure, you can do most of the stuff you do in modern languages, but basically everything is a hack (error codes instead of exceptions, class-like structs with function pointers etc.)

I mean, if you are not programming on low level (be it hardware or the OS) stuff or desperately need that last bit of performance, there really is no need (or incentive) to use C. You could, no question there, but why would you go through all that extra hassle?

I understand you are a fanboy, but cmon!
Anacletus
Profile Blog Joined April 2012
United States733 Posts
May 14 2012 01:40 GMT
#63
On May 14 2012 10:36 MaGariShun wrote:
Show nested quote +
On May 14 2012 09:12 Anacletus wrote:
And saying C is outdated means it's obsolete

I never said it's obsolete, because it isn't. Its concepts and design are outdated. Sure, you can do most of the stuff you do in modern languages, but basically everything is a hack (error codes instead of exceptions, class-like structs with function pointers etc.)

I mean, if you are not programming on low level (be it hardware or the OS) stuff or desperately need that last bit of performance, there really is no need (or incentive) to use C. You could, no question there, but why would you go through all that extra hassle?

I understand you are a fanboy, but cmon!


I'm more of a C++ fanboy (mmmm dat performance, am I right?). I'm just not going to let you guys get away with spreading misconceptions about C!
http://talk-to-stimey-please.1324083.n2.nabble.com/
tarpman
Profile Joined February 2009
Canada718 Posts
Last Edited: 2012-05-14 01:57:09
May 14 2012 01:53 GMT
#64
This thread makes me sad. The OP comes out knowing what he wants to learn and asking for help learning it, and what does everyone tell him? Their own opinions on what he should learn instead? Come on... there are other perfectly good threads for that.

OP, I see CecilSunkure linked his series of intro-to-C-programming tutorials above, and they're decent.

The original book on C, Kernighan and Ritchie's The C Programming Language is still considered one of the best references on the subject, although I'm not sure of its suitability for a beginner. It's a little expensive but you could probably find it, or parts of it, online if you looked. Of course you do want the second edition, the original is a bit dated but the 2nd ed covers ANSI C which is basically the lowest-common-denominator of what all compilers support these days.

The folks who frequent Freenode's ##c can be a bit off-putting for someone who just wants a simple question answered (and rightly so; they're busy people) but if you have a specific, carefully-worded question to ask they will always have the correct answer (and a citation from the standard to back it up). Their wiki also has some good links to useful resources.

Finally a bit of my opinion to leave a sour taste in your mouth. C is a lot of fun to program in once you've done it for a while and have stopped making the common mistakes. It's unforgiving: you have to be both precise and accurate in what you're telling it to do; if you just sort of fake it (which you can get away with in some languages) you'll find that it actually causes the most frustrating problems.

BTW, you may or may not (I don't know what's installed on Macs by default) already have a great reference for the C standard library installed, in the form of manual pages. When you're not sure what a command or function does, instead of going straight to Google, try opening a terminal and typing 'man command' (without the quotes). As an example, check out the web-based version of the manual page for printf(3).
Saving the world, one kilobyte at a time.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
May 14 2012 02:12 GMT
#65
For beginners, the objective is to learn HOW TO CODE, not how to use whatever language is the favourite this month.

Personally I would start with something that has strong string parsing like PERL or Python as trying to battle compilers while designing algorithm is not fun at all.

With that being said, C is still very influential, Java, C#, Objective C all derived their syntax from C, but seriously though, Syntax and Keywords should be the least of your concern as a programmer.



Rillanon.au
olabaz
Profile Blog Joined April 2009
United States298 Posts
May 14 2012 08:11 GMT
#66
On May 05 2012 20:02 adwodon wrote:
Show nested quote +
On May 05 2012 06:40 olabaz wrote:
On April 26 2012 06:11 adwodon wrote:
On April 24 2012 06:11 olabaz wrote:
So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here.

I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate!


I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion...

C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful.

If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language.

C is not useless for physics...


Care to elaborate?

If you want to learn physics, learn physics, don't add complex programming languages on top of that. You'll have a much easier time, and find it easier to apply something like Java to a physics undergrad course.

I'm sure you can find some use for C, but I've never come across a physicist in academia that uses C, it's not the ideal language and most physicists want to do physics, not programme, but if you think you can somehow squeeze 8 extra hours out of each day to double up your discipline then go ahead.

Why not just do a Computer Science degree?

Don't say I didn't warn you.

I agree that C isn't required to learn physics and neither is programming but, isn't that obvious? They're different fields but that doesn't mean they're mutually exclusive. Many of today's popular programs used for numerical computations were written in C like MATLAB, Mathematica, and Maple. Now sure you can learn to "program" in those but that code doesn't carry over to other languages and of course they're not as powerful until they're combined with C or another similar language.
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
May 14 2012 09:32 GMT
#67
I think it's a good idea to learn C. C is the rolemodel for most programming and C++, C#, objective-C and even Python are all derived from C since it's such a common language, if you know C, you should feel at home in most languages since constructs, key words etc were often taken from C.

Problem though, C is not all that useful anymore. If you want to code something very heavy, you'll probably use C++ instead since C++ is a superset of C, it does everything C does and a TON more (which is why C++ is a shitty language, it's just a big mix bag of poop and candy, to eat the candy, you'll still need to put poop in your mouth). If you want to code modern applications, you'll use C# or java instead because the control and speed you get from C/C++ is not all that relevant on desktops/laptops today, not even on cellphones. Atm, I don't think pure C is used much outside of operating systems, both for PCs and machines.

I definitely think you should go ahead and get a good C book though. Learning C is a good investment since it teaches a lot of the concepts of programming without added abstraction. You can learn proper object oriented programming etc later on, when you know how loops, variables and such work.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
Last Edited: 2012-05-14 11:14:09
May 14 2012 11:11 GMT
#68
On May 14 2012 18:32 Tobberoth wrote:
I definitely think you should go ahead and get a good C book though. Learning C is a good investment since it teaches a lot of the concepts of programming without added abstraction. You can learn proper object oriented programming etc later on, when you know how loops, variables and such work.


You can learn the basics in just about any language, it makes absolutely no difference at rudimentary level. A loop is a loop in C or ruby.

Coding is about problem solving. Solve the problem first then start coding.

With that being said, it isn't immediately clear what OP's goal is, if application programming is the goal then C is perhaps not the most efficient starting point however C is a very influential language both in design and usage.

If OP only need a basic level of programming knowledge to compliment his degree then he should invest time into what ever tool his field uses e.g. Python is used for a lot of science projects, lisp in AI research...

Rillanon.au
]343[
Profile Blog Joined May 2008
United States10328 Posts
Last Edited: 2012-05-14 12:28:30
May 14 2012 12:20 GMT
#69
If OP has no experience programming, I think Python is a pretty gentle introduction to "thinking like a programmer." It does provide lots of really nice (though a bit slow) high-level stuff that a lower-level language like C won't; list comprehensions and dynamic typing come into mind immediately. But Python is intuitive enough that we have an annual "Python spelling bee" at our school each winter, where contestants have to dictate (easy-ish) Python code without looking at a screen...

N.B. "low level" means "more control over the fine workings of the computer," whereas "high level" means "more large-scale, abstract tools." Both have their uses, and often higher-level languages [e.g. Python] are built over low-level languages [e.g. C]. C will help you learn a bit more about the workings of the computer--pointers, memory allocation, etc. Supposedly learning C helps you learn the huge plethora of C-like languages rather quickly. But again, if you've never done any coding, I think a higher level of abstraction will benefit you a lot.

Also, I feel like Java is a very... overburdened (???) language, in that it forces huge amounts of verbosity everywhere, since Java code is often meant to be enterprise code (or just shared development in general.) It's sort of a compromise between C and Python in terms of how much nice stuff it does for you automatically (garbage collection, object-oriented stuff, etc.)

Edit:
On May 05 2012 18:35 Abductedonut wrote:huge post on C

Oops, if OP really just wants to learn C, this post on page 3 seemed pretty decent.

Edit2: Wow I suck at reading threads, woo!

Anyway, to practice (and if you like math/algorithms), you can consider doing things like USACO training, TopCoder, and Project Euler. (Don't have to compete in the contests; just do the practice problems for fun!)
Writer
Normal
Please log in or register to reply.
Live Events Refresh
Next event in 7h 23m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko619
SpeCial 208
ProTech36
MindelVK 23
JuggernautJason10
StarCraft: Brood War
Calm 5084
Bisu 3449
Shuttle 1906
Flash 1366
Rain 1337
Jaedong 1227
firebathero 776
EffOrt 680
ZerO 448
Soulkey 362
[ Show more ]
BeSt 268
ggaemo 245
Rush 199
hero 137
Hyuk 117
Mind 100
Barracks 80
Snow 79
Nal_rA 69
Hyun 62
sorry 58
[sc1f]eonzerg 52
JYJ41
TY 35
zelot 31
Aegong 29
Sacsri 20
Terrorterran 19
scan(afreeca) 19
HiyA 13
ajuk12(nOOB) 8
IntoTheRainbow 7
Dota 2
Gorgc11285
syndereN536
XcaliburYe304
Counter-Strike
flusha178
Super Smash Bros
Westballz33
Other Games
gofns8734
FrodaN1146
hiko668
Mlord507
Beastyqt362
RotterdaM215
KnowMe184
Liquid`VortiX152
ArmadaUGS110
Trikslyr54
ZerO(Twitch)17
fpsfer 0
Organizations
StarCraft 2
angryscii 0
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• iHatsuTV 7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV541
League of Legends
• Nemesis3071
• Jankos1117
• TFBlade503
Counter-Strike
• Shiphtur18
Upcoming Events
Replay Cast
7h 23m
LiuLi Cup
18h 23m
BSL Team Wars
1d 2h
Team Hawk vs Team Dewalt
Korean StarCraft League
1d 10h
CranKy Ducklings
1d 17h
SC Evo League
1d 19h
WardiTV Summer Champion…
1d 20h
Classic vs Percival
Spirit vs NightMare
CSO Cup
1d 23h
[BSL 2025] Weekly
2 days
Sparkling Tuna Cup
2 days
[ Show More ]
SC Evo League
2 days
BSL Team Wars
3 days
Team Bonyth vs Team Sziky
Afreeca Starleague
3 days
Queen vs HyuN
EffOrt vs Calm
Wardi Open
3 days
RotterdaM Event
3 days
Replay Cast
4 days
Afreeca Starleague
4 days
Rush vs TBD
Jaedong vs Mong
Afreeca Starleague
5 days
herO vs TBD
Royal vs Barracks
The PondCast
6 days
Liquipedia Results

Completed

Jiahua Invitational
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSLAN 3
CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.