• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Learning C And Associated Languages

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Culbrelai

Member
Joined
Oct 25, 2012
So, I'm a Freshman at the University of Michigan... Going for a Bachelors in Software Engineering... yippe.

I want to to learn a bit early, as sort of a head start...

Since all of these BS high-school esque classes are beginning to make me angry. I went to college to learn what I want to learn, not some balanced humanities nonsense fabricated to allocate money for shiny new Rolls Royces for University Regents...

So to start I bought this book

http://www.amazon.com/gp/product/0470596902/ref=oh_details_o03_s00_i00

as Visual Studio seemed the best start for someone who is bad at math (like me, although from what I've seen so far vocational programming has little math, yet dealing with game physics seems to have the MOST)

Not really far through it yet...but

Now I'm realizing I may not be getting the full picture... is this really the best way to start, with visual C#? and not C++, or C? A quick search yeilded its the easiest variation of C to learn...

I have lots of ambitions... I want to create my own firewall, I want to create Windows OS addons and modifications (to make it look more like XP, and be uniquely mine, not something I downloaded in two seconds)

Sure I realize that these will not come easily nor soon... but...

What do you reccommend? Should I get a begnniners C book and start with Notepad? Or...?
 
There is no "best" language to start with. Some argue that starting with higher level languages to get the basics down is best (i.e. Java), where others argue the opposite. People learn differently, so no one is right.

I would suggest understanding the basics of programming logic, as it will apply to nearly every programming language in existence. Once you understand one, others come much easier.

The first language I was taught was Visual Basic, which is absolutely terrible. After that, I learned C++ by creating programs in Linux and doing things on my own. The convenient part about popular languages is there are a ton of guides and help online.
 
At my school, we learn object-oriented programming starting with Java, and then we learn data structures and algorithms also using Java. I think Java's a good way to start learning how to program, as it's a very easy language. The IDEs are great (I love programming in Eclipse, it is massively convenient and the built-in debugger is also fantastic), the language is very forgiving, and you can do anything you really need to, as far as learning how to think algorithmically.

Similarly easy to learn on is C#, but I think Eclipse (and NetBeans) are much better IDEs than Visual Studio. C# and VS are nice, though, to deal with GUI development within Windows.

I think it's a good idea to learn on a Java/C# level language first, and then move to something like C++ or even C after you've nailed down algorithmic thinking/problem solving. Then learning the structures of the underlying device/computer you're programming for is the only new thing you're learning (as in, pointers, pointer arithmetic, and all the associated low-level structures that you don't have access to in Java and similar). Once you learn the low-level stuff that you get out of languages like C, you'll simultaneously gain a deeper understanding of higher-level languages like Java.

For some background, the first time I did any real programming was my freshman year (I'm in junior year now, so not too long ago), where I took my school's intro OO-programming course. The course was extremely easy, and the following programming course I took was the ECE program's intro data structures/algorithms course, which was actually useful :D Both of these courses were in Java, and through them I gained a fondness of programming as well as much experience.

Last semester I took a computer hardware course, in which we did a little bit of MIPS assembly language. This semester, I'm taking a computer systems course where we are coding mainly in C (not C++), with a little bit of assembly tossed in there. I just more-or-less finished my last project, which was to design a simulator that runs MIPS assembly instructions through a simplified MIPS pipeline, which we had to design and code (the program as it stands right now is somewhere around 2000 lines of code). We had no real instruction on how to code in C, we were just given assignments and a due date, and then were done with lectures. Learning C was not difficult, and the only new concept I learned was how to deal with pointers (something you can't do in Java). I have grown to like C more than the rest (or perhaps, C++, though I've never explicitly used C++). As an EE guy, though, C is of more use to me than most, since C's main use in the current day is for embedded systems.

Given you're entering software engineering, C is not as important to you; C++, however, is. I'd just get a firm grasp on OO-programming, and then jump between languages as necessary. It could also be beneficial to learn other programming paradigms (for instance, functional programming), but I've got nothing to say about that, since I'm only familiar with OO.
 
^ I would also recommend Java as a starting point. It's possible to learn good object oriented design with C++, but I think the odds that you'll pick up bad habits are a little higher.
 
At my school, we learn object-oriented programming starting with Java, and then we learn data structures and algorithms also using Java. I think Java's a good way to start learning how to program, as it's a very easy language. The IDEs are great (I love programming in Eclipse, it is massively convenient and the built-in debugger is also fantastic), the language is very forgiving, and you can do anything you really need to, as far as learning how to think algorithmically.

Similarly easy to learn on is C#, but I think Eclipse (and NetBeans) are much better IDEs than Visual Studio. C# and VS are nice, though, to deal with GUI development within Windows.

I think it's a good idea to learn on a Java/C# level language first, and then move to something like C++ or even C after you've nailed down algorithmic thinking/problem solving. Then learning the structures of the underlying device/computer you're programming for is the only new thing you're learning (as in, pointers, pointer arithmetic, and all the associated low-level structures that you don't have access to in Java and similar). Once you learn the low-level stuff that you get out of languages like C, you'll simultaneously gain a deeper understanding of higher-level languages like Java.

For some background, the first time I did any real programming was my freshman year (I'm in junior year now, so not too long ago), where I took my school's intro OO-programming course. The course was extremely easy, and the following programming course I took was the ECE program's intro data structures/algorithms course, which was actually useful Both of these courses were in Java, and through them I gained a fondness of programming as well as much experience.

Last semester I took a computer hardware course, in which we did a little bit of MIPS assembly language. This semester, I'm taking a computer systems course where we are coding mainly in C (not C++), with a little bit of assembly tossed in there. I just more-or-less finished my last project, which was to design a simulator that runs MIPS assembly instructions through a simplified MIPS pipeline, which we had to design and code (the program as it stands right now is somewhere around 2000 lines of code). We had no real instruction on how to code in C, we were just given assignments and a due date, and then were done with lectures. Learning C was not difficult, and the only new concept I learned was how to deal with pointers (something you can't do in Java). I have grown to like C more than the rest (or perhaps, C++, though I've never explicitly used C++). As an EE guy, though, C is of more use to me than most, since C's main use in the current day is for embedded systems.

Given you're entering software engineering, C is not as important to you; C++, however, is. I'd just get a firm grasp on OO-programming, and then jump between languages as necessary. It could also be beneficial to learn other programming paradigms (for instance, functional programming), but I've got nothing to say about that, since I'm only familiar with OO.

Java... I see. That must be why in High School they had a few classes with it but I thought it was beneath me =P

So, stick with C# for a bit then go to Java then try C++?
 
C# is an oddball comparatively to many other 'beginner' languages. I personally wouldn't jump right into C# until you have a well-rounded understanding of programming in general, and at least the knowledge of one other language under your belt. Once you understand the concepts of programming, teaching yourself a new language is generally just a matter of learning the syntax differences.

Java is a really powerful language that is supplemented by a couple wonderful IDEs (Netbeans and Eclipse). Honestly, I'm not a huge fan of it. There aren't really any viable reasons why, I just don't prefer to use it unless I have to.

Personally, I started with C++ (though I dabbled in other stuff like batch scripting and AutoIt long before actually taking any courses and learning proper technique or fundamentals.) I'm partial to it, so I'd recommend start here.

Also, if you don't plan on using an IDE, at least do yourself a favor and get a nice text editor like Notepad++ or Sublime. :)
 
Java... I see. That must be why in High School they had a few classes with it but I thought it was beneath me =P

So, stick with C# for a bit then go to Java then try C++?

As pcgamer said above, perhaps C# wouldn't be the best option. I think it's just as easy/easier as/than Java (given I learned it completely on the spot coding a real application for my internship last summer, with absolutely no help besides StackOverflow/MSDN/Google), but Java is definitely more helpful when you have errors (compile- or run-time errors alike). For the year or so I spent coding in Java, I became extremely fond of Eclipse and it's built-in debugger, and would recommend getting it and learning how to use it (alongside coding). Among the IDE being helpful for learning syntax/common naming conventions for Java, learning how to use it's debugger will definitely give you a deeper understanding of the code you're running and how it's execution is progressing. Knowing this (and in general, how to use debuggers) is beneficial to all programming languages and applications.

So, in short, my suggestion would be to start with Java, but if for some reason you don't want to, C# should be just as manageable. I'll also add that I think you will probably have more luck finding work if you move on from Java into something like C++. I've also been seeing a huge amount of listings looking for people who know Ruby as of late.

Also, if you don't plan on using an IDE, at least do yourself a favor and get a nice text editor like Notepad++ or Sublime. :)

+1! Since I've been spending all my time this semester coding in C, Notepad++ has become one of my most valuable assets. I code in Notepad++, and compile/run my C code using gcc via Cygwin's x11 package.

I think an IDE is absolutely essential to coding (sure, I can code without auto-completion, keyword highlighting and indentation/folding, but what reason is there to not use these beautiful things?! :p). Especially when you're learning, it'll help you learn syntax and give you warnings/hints on issues you may have with your code, so you can focus on logic and not semantics of the language you're using.

In case it hasn't been emphasized enough, the language you're coding in is of little to no importance for learning general programming. It's all more or less the same once you learn common programming practices. These practices change depending on your target environment (personal programs, console-based, GUI, embedded systems, etc) or programming paradigm.
 
Java can be very friendly to a novice, learning how to search through javadocs can be a pain in the *** though. C# is not bad but I would definitely suggest C# express(VS2011 lite version) as an environment for that. Theres no compelling reason not to use a high quality IDE when your first learning. Debugging tools will actually tell you what crashed rather than you staring blankly at your code without a hint where the issue is. Auto complete, quick help, intellisese etc DO NOT make you a bad programmer and they actually save alot of time when your searching for a method/function and your not sure what class / object you need to ask without having to google it.

C++ is generally considered an excellent starting language because its so strict with everything, but it can be very frustrating if you dont have someone to help point out the little errors.
 
Alright... so... I'll probably end up finishing my C# book (It's like having homework on top of my 4 classes... gotta find the time to work on what I wanna work on though...)

and then maybe moving to Java and then perhaps C++...

Strict things tend to not work well with me, like the entire program failing because you missed a friggin ; for christs sake -_- If the last line in the code has the final closing } then it should know that the damn ; is supposed to go at the end of the line... Sigh.
 
Alright... so... I'll probably end up finishing my C# book (It's like having homework on top of my 4 classes... gotta find the time to work on what I wanna work on though...)

and then maybe moving to Java and then perhaps C++...

Strict things tend to not work well with me, like the entire program failing because you missed a friggin ; for christs sake -_- If the last line in the code has the final closing } then it should know that the damn ; is supposed to go at the end of the line... Sigh.

You'll quickly learn that syntax errors are your best friends. Strict language rules make programming much easier, I think Java's strong typing makes it much easier for a beginner to learn.

Real debugging isn't finding syntax errors (the compiler will tell you that directly, and a good IDE will tell you as you're coding), but logic errors. If/when you get to C or C++, you'll know the pain of coding a program, having it compile perfectly, then you run it and you answers don't come out correct, or worse, you run the program and get a segfault with no indication of where your code failed or why. :)
 
