Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Why I hate c (http://www.chiefdelphi.com/forums/showthread.php?t=26085)

Astronouth7303 26-02-2004 19:55

Re: Why I hate c
 
What do you mean by "single equality sign in a conditional"? Isn't = an assignment symbol?

telkanuru 26-02-2004 20:21

Re: Why I hate c
 
Your inability to detect problems is in all likelyhood related to the self rather than the language. Personally, if I can't solve a C/C++ bug within 5-10 minutes, I ask someone who also knows it to look over the language, because they find things I miss. And good compilers do make a good deal of difference. Personally, I like C++ because I like object-oriented language, but C is better than visual whatever they were using before. You can do so much more with so much less. Plus, knowing it has broader practical applications.

Astronouth7303 26-02-2004 20:36

Re: Why I hate c
 
There's a way around that (sort of): Something I call "psuedo-objects". Basically, For each instance of the object, Copy the code and declarations and rename. And replace dots with underscores. Object_Procedure

velocipenguin 26-02-2004 21:19

Re: Why I hate c
 
Quote:

Originally Posted by Astronouth7303
What do you mean by "single equality sign in a conditional"? Isn't = an assignment symbol?

By "equality sign", I meant "equals sign".

Astronouth7303 26-02-2004 21:23

Re: Why I hate c
 
I know that, but generally isn't "If (foo=42)" what one tries to avoid?

velocipenguin 26-02-2004 22:56

Re: Why I hate c
 
Quote:

Originally Posted by Astronouth7303
I know that, but generally isn't "If (foo=42)" what one tries to avoid?

I think you missed the point.

The reason C compilers don't typically give warnings or errors for using the single equals sign inside a conditional is because it CAN be valid. In the code I posted, the single equals sign sets the address of a file handle, whose value needs to be inequal to zero in order to work. Yes, it's one of those annoying tricks used by programmers who like being clever (i.e. me), but my point is that it's valid and there's no reason the compiler should label it as a syntax error.

Ryan Cumings 27-02-2004 00:06

Re: Why I hate c
 
Some compilers will give you a warning if a condition will always be true or always be false.

Andy Baker 27-02-2004 09:07

Re: Why I hate c
 
Off topic... but I gotta say...

Alan, you made a great program. While you were at work yesterday, we started making automodes. Your software system enabled us to create 5 workable automodes within about 6 hours. These are 5 modes that work, at least on our field.

The code was so clear that even I could tweak the numbers.

To the rest of you, get this: Alan was just an interested parent who attended meetings a few months ago. We needed some more talent in the software area and he rode in on his white horse and saved the day.

Thanks Alan!! Welcome to the craziness of FIRST!

Andy B.

Greg McCoy 27-02-2004 09:45

Re: Why I hate c
 
I'm proud of Andy for working on the auto modes :)

JVN 27-02-2004 10:27

Re: Why I hate c
 
Quote:

Originally Posted by Andy Baker
The code was so clear that even I could tweak the numbers.

Andy--
That is... of the dark side of the force... forever will it dominate your destiny.
Baker is now tainted goods....


Remember kids:
Do not fall to the Spark Side. ;)

Gearboxes are more fun.

John

Steve Shade 27-02-2004 11:47

Re: Why I hate c
 
Quote:

Originally Posted by JVN
Andy--
That is... of the dark side of the force... forever will it dominate your destiny.
Baker is now tainted goods....


Remember kids:
Do not fall to the Spark Side. ;)

Gearboxes are more fun.

John

John:

Sooner or later you will learn that you can't resist the natrual urge to become one of us. We have Baker now, and you're next! *evil laugh*

Seriously, isn't C much nicer because now you Gearheads no longer have an excuse about not understanding the basic operations of the language?


Steve

jeremy562 01-03-2004 16:59

Re: Why I hate c
 
Quote:

Originally Posted by Steve Shade
John:

Sooner or later you will learn that you can't resist the natrual urge to become one of us. We have Baker now, and you're next! *evil laugh*

Seriously, isn't C much nicer because now you Gearheads no longer have an excuse about not understanding the basic operations of the language?


Steve

I am very glad to be using C this year instead of P-BASIC. Of course, I use C++ all the time so going into C mode is a lot easier for me than BASIC...

jacob_dilles 01-03-2004 17:40

Re: Why I hate c
 
Quote:

Originally Posted by jeremy562
I am very glad to be using C this year instead of P-BASIC. Of course, I use C++ all the time so going into C mode is a lot easier for me than BASIC...

and more inportantly, C is real world. basic is fine for playing around with little tabletop robots, but to do anything with anything in the real world of embeded prossesers, C is the standerd.

Astronouth7303 01-03-2004 17:56

Re: Why I hate c
 
Not to mention PCs, which may have a bigger market than embedded systems; C++ is the standard there, too (Though VB is good for a quick dev, I made a program in 10 minutes in VB).

jhnphm 07-03-2004 22:19

Re: Why I hate c
 
Quote:

Originally Posted by Astronouth7303
There's a way around that (sort of): Something I call "psuedo-objects". Basically, For each instance of the object, Copy the code and declarations and rename. And replace dots with underscores. Object_Procedure

Why? What's wrong with type_procedure(structure,parameters)?


All times are GMT -5. The time now is 00:14.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi