The C language

Re: The C language

Post by TheMindRapist on Tue Feb 24, 2009 7:10 pm
([msg=18591]see Re: The C language[/msg])

STUDIOny wrote:Meh, I am struggling to choose myself, over C and C++.
I just see so many topics that say C++ is just C, but better, which makes me tend to think I should go C++.
So what if its a little harder, Is there any point learning C over C++, other than its easier?

The real thing you should be thinking about is why you are wasting time deciding which language to learn, when you could be actually learning.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: The C language

Post by STUDIOny on Tue Feb 24, 2009 7:18 pm
([msg=18594]see Re: The C language[/msg])

TheMindRapist wrote:
STUDIOny wrote:Meh, I am struggling to choose myself, over C and C++.
I just see so many topics that say C++ is just C, but better, which makes me tend to think I should go C++.
So what if its a little harder, Is there any point learning C over C++, other than its easier?

The real thing you should be thinking about is why you are wasting time deciding which language to learn, when you could be actually learning.


So you just randomly picked a language to learn, without choosing, and making a decision on what to learn?

EDIT: I am sorry if my post came across as rude, wasn't intended.
STUDIOny
Experienced User
Experienced User
 
Posts: 73
Joined: Thu Feb 05, 2009 7:40 pm
Location: Newtownards, Northern Ireland
Blog: View Blog (0)


Re: The C language

Post by cen on Tue Feb 24, 2009 7:52 pm
([msg=18602]see Re: The C language[/msg])

Brilliant post cen, very helpful I must admit.


Thanks - I just hope that it still proves true after a few days... It's all up to interpretation and what your NEEDS are. ;)

Hugely because you said, You will not understand a lot of C code if you start with C++, Which I thought you would.


True, yet false - With time, you'll quickly begin to see the differences/similarities between nearly all languages, there are some exceptions to this rule (like COBOL - What a headache that mess is!) But nevertheless, it's really just a matter of picking out the functions you don't understand and looking them up for that language. 90% (or whatever) of the time you'll likely look at it for a second and go - Oh, document.write in javascript is basically a printf statement in C!

This is why SO MANY people suggest C as a base - C DOES teach nearly ALL THE ASPECTS of most languages (EVEN Object Oriented Programming - Yes, you can do this with C also to some degree - Use struct instead of class). And you can usually relate C quite well to other languages, whereas, if you begin with something like javascript, where you don't need to release memory, this concept can be very confusing when you try to use C or another language that REQUIRES you to release the memory, and it begins to feel like you're starting all over again. Learning C will teach you all the basics, allowing you to CONFIDENTLY move onto other languages with little fuss - It's up to you to interpret the similarities in the other languages you choose to learn. But the similarities are there, even in COBOL... ;)

Most books will also refer to C as a base for understanding that specific language also.

I thought it was similar, but after checking out some code, I do see the difference. If I start with C, it will be easier, I will have good Knowledge, then when I do decide to learn C++ it will be much easier.


This is true to some degree, but if you NEVER intend on using C, and your company ONLY codes in C++, then learning C won't actually help, it will merely slow you down and confuse you during that awkward time when you're trying to remember the differences between multiple languages. It can also teach you BAD programming habits...

I'm not sure about learning PHP first tho, I think for myself, I should learn C and C++ first, then PHP will be pretty much easy, seeing as its quite similar.


Also true, but I personally think there is MUCH more to gain from PHP today than C - You can implement it almost immediately once you learn it and likely even make money from it very fast. But hey - To each his own... ;)

There IS one more aspect that I haven't seen mentioned in this topic yet - C is old, C++ is old, few people are using them today. Most companies are using .NET or coding for the net (PHP/ASP, etc...).

It all depends on what YOU want to get from your code - Personally, I think it's better to start off with a language that you intend to use the most. Which unfortunately, can be quite hard for someone new to determine. But in some situations it's clear (like the example above where you code for a company that ONLY uses C++ or Delphi, or Cobol, then learning C is really just a waste of time).