Yeah, thats happened to me before, i made a simple degrees c to degrees f and reverse converter and the answers would come out wrong, turns out because i missed the order of operations in the formula, it needed a parenthesis. Last thing you said sounds scary tho lol, probably would be the same process when that happens after i modded a game, go back and remove the newest things you added untill you find the ******* code
 
Strict things tend to not work well with me, like the entire program failing because you missed a friggin ; for christs sake -_- If the last line in the code has the final closing } then it should know that the damn ; is supposed to go at the end of the line... Sigh.
Try writing a compiler and you'll have a bit more sympathy for the language. :) If attention to detail frustrates you, programming is going to be an exercise in frustration.
 
Try writing a compiler and you'll have a bit more sympathy for the language. If attention to detail frustrates you, programming is going to be an exercise in frustration.

Life is an exercise in frustration...
 
You'll quickly learn that syntax errors are your best friends. Strict language rules make programming much easier, I think Java's strong typing makes it much easier for a beginner to learn.
Amen.

There are few things more frustrating in the process of learning a language than getting compile-error after compile-error. However, those errors do an amazing job of pounding the language into your head. They also detect entire classes of problems that would cause problems at runtime. As much as I love Python, I hate discovering that I've flubbed some function call only when then interpreter actually tries to execute it.

JigPu
 
