News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Should I learn C?

Started by Avarice, November 23, 2008, 07:32:28 PM

Previous topic - Next topic

Avarice

If a person knows ASM, is there a point to learning C afterward? I would think that anything you do in C takes the same amount of time in ASM?

Glenn9999

It depends on whether you want to learn C or not for most part.  C, as most High-Level Languages have the purpose to try and simplify the expression of programming algorithms.  In other words, C should take much less time than assembler, both to get up to speed, and to develop functional algorithms.  In fact, most of the high-level languages were developed to address certain productivity deficiencies with ASM programming (machine efficiency high, programmer efficiency low).

On the other hand, if you are wondering if C would be a good thing when it comes to ASM, the answer is yes.  Generally that is because of the ten ton gorilla that is always in the room, Microsoft - it's their favored language (not to mention the Linux gearheads).  If you want to have much to do with the Windows API in any language, you need knowledge of C (and sometimes OO C++) to be able to understand the API documentation to interface with it.

I'm not sure if that's what you needed to know or not, but hopefully that helps some.

Avarice

I guess what I want to know is, is it worth the effort of learning? I don't want to manage ASM, C++, and Java; and then learn C. If I split my attention to all these different languages then I won't ever master one. I heard that C is a step above ASM in terms of being low-level and I want to know is it worth learning C. I wouldn't like to give up on C++ or Java because C++ is good for game programming, and Java is good just because there are lots of job opportunities for it. I want to be convinced I don't want to learn another language.

Glenn9999

Quote from: Avarice on November 24, 2008, 02:03:19 AM
I guess what I want to know is, is it worth the effort of learning? I don't want to manage ASM, C++, and Java; and then learn C.

If you know C++ already, you know C.  Does that answer your question?

gwapo

Quote from: Glenn9999 on November 24, 2008, 02:06:27 AM
If you know C++ already, you know C. 

I don't think so. I'm a C++ programmer, but I don't know C as much as I know C++  :dazzled:

:bg

-chris

Glenn9999

Quote from: gwapo on November 24, 2008, 03:04:45 AM
I don't think so. I'm a C++ programmer, but I don't know C as much as I know C++  :dazzled:

Maybe my understanding is incorrect?  As my understanding goes, C++ is a language upgrade to C (the ++ being the increment operator in C) which mainly brought C into being an object-oriented language.  Fundamentally, my understanding was always that
you could throw a correct source program developed in C into a C++ compiler and have it (basically) work right - in other words, much of C++ is fundamentally the same as C.  In other words, one who knows C++ knows C, but one who does know C doesn't necessarily know C++ (especially Object-Orientation).

http://en.wikipedia.org/wiki/C%2B%2B

Vortex

Hi Avarice,

If you decide to learn C, have a look at Pelles C. It's a free C development tool set with a nice IDE :

http://www.smorgasbordet.com/pellesc

gwapo

Quote from: Glenn9999 on November 24, 2008, 03:17:40 AM
Maybe my understanding is incorrect? 

Hi glenn,

You're right, but there are many things in C that's not C++.
http://www.research.att.com/~bs/3rd_compat.pdf

But most of it are compatibility issues that are easy to forget, especially if you're a lazy programmer like me  :bg

Cheers,

-chris

thomas_remkus

C is not C++. Look to the articles that are posted from the author of C++ and his comments will tell you that C++ is not "a better C" but a different language. It's too common a mistake. From the horse's mouth, he considers them two different languages.

ecube

Pelles C is the best lightweight compiler/ide ive found, it's truely a work of art. As far as your question, yes it's a great idea to learn c while programming with ASM aswell because it definitely does simplify things. Some things i've wanted to do i've struggled greatly trying to do it in masm(even though asm is my favorite language) so I just wrote it in c, compiled as a static link library and linked right into masm, problem solved.C also makes writting cross platform code alot eaiser, if you ever want to take that route.

vanjast

I'd learn as much as I can - understanding more languages gives you better insight into programming techniques (good or bad), as well as been more versatile in the job market.

The only problem you'll have, for example - is mixing the different language syntax's while editing your code. And you'll have to re-arrange your brain into that particular language syntax while coding.  :bg

Mark Jones

Quote from: Avarice on November 24, 2008, 02:03:19 AM
...I heard that C is a step above ASM in terms of being low-level and I want to know is it worth learning C...

Greetings. Curious, have you considered the marketability of both? Are you programming for fun, or profit? Because there is little market for assembly programmers, and C is the de-facto standard... so if you wanted to make a living from programming, then C is going to be a much better choice. (And likewise, if you just enjoy programming, then consider each equally -- many here use C/C++ for the bulk of an application, and use assembler for the speed-critical parts.)

C is nothing like ASM, even though people in the high-level-language crowd sometimes ironically refer to it as being "close to the hardware." Compared to say, Visual Basic, C is indeed much "closer" to working with the computer's hardware... but still C is vastly different from manipulating the registers and processor instructions as is done in assembler.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Avarice

I might like to become a computer engineer, so assembly would help to understand the hardware. I thank you guys for your advice and I will think about it for a while.  :clap:

GregL

#13
Avarice,

If you already know C++, it's not a big deal, just a matter of learning the differences.

Learning assembly language is one of the best things you can do to improve your programming skills.


[edit] added link.


Farabi

Avarice:
Why not learning C++? But if you understand about MASM you will automatically understand C++ because for me it is similiar. The only different is C++ return value can be defined as a structure and on MASM  is will only just a dword. I suggest you to studying C++ because there are many great open source software created with C++, its good for your skill. Try MinGW with Code::Blocks IDE.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"