I was taught many languages in college, but when I left and worked at my first programming position, I HAD to learn Delphi - Starting from scratch all over again... It never ends... :(

Each language you 'take on' brings you that much closer to realizing how similar all these languages REALLY are and that a person can really start anywhere - It really all depends on their needs.

THE BEST place to start would be a programming concept book - One which teaches you ALL the aspects of programming, but details nothing. Example: A book that explains WHAT loops and arrays are, decision making structures (if/switch etc..) classes, variables, functions, scope, debugging, etc... Understanding what these concepts are IS MUCH MORE important than learning a language - With this as a base, you could literally choose any language you wanted to start with.

Admittedly though, I've NEVER seen an actual good book like this. Someone really should make one.

Don't be scarred to PM me if you're having issues with learning C or whatever language you choose to learn, I'll try to help you out with understanding some of those concepts if you wish.

Good luck - Programming ROCKS - I don't care what language you're using... :D
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: The C language

Post by TheMindRapist on Tue Feb 24, 2009 8:12 pm
([msg=18605]see Re: The C language[/msg])

STUDIOny wrote:
TheMindRapist wrote:
STUDIOny wrote:Meh, I am struggling to choose myself, over C and C++.
I just see so many topics that say C++ is just C, but better, which makes me tend to think I should go C++.
So what if its a little harder, Is there any point learning C over C++, other than its easier?

The real thing you should be thinking about is why you are wasting time deciding which language to learn, when you could be actually learning.


So you just randomly picked a language to learn, without choosing, and making a decision on what to learn?

EDIT: I am sorry if my post came across as rude, wasn't intended.

Actually, the first language I learned I learned in school, so it was chosen for me.
However, in this case he seems to have been debating between two very similar languages for a fair amount of time. He will likely end up learning both, and I do not think the order in which he learns them is so important that it justifies this amount of indecisiveness.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: The C language

Post by dwmead03 on Tue Feb 24, 2009 8:19 pm
([msg=18609]see Re: The C language[/msg])

TheMindRapist wrote:Actually, the first language I learned I learned in school, so it was chosen for me.
However, in this case he seems to have been debating between two very similar languages for a fair amount of time. He will likely end up learning both, and I do not think the order in which he learns them is so important that it justifies this amount of indecisiveness.


Well if he is deciding to learn both, the obvious choice is C over C++. Therefore making the question pointless.
User avatar
dwmead03
New User
New User
 
Posts: 30
Joined: Mon Apr 14, 2008 11:34 pm
Location: KY
Blog: View Blog (0)


Re: The C language

Post by cen on Tue Feb 24, 2009 9:49 pm
([msg=18617]see Re: The C language[/msg])

Actually, the first language I learned I learned in school, so it was chosen for me.


I think this happens to a lot of people. I also began in school, and my language was actually BASIC on a Commodore. I was in grade 3, I asked my teacher how to make a game, and he handed me a book that was on a shelf and said - Go type that into the computer over there - After a couple of minutes of him telling me how to make the code, I began typing the 12 lines that seemed to take an eternity.

I didn't have a clue what I was typing, but I couldn't wait to see this 'cool' game I was building. The pictures were so neat!

Boy was I disapointed... ;) haha

But with time, I began to understand those lines and created my own games and programs. Especially once I got my own computer in grade 4 (Tandy 1000) and discovered that it too had Basic! Different though - GW-BASIC, and I had to learn to migrate my coding, but with time I was VERY happy with the switch. I was programming with graphics/animation in no time. I even made a program that I used to 'draw' pictures with to use in my games. I was so proud of it - Quite similar to MS Paint supplied with Windows today I guess, with all those basic features. I was so proud of the fact that I got it to 'zoom'.

Well if he is deciding to learn both, the obvious choice is C over C++. Therefore making the question pointless.


He sounds like someone who eventually wants to learn everything he can, which is why I would agree about this. But the order he learns them can certainly be important, and C may not always be the right choice.

But I would agree with MindRapist, if there really is no 'real reason' behind learning the languages, other than just to learn them, then he should just pick up a book and read it - He'll likely read both books cover to cover anyways. He'll be more than confident about deciding where to go after that.

C++ will teach him good proper programming techniques which are used daily in todays world. C is great, and still far from useless, but it's *almost* like suggesting that someone begin learning GW-Basic as opposed to Visual Basic without any real reason backing it up other than to learn Basic. There will be MANY bad programming habits obtained by learning GW-Basic, and many of the techniques used will be obsolete, especially in todays world were OOP plays such a key role in how we design software these days. You just couldn't code effeciently today like that:

10 screen 6,0,0,32655
20 cls
21 color 2
25 y=5
30 locate(5,y)
40 print "Hello World"
50 y=y+5
60 if( y<=20) then goto 30

