|
Useless looking code. What was your colleague thinking?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: What was your colleague thinking?
"Almost weekend..."
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
dnh wrote: "Almost weekend..."
Yes, or...
"Hmmmm, 4:45 Friday, I'll delete the dead code Monday" ( and gets sidetracked with a Monday morning meeting )
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: thinking
Can he? He should have been in an inebriated state right?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Quite possible...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hey would u please send me the source code of peer to peer internet caching.as iam an engg student and iam doing a project on that re.so please send me the source code of it ok.send to my id
rameez_313 @yahoo.com
|
|
|
|
|
I think you have incorrect place to post.
|
|
|
|
|
First of all, hello. I'm a newbie. Since this section is called Coding Horrors, I thought it would be funny to share this C++ header file I wrote a few days ago:
http://www.geocities.com/fruitcake59/Prototype.txt[^]
The following tokens are actually macros: name , type , state , stype , parent , ptype , base , nodeclare , notserial . The two first ones (name and type ) MUST be defined before including Prototype.h. The other ones are optional.
If you see something like this...
<q style="color: black"><q style="color: blue">#ifdef</q> SOME_TOKEN<br />
SOME_TOKEN<br />
<q style="color: blue">#undef</q> SOME_TOKEN<br />
<q style="color: blue">#endif</q></q>
... then SOME_TOKEN is also an optional macro that can be defined before including Prototype.h.
Here's an example of how to use this header file:
<q style="color: black"><q style="color: green">
<q style="color: blue">#pragma once</q><br />
<br />
<q style="color: blue">#pragma region</q> Class Names<br />
<br />
<q style="color: blue">#define</q> name CInstruction<br />
<q style="color: blue">#define</q> type INSTRUCTION<br />
<q style="color: blue">#define</q> state CInstrState<br />
<q style="color: blue">#define</q> stype INSTRSTATE<br />
<q style="color: blue">#define</q> parent mpParent<br />
<q style="color: blue">#define</q> ptype CModule<br />
<q style="color: blue">#define</q> nodeclare<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> Friendships<br />
<br />
<q style="color: blue">#define</q> CONST_FRIENDSHIPS \<br />
<q style="color: blue">friend class</q> CModule; \<br />
<q style="color: blue">friend struct</q> MODULE;<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> Data Structures<br />
<br />
<q style="color: blue">#define</q> VAR_ATTRIBUTES \<br />
CStringList slParams;<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> Constructor<br />
<br />
<q style="color: blue">#define</q> CONSTRUCTOR \<br />
CInstruction(CModule *mpParent); \<br />
CInstruction(CModule *mpParent, CString &sName);<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> Object Operations<br />
<br />
<q style="color: green">
<q style="color: blue">#define</q> CONST_GETTERS \<br />
GET_COUNT() \<br />
GET_CHILD(GetParameter, GetParamSt, CString, )<br />
<br />
<q style="color: blue">#define</q> CONST_DOERS \<br />
<q style="color: blue">void</q> EditParameter(INT_PTR i, LPCTSTR s);<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> State Operations<br />
<br />
<q style="color: green">
<q style="color: blue">#define</q> VAR_GETTERS \<br />
GET_CHILD_COUNT(slParams) \<br />
GET_CHILD_STATE(GetParamSt, CString &, slParams)<br />
<br />
<q style="color: green">
<q style="color: blue">#define</q> VAR_DOERS \<br />
ADD_CHILD_STATE(AddParamSt, LPCTSTR, slParams) \<br />
EDIT_CHILD_STATE(EditParamSt, LPCTSTR, slParams) \<br />
DELETE_CHILD_STATE(DeleteParamSt, slParams)<br />
<br />
<q style="color: green">
<q style="color: blue">#define</q> COPY_STATE \<br />
COPY_LIST(slParams)<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#pragma region</q> Private Tools<br />
<br />
<q style="color: blue">#define</q> CONST_TOOLS \<br />
<q style="color: blue">void</q> AfterParamUpdate();<br />
<br />
<q style="color: blue">#pragma endregion</q><br />
<br />
<q style="color: blue">#include</q> <q style="color: red">"Prototype.h"</q></q>
|
|
|
|
|
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Good one, fruitcake.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Justin Perez wrote: Good one, fruitcake.
At least I get the joke
|
|
|
|
|
leppie wrote: At least I get the joke
Oh good. I was actually thinking everyone might miss the reference from the OP
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
is that a joke
indians are good programmers
|
|
|
|
|
sammyamma wrote: is that a joke
indians are good programmers
All Indians? We've come across our fair share of duffers here on Code Project.
|
|
|
|
|
The quote in my sig? Yes, the guy who made the comment made it as a joke. The joke isn't about all Indians. Take a look around the forums for a day or 2 and you will see that there are some bad apples.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Brainware Error - reboot required.
|
|
|
|
|
|
This reminds me of my first CS class back in the 70s. The professor gave us an assignment to parse free form numeric input strings. Any valid number was fair game, integers, floats, exponents, etc. We all shuffled off to the ribbonless keypunch machines to enter our creations (without the assistance of the interweb and ‘I needs codes now. Urgent’ forums). A week later we returned to class each with massive stacks of FORTRAN code and bruised egos as nobody was able to get it to work for all cases.
He then presented his solution using an FSA and a few lines of code. After the initial shock and urge to shove said deck of cards down the professors throat, it turned out to be a great lesson on the power of table driven programs.
|
|
|
|
|
As some guy wrote in commentaries:
AVF wrote: I'm sorry, but that rocks. It may not be the kind of code you want in production, but from a mathematical/CS point of view, it's just cool.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
wrote: thinking less lines is faster
Geeze, we leave it up to the compiler to optimize stuff.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: Geeze, we leave it up to the compiler to optimize stuff.
Of course, the less lines you write, the easier it is for the compiler to optimize the code
|
|
|
|
|
At least someone here has a hammer he *really* knows how to use. And obviously he has no trouble to find enough nails for it...
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
In this semester I've got a new subject: "Object-oriented programming".
* We learn how to bypass Visual C++ 6.0 compiler bugs (yes we use it).
* To show good OOP practices, we are told that a Student class should contain a non-static Write method which does not take any arguments. This method should write content of all Student objects from an array (stored as a global variable) to a file with a hard-coded name "student.bz" in a very plain text format.
* All class names must definitely begin with 'C' and structures with 'T'.
* Public members like 'fil' (FileName), 'st' (Student) or 'c' (Count) are perfectly o.k. and there is no need to comment them anywhere.
* Finally, our knowledge is tested by writing a code snippet on a sheet of paper. You missed a semicolon or an #include directive -- sorry you fail.
Sweet.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
What does your post have anything to do with Coding Horrors?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Visual C++ 6.0 compiler bugs (yes we use it).
maybe this.
"Love thy neighbor....................
..Whenever your marriage in in trouble"
|
|
|
|