Frikken spend 3 hours trying to find what was wrong, turns out i missed an asterisk on one of my lines.
Program finally compiled.
DIE C!!!
No, Really. Bite me.
At least it isn't a run time message, where you could spend tons of time doing 'cout << "Did I make it this far? Did this work!?!?";'
If you want a better error checker for C source, look for a copy of lint, a free C source code pre-processor that will look for both true errors as well as code that is technically correct but not a good idea. You can't really ask for more verbose output that what it gives. It really gives you a good chance to clean up your code.
But, also can be much, much worse. At work, I deal with a tool that uses a superset of ANSI-C. Problem is, because it's a superset, can't use a standard compiler, must use the tools. The tool's ONLY error message for compiling is "script error". Usually the error message is also misplace by several hundred lines. (In a program of 10s of thousands of lines)
quote:
So quoth Cherveny:
Heh, first time I've ever heard C be called inflexable. C++ is more the inflexable one as C, if properly done, can let you do just about anything.If you want a better error checker for C source, look for a copy of lint, a free C source code pre-processor that will look for both true errors as well as code that is technically correct but not a good idea. You can't really ask for more verbose output that what it gives. It really gives you a good chance to clean up your code.
But, also can be much, much worse. At work, I deal with a tool that uses a superset of ANSI-C. Problem is, because it's a superset, can't use a standard compiler, must use the tools. The tool's ONLY error message for compiling is "script error". Usually the error message is also misplace by several hundred lines. (In a program of 10s of thousands of lines)
Well, you can do ANYTHING in C, but you need to be careful how you do it.
The way that C is inflexible is in the typing. Try assigning an int to a long? ERROR. Most other languages will let you get away with a litle slip like that.
No, Really. Bite me.
quote:
The Burger had this to say about Punky Brewster:
Well, you can do ANYTHING in C, but you need to be careful how you do it.The way that C is inflexible is in the typing. Try assigning an int to a long? ERROR. Most other languages will let you get away with a litle slip like that.
code:1 main()
2 {
3
4 int a;
5 long b;
6
7 a=1;
8 b=2;
9
10 b = (long)a;
11 }
With typecasting, anything is possible. Often not recommended, but possible.
code:1 main()
2 {
3
4 int a;
5 long b;
6
7 a=1;
8 b=2;
9
10 b = (long)a;
11 }
With typecasting, anything is possible. Often not recommended, but possible. [/qb]<HR></BLOCKQUOTE>
firstly, you forgot to return a value form main, so it won't compile, second, you aren't assigning an int to a long, you're converting an int to a long, and then assigning that value to a long, there is a difference. [ 02-04-2003: Message edited by: The Burger ]
No, Really. Bite me.
quote:
Everyone wondered WTF when Drysart wrote:
I hate C. I can tolerate C++. They're both intensely crappy languages for 90% of code written.
I will agree with you wholeheartedly there, but the sad fact is that you can do pretty much anything with C, not necessarily easily, but it's possible, and if you have a good grounding in C, you can pick up pretty much any other language in a matter of weeks.
The only real reason i'm learning C is because it's part of my degree requirements.
No, Really. Bite me.
quote:
Drysart wrote this then went back to looking for porn:
I hate C. I can tolerate C++. They're both intensely crappy languages for 90% of code written.
But why are most games, programs and whatever written in C/C++ rather than something else? Care to elaborate, I'm curious.
quote:
Tier had this to say about Captain Planet:
But why are most games, programs and whatever written in C/C++ rather than something else? Care to elaborate, I'm curious.
Inertia. Everyone learns C in college, the operating system is written in C, so the APIs are defined in C syntax, so C is the "default" language everyone uses for larger scale projects; whether it's the best tool for the job or not.
A handful of Windows games have been written in other languages, but not many.
And as far as software as a whole, C likely does not hold the crown there. Most business development, which accounts for a large, large share of development, is done in languages like Delphi and (yeech) VB. [ 02-04-2003: Message edited by: Drysart ]
The reason assembly isn't just used is because it is incredibly abstract and makes C look like HTML.
I'm fairly shure that most of that is strait on, though don't be afraid to correct me.
quote:
Naimah wrote, obviously thinking too hard:
In the end both of these programs end up going through C in some way which is then borken down into assembly.
Saying they "go through C" is a bit misleading. Neither VB nor Java is converted to C at any point before they run. The Java VM and VB compilers are both written in C (or C++), but that doesn't really mean anything, they could be just as easily written in any other language and still perform the same purpose.
quote:
A sleep deprived Naimah stammered:
The reason assembly isn't just used is because it is incredibly abstract and makes C look like HTML.
Assembly is love.
That said, it's ugly, obtuse, and fast as hell. I think of it like knitting.
quote:
Iulius Kæsar was listening to Cher while typing:
That said, it's ugly, obtuse, and fast as hell. I think of it like knitting.
Workability should almost always take precedence in runtime speed. Compilers are ultra efficient now adays and in most occasions will write assembly cleaner then you would.
quote:
Verily, Naimah doth proclaim:
So would a better semantic be 'goes through assembly?'
Sometimes. And sometimes it just "goes right to machine code", because that's what assembly compiles down to.
The details of how a high level language gets down to a form that runs on the bare metal is mostly academic, though. In order from fast to slow: either something runs right on the CPU itself, like C, Pascal; or it runs right on the CPU with some supporting libraries, like VB; or it runs on a virtual CPU, like Java, Perl, and any MSIL-targetted language (though even that's not so simple... even virtual machine instructions can be JITted down to pure machine code too, like MSIL does, and some Java VMs do).
The most important thing is picking a language that fits the project. Even if what you decide on is slower than C, if you can develop it faster and easier you're winning in the long run because programmer time is much, much, much more expensive than CPU time. [ 02-05-2003: Message edited by: Drysart ]
quote:I'm not terribly partial to knitting either.
Naimah had this to say about the Spice Girls:
Workability should almost always take precedence in runtime speed.
[Edit]Drysart wins: [ 02-05-2003: Message edited by: Iulius Kæsar ]
"The most important thing is picking a language that fits the project."
quote:
Nobody really understood why Drysart wrote:
The most important thing is picking a language that fits the project. Even if what you decide on is slower than C, if you can develop it faster and easier you're winning in the long run because programmer time is much, much, much more expensive than CPU time.
agreed, but sometimes, runtime does matter, as in server apps (espescially database apps) even gaming applications runtime is a large concern, because if your code is 5% more efficient in accomplishing a goal, then it may be worth the extra 20% of programming time.
No, Really. Bite me.
quote:
The Burger was listening to Cher while typing:
agreed, but sometimes, runtime does matter, as in server apps (espescially database apps) even gaming applications runtime is a large concern, because if your code is 5% more efficient in accomplishing a goal, then it may be worth the extra 20% of programming time.
Not so much in database apps, since your main bottleneck there is probably going to be the database. That's why Java is so popular on the server these days. It's fast enough.
As far as gaming, that's a special case. Performance is king there. It's not that uncommon to have something written in C with hand-crafted assembly in some critical places in the code.
quote:
Drysart had this to say about Captain Planet:
Not so much in database apps, since your main bottleneck there is probably going to be the database. That's why Java is so popular on the server these days. It's fast enough.
I guess it depends on the database you're looking at...
My current C prof is teaching the course as a favour to the university, he normally teaches 4-5th year data minimg courses, does research in superlarge-databases (hundreds to thousands of gigs), and writes applications and algorythms for manipulating data on such a vast scale.
He's told us of a couple cases where he got frustrated with using someone else's precompiled code, went in and wrote his own version, and cut data manipulation times by a huge portion.
(just for reference, i'm attending one of the finest universities in north america for data-minimg)
No, Really. Bite me.
quote:
whitedragon had this to say about (_|_):
My god darn University has taut, 2 Java courses... 1 (near) Assembly course... and from here on out, I think I just learn algorithmns and techniques. They make me, in my little-to-none, freetime learn how to actually use other languages.
well, so far i've been taught Miranda and a little C, of the two, i preferred Miranda (its a function based language, very old, and very easy...)
No, Really. Bite me.