etc...

Sorry if the code is incorrect, I haven't used Basic in forever, I'm sure the basic idea is made obvious though...

Clearly if we switched the topic from C to Basic, then NO one would likely suggest starting out with Basic when it's so useless in today's society. The line numbers alone are enough to drive most people mad.

For someone who doesn't know better, this IS a perfectly valid question. And by just changing the language in question there is an obvious difference.

The only dumb question is the one that isn't asked... ;)
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: The C language

Post by STUDIOny on Wed Feb 25, 2009 6:43 am
([msg=18640]see Re: The C language[/msg])

Your right, I do want to learn as much as possible, about everything. I'll just read books on both subjects, and learn both. Having an understanding of both languages couldn't harm ;)
STUDIOny
Experienced User
Experienced User
 
Posts: 73
Joined: Thu Feb 05, 2009 7:40 pm
Location: Newtownards, Northern Ireland
Blog: View Blog (0)


Re: The C language

Post by dwmead03 on Thu Feb 26, 2009 12:24 pm
([msg=18730]see Re: The C language[/msg])

cen wrote:
Actually, the first language I learned I learned in school, so it was chosen for me.


I think this happens to a lot of people. I also began in school, and my language was actually BASIC on a Commodore. I was in grade 3, I asked my teacher how to make a game, and he handed me a book that was on a shelf and said - Go type that into the computer over there - After a couple of minutes of him telling me how to make the code, I began typing the 12 lines that seemed to take an eternity.

I didn't have a clue what I was typing, but I couldn't wait to see this 'cool' game I was building. The pictures were so neat!

Boy was I disapointed... ;) haha

But with time, I began to understand those lines and created my own games and programs. Especially once I got my own computer in grade 4 (Tandy 1000) and discovered that it too had Basic! Different though - GW-BASIC, and I had to learn to migrate my coding, but with time I was VERY happy with the switch. I was programming with graphics/animation in no time. I even made a program that I used to 'draw' pictures with to use in my games. I was so proud of it - Quite similar to MS Paint supplied with Windows today I guess, with all those basic features. I was so proud of the fact that I got it to 'zoom'.

Well if he is deciding to learn both, the obvious choice is C over C++. Therefore making the question pointless.


He sounds like someone who eventually wants to learn everything he can, which is why I would agree about this. But the order he learns them can certainly be important, and C may not always be the right choice.

But I would agree with MindRapist, if there really is no 'real reason' behind learning the languages, other than just to learn them, then he should just pick up a book and read it - He'll likely read both books cover to cover anyways. He'll be more than confident about deciding where to go after that.

C++ will teach him good proper programming techniques which are used daily in todays world. C is great, and still far from useless, but it's *almost* like suggesting that someone begin learning GW-Basic as opposed to Visual Basic without any real reason backing it up other than to learn Basic. There will be MANY bad programming habits obtained by learning GW-Basic, and many of the techniques used will be obsolete, especially in todays world were OOP plays such a key role in how we design software these days. You just couldn't code effeciently today like that:

10 screen 6,0,0,32655
20 cls
21 color 2
25 y=5
30 locate(5,y)
40 print "Hello World"
50 y=y+5
60 if( y<=20) then goto 30

etc...

Sorry if the code is incorrect, I haven't used Basic in forever, I'm sure the basic idea is made obvious though...

Clearly if we switched the topic from C to Basic, then NO one would likely suggest starting out with Basic when it's so useless in today's society. The line numbers alone are enough to drive most people mad.

For someone who doesn't know better, this IS a perfectly valid question. And by just changing the language in question there is an obvious difference.

The only dumb question is the one that isn't asked... ;)


I don't necessarily agree with your statement about BASIC. BASIC was one of the first languages I learned, but I haven't touched it for 7 years. That is until about two months ago when my company (a controls engineering company) landed a contract with a re-control of a system. I was required to rewrite the BASIC code for a PLC module. It was easy enough getting back into BASIC, but I had the OOP mindset. I put the code in pseudo-functions (GOTO statement that ends with another GOTO statement that returns to the calls point). This ended up causing me a problems because I failed to realize how slowly BASIC executes. Anyway, my point is that BASIC is used in the real world, and I believe it is better to learn languages like C and BASIC in the beginning before jumping into OOP programming. It may not be necessary to spend the amount of time on C and BASIC that you would want to spend on C++ and VB, but I think it's simpler for someone without programming experience to start programming with languages that aren't focused around OOP.
User avatar
dwmead03
New User
New User
 
Posts: 30
Joined: Mon Apr 14, 2008 11:34 pm
Location: KY
Blog: View Blog (0)


Re: The C language

Post by cen on Thu Feb 26, 2009 6:21 pm
([msg=18746]see Re: The C language[/msg])

At this point in the game, Basic is like Cobol, but worse. At least with Cobol there are still TONS of companies locked into the need of modifying/updating/upgrading their old code. I'm sure that few companies are dealing with this as an issue with Basic and if they are - I would certainly expect them to upgrade instead of modifying if the program needs a change, if they don't do it now, it will be THAT MUCH HARDER to find someone to modify it later. It could be nearly impossible to find someone to do this in the next 10-15 years for another future update (assuming the update is not an extremely minor one). Which is exactly why those companies using Cobol ARE rebuilding their programs. They KNOW that Cobol is DIEING, no one really wants to use it. Yes, they still provide it, yes it is a nice neat GUI these days just like Delphi/C++/VB etc... But who *really* wants to use Cobol??? The only reason why it's still here is because like C - Much of the code is proven to work - And to change SO MUCH code is expensive and time consuming.

I only know of one person who is still religiously using Cobol - And he's so damn lost in the times it's pathetic. He doesn't see the advantages that the more accepted languages are providing. And is almost incapable of using them. He sticks with Cobol because it is what he knows. He's part of a slowly dieing era. Hell, I wouldn't even be surprised if it generally boils down to 'job security' combined with the lack of wanting to learn another language again.

C is dieing out with the introduction of OOP as well, but still has SO MUCH tied to it, even more so than Cobol , that it may never disappear, the advantage it has over Cobol is that there is so much example code out there using C and it STILL applies, usually with minor tweaking (if any) with a newer language like Delphi or C++. C/C++ is simply more backward/upward compatible.

In my opinion C and Basic are not comparable, they're complete opposites in this type of discussion. Basic is so old and so rare that it IS a waste of time unless you're bored or have an actual reason to pick it up again (like you did). Basic barely even resembles VB, many of the commands don't even exist anymore in VB or have changed, the concepts/structure of how you code is completely different. C is much more closely knit to C++ and therefore still useful - Especially in Unix/Linux environments where C is still quite common. More importantly, the C code that is available has usually been highly tested and time-proven.

On the other hand, Quick Basic/Qbasic, etc... IS much closer to VB than BASIC/GW-BASIC and is closer to being compared together like C/C++. BASIC/GW-Basic, is just too old. This type of coding is extremely rare these days.

but I think it's simpler for someone without programming experience to start programming with languages that aren't focused around OOP.


Simpler maybe, but absolutely counter-productive.

I think it will confuse them - Especially when so rarely used these days. They're better off just learning proper programming habits and learn the differences *if* necessary. If you're gonna backtrack, backtrack with C - Leave the other languages alone unless required or you're simply just bored and like to learn everything.

We are literally at the end of an era, things are changing. The old ways are getting updated and are actually 'applied' less and less - Almost to the point of complete extinction in some situations - BASIC is definitely on this list for me. And I would never take a job coding Cobol. There are just better and easier ways of doing things today. That's not even getting into the fact that it's faster/cheaper to design, and easier to organize/troubleshoot.

Keep in mind though, this is from a 'newbies' perspective. I fully believe that each language you take on can only make you a better programmer. But from a newbies stand-point, it's confusing and will take them MUCH longer to produce software trying to figure out the differences. Stick with what's common, stick with what's accepted. Stick with what's being used by the masses. This way you can waste your time reading about other things when you're bored and are already a competent programmer in at least one language - Instead of wasting time when you should be focusing on something more standardized.

A newbie can produce software within a year easily - But if side tracked by all these older languages, just figuring out the differences could take them 5 years (or whatever). Yeah, it will make them a better programmer knowing the differences, but what a waste of time when you could have been making money off of your skills using just one language. Especially when they'll likely learn those other differences with time anyways.
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: The C language

Post by TheMindRapist on Thu Feb 26, 2009 7:05 pm
([msg=18762]see Re: The C language[/msg])

I would agree with cen in that it is better to form good coding habits early.
Trying to change your coding style to OOP after learning something else will be a waste of time.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


PreviousNext

Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests