EverCrest Message Forums
You are not logged in. Login or Register.
Author
Topic: GODDAMN COMPILER!!!
Burger
BANNED!
posted 02-04-2003 04:08:05 AM
I hate the typing in C. The damn thing is inflexible as all hell, and the compiler our school uses has the most useless error messages.

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!!!

Bite me.

No, Really. Bite me.

Bummey the Fool
Prefers to play with men
posted 02-04-2003 04:12:43 AM
And this, my friend, is why I hate programming.
Valso the WhiteDragon
Pancake
posted 02-04-2003 09:15:06 AM
Yeh, complier error messages suck ass. Half the time with this POS Java compiler I use, I just look at the line right before the line it says the error is on.

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!?!?";'

Cherveny
Papaya
posted 02-04-2003 10:12:39 AM
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)

Burger
BANNED!
posted 02-04-2003 02:34:51 PM
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.

Bite me.

No, Really. Bite me.

Cherveny
Papaya
posted 02-04-2003 03:12:14 PM
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.

Random Insanity Generator
Condom Ninja El Supremo
posted 02-04-2003 03:14:17 PM
I'll just stick to abusing PHP and let my mind rot.
* NullDevice kicks the server. "Floggings will continue until processing power improves!"
-----------------------------------
"That was black magic, and it was easy to use. Easy and fun. Like Legos." -- Harry Dresden
-----------------------------------
That's what playing Ragnarok Online taught me: There's no problem in the universe that can't be resolved by the proper application of daggers to faces.
Blindy
Roll for initiative, Monkey Boy!
posted 02-04-2003 03:18:50 PM
On a plane ride, the more it shakes,
The more I have to let go.
Burger
BANNED!
posted 02-04-2003 05:10:41 PM
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 ]

Bite me.

No, Really. Bite me.

Drysart
Pancake
posted 02-04-2003 09:53:10 PM
I hate C. I can tolerate C++. They're both intensely crappy languages for 90% of code written.
Naimah
In a Fire
posted 02-04-2003 09:57:45 PM
I'll take C/C++ over VB any day. Doing anything more then putting things to the screen in VB is a royal pain in the ass.
Burger
BANNED!
posted 02-04-2003 11:44:50 PM
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.

Bite me.

No, Really. Bite me.

Nina
posted 02-04-2003 11:46:54 PM
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.

Drysart
Pancake
posted 02-04-2003 11:56:45 PM
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 ]

Naimah
In a Fire
posted 02-04-2003 11:59:03 PM
C is only a couple of levels up from asembly. This makes it very fast and gives it an almost absurd amount of flexibility. 'Higher Level' languages like VB and Java normall run themselves through another level before they actually get to doing anything. For instance Java uses a virtual machine so that it can be better at cross platform combatibility while sacrificing performance. VB is actually just a really nice way to access API's. In the end both of these programs end up going through C in some way which is then borken down into assembly.

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.

Drysart
Pancake
posted 02-05-2003 12:09:52 AM
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.

Naimah
In a Fire
posted 02-05-2003 12:11:54 AM
So would a better semantic be 'goes through assembly?'
Palador ChibiDragon
Dismembered
posted 02-05-2003 12:12:13 AM
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.

I believe in the existance of magic, not because I have seen proof of its existance, but because I refuse to live in a world where it does not exist.
Iulius Kaesar
Pancake
posted 02-05-2003 12:14:47 AM
Your average C compiler (read: gcc; I don't know about others) works by translating the code straight into assembly and turning that into machine code. As languages go, it's a fairly easy process. You can parse it using recursive descent, which is a huge plus when you've got a new chip and are trying to haul yourself up by the bootstraps. I don't know if it's ANSI but quite often you can jam your own assembly statements directly into the code (in an asm{} block).

That said, it's ugly, obtuse, and fast as hell. I think of it like knitting.

Naimah
In a Fire
posted 02-05-2003 12:17:16 AM
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.

Drysart
Pancake
posted 02-05-2003 12:21:20 AM
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 ]

Iulius Kaesar
Pancake
posted 02-05-2003 12:24:59 AM
quote:
Naimah had this to say about the Spice Girls:
Workability should almost always take precedence in runtime speed.

I'm not terribly partial to knitting either.

[Edit]Drysart wins:
"The most important thing is picking a language that fits the project."

[ 02-05-2003: Message edited by: Iulius Kæsar ]

Burger
BANNED!
posted 02-05-2003 12:35:34 AM
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.

Bite me.

No, Really. Bite me.

Drysart
Pancake
posted 02-05-2003 12:44:34 AM
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.

Burger
BANNED!
posted 02-05-2003 03:35:07 AM
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)

Bite me.

No, Really. Bite me.

Valso the WhiteDragon
Pancake
posted 02-05-2003 03:47:51 AM
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.
Burger
BANNED!
posted 02-05-2003 04:42:23 AM
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...)

Bite me.

No, Really. Bite me.

All times are US/Eastern
Hop To: