PDA

View Full Version : C



Lymphocyte
July 2nd, 2012, 07:47 PM
Hi,

I am starting to learn C! How long do you think it will take to get a good knowledge on it? I already know Visual Basic.net (LOL). Do you think i will get confused with the syntax of c and VB.net like when doing if statements?

in VB.net if statements go


if thisvariable = 393 then
destory Microsoft!

else
Destroy Windows

end if

AnotherMuggle
July 2nd, 2012, 08:19 PM
Everybody's ability to learn is different. If you are a strong programmer in any language you shouldn't have much trouble learning a new language.

I am primarily a C++ programmer but I can easily adapt and understand other languages.

With google at your disposal (and preferably some good books) you won't have a hard time with C (or C++).

Tony Flury
July 2nd, 2012, 09:44 PM
The biggest issue wont be the syntax changes, it will be the different approach you need to take. With C you need to do a lot more basic stuff - like worry about if your variables are big enough, allocating memory (and freeing it) etc.

AnotherMuggle
July 2nd, 2012, 09:56 PM
The biggest issue wont be the syntax changes, it will be the different approach you need to take. With C you need to do a lot more basic stuff - like worry about if your variables are big enough, allocating memory (and freeing it) etc.

This is true. I think that learning C gives you a better understanding of what is going on behind the scenes in other, higher level languages.

CptPicard
July 2nd, 2012, 10:08 PM
This is true. I think that learning C gives you a better understanding of what is going on behind the scenes in other, higher level languages.

And on the other hand, C gives you no idea as to what is conceptually possible in the more high-level languages. Most of the C-programmers that claim that they have some sort of deeper understanding of the underlying functioning of higher-level languages, don't actually understand what the higher-level languages stand for, and why.

This is the fundamental higher-vs-lower-level languages debate; we've had some really great discussions (http://ubuntuforums.org/showthread.php?t=851794&highlight=megathread)regarding this in the past. :)

trent.josephsen
July 2nd, 2012, 11:47 PM
Hi,

I am starting to learn C! How long do you think it will take to get a good knowledge on it? I already know Visual Basic.net (LOL).

So... no programming experience then? ;)

Even given some VB.NET experience, I'll still suggest learning Python first. I knew some variety of BASIC and a smattering of Java the first time I tried C and it only hurt. Learn to program, really learn to program, before you try to learn C; some of C's design decisions will make a lot more sense and you'll make better use of The C Programming Language that way.

And of the other languages that you can learn first, well, there's plenty of choices, but I think Python is a great candidate. Not that you couldn't get by with VB.NET, but honestly I don't know about the quality of the learning resources available for that language and I don't trust any BASIC to teach the fundamentals adequately.

My $0.02

11jmb
July 3rd, 2012, 02:30 AM
Hi,

I am starting to learn C! How long do you think it will take to get a good knowledge on it? I already know Visual Basic.net (LOL). Do you think i will get confused with the syntax of c and VB.net like when doing if statements?

in VB.net if statements go

As a C apologist, I welcome people who want to learn the language, but I'm often wary of their intent. Make sure that you want to learn C because of your technical interests, not because "they" told you it was a good idea.


I think that learning C gives you a better understanding of what is going on behind the scenes in other, higher level languages.

In general, I +1 CptPicard on this one. The obvious exception is for people with a technical interest in the low-level.

AnotherMuggle
July 3rd, 2012, 09:10 AM
And on the other hand, C gives you no idea as to what is conceptually possible in the more high-level languages. Most of the C-programmers that claim that they have some sort of deeper understanding of the underlying functioning of higher-level languages, don't actually understand what the higher-level languages stand for, and why.

This is the fundamental higher-vs-lower-level languages debate; we've had some really great discussions (http://ubuntuforums.org/showthread.php?t=851794&highlight=megathread)regarding this in the past. :)

Interesting debate and honestly not one I've seen raised before.

Many higher level languages are either built on or implemented in C/C++. I'm not saying a C/C++ programmer has a better understanding of those higher level languages but what I am saying is that knowing and understanding what is happening internally can be eye opening and can definitely make for a more informed programmer.

I am not missing the point of higher level languages, I use them myself and I totally get what they stand for. The thing is high, mid and low level languages all have their place and purpose and that's why each of them exist.

CptPicard
July 3rd, 2012, 10:53 AM
Interesting debate and honestly not one I've seen raised before.

It's probably the most contested issue here ever during the time I've been around for some six years or so :) It just crops up in various forms all the time. Too bad our most insightful participants in those discussions have mostly just moved on already...



Many higher level languages are either built on or implemented in C/C++. ... I am saying is that knowing and understanding what is happening internally can be eye opening and can definitely make for a more informed programmer.

The issue I take with this is in a very fundamental theoretical sense, the "underlying implementation" does not matter. We could just as well implement a C interpreter on top of Python, and knowing Python wouldn't be any more eye-opening for coding C.

Certainly C is more "special" in the sense that we need to eventually run our stuff on physical hardware, but purely conceptually speaking it does not contain anything that would "enable" implementations of HLLs, so that's why I've always been very sceptical of these claims that LLLs somehow "inform" programming in HLLs.

However, I certainly grant that I'd prefer a programmer understands both of them instead of just either or. :)

snip3r8
July 3rd, 2012, 08:35 PM
Hi,

I am starting to learn C! How long do you think it will take to get a good knowledge on it? I already know Visual Basic.net (LOL). Do you think i will get confused with the syntax of c and VB.net like when doing if statements?

in VB.net if statements go

"How long do you think it will take to get a good knowledge on it?"

well 10 years of corse:

http://norvig.com/21-days.html

"Do you think i will get confused with the syntax"

You may type the wrong thing a few times , but you will see the red underlined errors of your ways pretty quickly and call yourself an idiot(i insult myself often while coding). Learning new languages is just part of coding , I learned C# ,C++ Perl and HTML/CSS/Javascript in college , and i learned objective c on the job (i write iOS apps). My apps are already a mixed bag as i combine C++ into my objective-C whenever i can and connect to a C# based web service, i also love using perl for short little script jobs and got into apple script because "say" was just so much fun.That said , I still have 8 years to go before i can talk with real experience ,but thats a lot of languages in 2 years, FYI , i started coding with VB before college but for the life of me will never go back to that!

Lymphocyte
July 7th, 2012, 09:06 PM
so c dosent have automatic memory management like vb.net? What about C++?

MadCow108
July 7th, 2012, 09:12 PM
C++ doesn't either, but you can archive similar effects using raii (http://en.wikipedia.org/wiki/RAII) principles

and there is always the possibility to use a library providing garbage collection like libgc

if you want a C/C++ like language with automatic memory management you could use C#
it is based on the same framework as vb.net and runs under mono in *nix.

snip3r8
July 7th, 2012, 11:10 PM
What about ARC for c?

MadCow108
July 7th, 2012, 11:20 PM
assuming you mean automatic reference counting, that is not really possibly in C due to the lack of "destructors"

it is possible to some extent with compiler extensions (__attribute__((cleanup)) in gcc), but you are probably better of using a full blown garbage collector.

directhex
July 8th, 2012, 02:46 AM
C++ doesn't either, but you can archive similar effects using raii (http://en.wikipedia.org/wiki/RAII) principles

and there is always the possibility to use a library providing garbage collection like libgc

if you want a C/C++ like language with automatic memory management you could use C#
it is based on the same framework as vb.net and runs under mono in *nix.

Or he could use VB.NET, we have a compiler for that in the mono-vbnc package