Advertisement

Which programming language is best for....

Started by September 05, 2000 11:44 PM
8 comments, last by m3k 24 years, 4 months ago
As you can see by my last thread about CD diagnostics, I''m currently building a program that relies heavily on controlling and measuring PC Hardware. Which programming language is best used to control PC hardware? Such as CD speeds, or monitoring the processor, other hardware components, and such. I''m currently learning C++. But it doesn''t seem to be good at performing such tasks.
how about COBOL that''s always fun
Advertisement
GOD DAMMIT!

I just typed a 30 or so line response and acidentally clicked the "clear fields" button ... ARRRGGG!!!

I am very tired and cannot retype my arguments as to why each language is better, but I''ll give a short synopsis.

C++ is the absolute best language for what you want to do ... with a catch. You will absolutely need to learn how to read / write pure ANSI C in addition to using C++ (because most new APIs and Librarys come with header directly compatible with C++, but most actual code in the APIs and hardware stuff (drivers etc) is written in ANSI C (not exactly the same as the C subset of C++, but almost). You will also need a basic grounding in assembly, because some things are not easily accessed using pure C/C++. Note - this is also what makes C++ ideal ... it includes C .. AND facilities for using inline assembly code (as well as simply linking to modules written in assembly).

So ... learn C++ (and object oriented programming) to write the logic and code for your programs, learn C (or how to write structured C++ programs - as well as small changes from C to C++) for accessing the many function libraries (APIs) availible, and learn a little assembly - so you will understand what the hells going on in the core of some of the driver / hardware control areas.

Good Luck.
Hi all.

I agree with Xai in all except that you need to be very good at assembly.

Although in C++ you can do everything, assembler is needed in some parts of the code because of speed issues.

Topgoro
We emphasize "gotoless" programming in this company, so constructs like "goto hell" are strictly forbidden.
Um, pure C includes features for inline asm, and linking asm...

But for accessing the PC hardware directly, depends....

If you know ASM, I''d say that would be better. If you know C (as in all of it), go with that. If you know C++, go with that, all three are fine for low-level stuff, but I assure you, you will find yourself using alot of the ANSI-C functions.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
quote: Although in C++ you can do everything


OK, write me a program that accesses the FAT directly, using zero assembly.

Trust me, if you''re going to write something that controls the hardware at the level you are describing, get some experience with ASM, and a book with info about the hardware you are going to be accessing.

Forget "low level," you''re practically describing direct access to the hardware, and only ASM (as far as I know) does that; use C or C++ with inline ASM functions.

Also, a book on CD-ROM specs for the file system would be in order, I know it doesn''t use FAT or FAT32.


"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away"--Henry David Thoreau
Advertisement
The Win32 API has functions to do the so-called "low-level" stuff. GetSystemInfo(), GetCurrentHwProfile(), and some more provide ways to get processor speeds, amounts of memory, and probably cd speeds. They may even have some to control some hardware. Who knows. Give it a try.
That was me above
quote: Original post by ImmaGNUman

Um, pure C includes features for inline asm, and linking asm...



No, the standard C language does not contain any sort of method of inserting assembly language into C code. It''s a compiler and platform specific extension.
I''ve got to vote for C/C++ also, unless you know ASM well

This topic is closed to new replies.

Advertisement