I hate "C" code
-
Sit down and take a deep breath until your heart beats normally again. I was not serious, this is the sopabox after all. ..and im sooo bored. :) /M
- Don't sweat the petty things, and don't pet the sweaty things.
Man, do not do that to me, I nearly had a heart attack !!! Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Yes, those fucking defines. The only one i ever use is
#define private public
in my stdafx.h when i have to work with code from the other monkeys. /M
- Don't sweat the petty things, and don't pet the sweaty things.
:wtf: Max. But then I read the other answers ! :-D
-
In hindsight, probably not. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Yes, those fucking defines. The only one i ever use is
#define private public
in my stdafx.h when i have to work with code from the other monkeys. /M
- Don't sweat the petty things, and don't pet the sweaty things.
-
Yep, MFC does it for debug builds snippet from some code I had laying around
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifIt works because to my knowledge the preprocessor does all of its work before anything language specific gets handled. James - out of order -
-
Yes, those fucking defines. The only one i ever use is
#define private public
in my stdafx.h when i have to work with code from the other monkeys. /M
- Don't sweat the petty things, and don't pet the sweaty things.
-
I saw this at work last week:
#define void int
:wtf::omg: That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig. [Christopher Duncan on how to prevent yourself from ending up in a sig] -
Ugh. That's pretty fucked up right there...! Shog9 ------
Rather hammer futiley at the locked door than just sit and ignore it. Obviously finding a way to get through the locked door would be even better though. - Paul Watson, My Ignorance
I wish I could just give him/her a smack-upside-the-head with a "what were you thinking foo!?" :-D That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig. [Christopher Duncan on how to prevent yourself from ending up in a sig]
-
I saw this at work last week:
#define void int
:wtf::omg: That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig. [Christopher Duncan on how to prevent yourself from ending up in a sig]hmmmm Interesting I think I can find some uses for that, " In other peoples code " :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.
-
#define DoubleFloat double
typedef double *DoubleFloatPtr;
typedef double **DoubleFloatPtr2D;
typedef double ***DoubleFloatPtr3D;
typedef double ****DoubleFloatPtr4D;What the hell is a DoubleFloat, a double, a float, a double precision float ? hell no, it's simply a freaking double !!! and
void someFuc ( const void * const * const args )
{
...
}First time I read this, my first reaction was, whoa, there's some missing comma and parameters there, I even was looking for old C style parameters !!! X| X| X| Max
Maximilien wrote: void someFuc ( const void * const * const args )
args
is a constant pointer, to a constant pointer to constantvoid
. You have no reason to write code like this except for the IOCCC[^]. ;) --Mike-- "alyson hannigan is so cute it's crazy" -- Googlism Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm -
Yep, MFC does it for debug builds snippet from some code I had laying around
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifIt works because to my knowledge the preprocessor does all of its work before anything language specific gets handled. James - out of order -
Actually, I think it works because new is a function which can be overloaded and overridden. "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
-
:wtf::omg::omg::wtf: I hate typedefs, the place I see them most is used to obsfucate STL code. I'm sure they have uses, but I'm equally sure that this isn't it.... Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
Christian Graus wrote: I hate typedefs, the place I see them most is used to obsfucate STL code Hoooooold your horses mate.
template <typename T, int SIZE>
class array {
T arr[SIZE];
/* more stuff here */
public:
typedef T* iterator;
typedef const T* const_iterator;iterator begin(); iterator end(); /\* and some more stuff \*/
};
also
class SomeClass {
typedef std::list<SomeType> SomeTypeContainer;
typedef SomeTypeList::iterator SomeTypeContainerIterator;void SomeMethod() { SomeTypeContainerIterator i = m\_list.begin(), end = m\_list.end(); //std::list<SomeType>::iterator i = m\_list.begin(), ... while(i != end) { // Do magic } }
};
typedef hides implementation details, and it may save a lot of typing (ponder the case where you figure you want to replace std::list with std::vector for whatever reason. A lot less to change in the code if you typedef it). It's not all obfuscated. -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer
-
Sit down and take a deep breath until your heart beats normally again. I was not serious, this is the sopabox after all. ..and im sooo bored. :) /M
- Don't sweat the petty things, and don't pet the sweaty things.
Haha! I'll have to try that trick some day... ;D Another interesting trick would be to
#define public private
and see if the other programmers will figure out what the hell is wrong. Muhahah! I think I'll have some fun at work some day :) -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer -
Actually, I think it works because new is a function which can be overloaded and overridden. "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
No. It's just like James T Johnson says. The preprocessor handles the text before it passes it on to the compiler. -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer
-
I saw this at work last week:
#define void int
:wtf::omg: That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig. [Christopher Duncan on how to prevent yourself from ending up in a sig]Now that can't have any validity. Unless it's used to drive someone else to insanity.. :) -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer
-
Haha! I'll have to try that trick some day... ;D Another interesting trick would be to
#define public private
and see if the other programmers will figure out what the hell is wrong. Muhahah! I think I'll have some fun at work some day :) -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer -
Christian Graus wrote: I hate typedefs, the place I see them most is used to obsfucate STL code Hoooooold your horses mate.
template <typename T, int SIZE>
class array {
T arr[SIZE];
/* more stuff here */
public:
typedef T* iterator;
typedef const T* const_iterator;iterator begin(); iterator end(); /\* and some more stuff \*/
};
also
class SomeClass {
typedef std::list<SomeType> SomeTypeContainer;
typedef SomeTypeList::iterator SomeTypeContainerIterator;void SomeMethod() { SomeTypeContainerIterator i = m\_list.begin(), end = m\_list.end(); //std::list<SomeType>::iterator i = m\_list.begin(), ... while(i != end) { // Do magic } }
};
typedef hides implementation details, and it may save a lot of typing (ponder the case where you figure you want to replace std::list with std::vector for whatever reason. A lot less to change in the code if you typedef it). It's not all obfuscated. -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer
Jörgen Sigvardsson wrote: It's not all obfuscated. when I said Jörgen Sigvardsson wrote: the place I see them most is used to obsfucate STL code I did not mean they were useles altogether, just that they get used to do more harm than good most of the time. I should have said I hate the misuse of typedefs, I did not mean to imply all typedef use is bad. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Or for some real fun
#define ; //
:-D /M
- Don't sweat the petty things, and don't pet the sweaty things.
If you make a lot comments, then
#define ; ;//
would be ideal, wouldn't it? -- standing so tall, the ground behind no trespassers, on every floor a garden swing, and another door she makes it clear, that everything is hers A place of abode, not far from here, Ms. Van de Veer