Sorry to jump in here.

I am also starting programming. My college days are gone as I graduated 2 years ago and just now realizing I wish I majored in CS. I started learning PHP a year ago and stopped. This year I have some time between work and life. I picked up C programming. I figured learning the older languages will teach me more about how hardware and compiling works. Its not OOP but I figure it will teach me the fundamentals of programming. Eventually I would like to get into multi-core/parallel processing (CUDA). I love programming and problem solving.
Do you guys think learning C is a better start or C++? I know Visual Studio is a great IDE but there are workarounds to program in C with the VS 2012 Express. Buy workaround I mean saving files in .C extension :) I use Code Blocks right now with the GCC compiler. Its actually really nice.

1) Will C teach me better fundamentals than C++?
2) Is OOP more desired in the workforce?
3) Learning algorithms and logic...is that a better route to do first or learn a language?

I have a long path to being a programmer as a job. I am currently learning VBA at my work for excel. It nice. How likely is it to land Junior level programming job without and CS degree? I have a 4 year degree from a good school just not in CS. I am not a genius and I am honestly just OK in math. I have to teach CS to myself as going back to school is expensive for me.
 
As far as learning the fundamentals there's no difference between C and C++. If you ignore classes and objects C++ IS C. Visual Studio is not just a C++ tool, its Microsoft's developer tool. It supports SQL server stuff, C, C++, C#, ASP just to name a few. There's a free version called "Visual <your language here> Express" you can download from their site.

The only places your going to find that DONT want Object Oriented programming are going to be embedded and legacy systems. Unless you want to program task specific devices you want to learn AND understand objective design.

This question is a chicken or the egg situation. You CANT write algorithms without first knowing the basics of the language, but you can implement them without alot of background experience..
 
TBH I don't really think there is a lot of math in programming, just certain kinds of programming (like physics, Excel, etc)

Lot of my school counselors scared kids away from programming (or game design) by using the math-method =P
 
Video game design requires a ****load of math. Given alot of it is writing the math function once and then calling it thousands of times, but still complex programs will require math. If your doing game design(non simulation) the worst you will get into is simple trigonometry, and mid level algebra.

Any kind of finance application will require use of compounding functions, and ultra deep decimal precision rounding.

When you get to scientific and simulation programming the entire box of math is on the table. Everything from calculus to multidimensional matrices.

Regardless you need to understand how program logic works, and how to make objects interact with each other in a reliable hierarchy, but before that you need to be able to create functions, loops, and conditional statements.
 
Math isn't just matrices, equations and numbers; programming and algorithms in itself is a form of math.

I also do not agree about the "chicken/egg" situation, algorithms and languages aren't intertwined. You can know an entire language by heart and still be an awful problem solver. Algorithms are infinitely more important, since you can always use a reference/IDE to aid you with a language, but you need to develop your own solutions algorithmically.
 
Math isn't just matrices, equations and numbers; programming and algorithms in itself is a form of math.

I also do not agree about the "chicken/egg" situation, algorithms and languages aren't intertwined. You can know an entire language by heart and still be an awful problem solver. Algorithms are infinitely more important, since you can always use a reference/IDE to aid you with a language, but you need to develop your own solutions algorithmically.


Agreed. Definitely need to know math especially for video game development. Couple of my friends graduated with Computer Science and Electric Engineering degrees. They did more math and physics than programming. Math is everything especially when it comes to functions and loops. I don't expect to be a game developer. Id like to do more research bound programming. Building UIs and programs that analyze data based on input. I really like research and the programming side will help me build applications. I most likely will brush up on some math. For now I have a C programming book so I will learn that then jump into C++. Currently learning VBA also and I really like it.

What do you guys all think of CUDA or multi-core processing? I did some research and its great. I feel CUDA will be more adopted by companies since it really speeds up processing time by harnessing the GPU Cores. Nvidia also offer certification in CUDA via passing an exam.
 
Back