Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

.NET

Divided by a Common Language


Verity is the pseudonym of a programmer based in the UK.


Species: Old Men of the C

Stamping ground: Embedded system shops, Linux generally, and the GNOME desktop project in particular.

Spore:

#include "header.h"

#define DIMENSION 1

struct intstruct{
int i1;
int i2;
} is[DIMENSION];

int fn(int** a1, int*** a2) {
int a3, a4;
double d;
char *m;
int ******p;
int i,j,k,l,m;

for(a3=0;*a1[a3]!=**a2;
a3++,a2+=a3,(*a1)--)
/* nothing */;

Regrets: The removal of static as a keyword applied to functions.

Most enviable vice: Guilt-free (type)casting.

Mating call: You do as you like, but I don't trust the compiler doing stuff behind my back.

What to do if one becomes trapped in the house: Bless their little cotton socks! (Cotton socks worn, of course, with sandals.) This is a harmless and usually amiable species, once very widespread, but now sadly somewhat declined. Treat it gently, and see if you can get it to take a saucer of warm gin.

Species: Microsoft Soviet Era

Stamping ground: Wherever you may find five-year-old Windows projects.

Spore:

BOOL CVeryBigClass::GetResult()
{
BOOL bBoolResult = (
GetScaryApiInfoEx(
m_hHandle,
m_nNumber,
m_lpszString,
NULL,
NULL,
NULL,
NULL,
// Many more lines of NULLs
// omitted for brevity
NULL)) ? TRUE : FALSE;
if (bBoolResult == TRUE)
return TRUE;
else if (bBoolResult != TRUE)
return FALSE;
else
return FALSE;
}

Mating call: MFC always was underrated. It's very, very powerful, once you understand it properly.

Guilty secret: Hopes that Microsoft will give up on 'all this .NET malarkey. I mean, it may be all right for you people, but in our line of business we really need that front-end performance. C#, pah!'

Really daring thing it does for a lark: Edit the AFX_MSG_MAP block generated by the ClassWizard, in open defiance of the official comment prohibiting this.

What to do if one becomes trapped in the house: They can be driven off effectively and humanely using the Stobbo patent SoftieScarer, which gives off the musty odour of MCSD Exam 70-016 (discontinued). A snip at $200.

Species: Confused Putative STL User

Stamping ground: Small independent programming shops, where C++ is not the main language.

Spore:

// Yes! Yes! Yes!
// More Meg Ryan noises!!!
// Got find_if to work!!!!!

Chns::iterator itChan =
find_if(chns.begin(), chns.end(),
bind2nd( cmpWrap() , name));

// ...

// Found this string trim on the Net
// that uses 'find_first_not_of'
// It has a bug - throws if no trimmable
// chars.
//
// But at least it compiles, and it
// *is* very elegant. So am keeping it
// here commented out, in case
// some day I figure out how to
// fix it

Guilty secret: Continues to use the Singleton pattern, despite its fall from grace in more fashionable circles.

Mating call: Did I tell you about my milkshake trait? It brings all the boys to the yard.

Unconvincing attempt to mix it with hard-core C++ techies: What, are there really punters who don't care a fig about the Standard? And are quite content if something just works with their compiler? Well. I'm very shocked, I can tell you. Shocked.

Another way to catch it out: Yes of course I use the Boost Graph Library. I love its 3D pie charts.

Reason for notable familiarity with this species? You wouldn't perhaps belong... Mind your own business.

Species: The League of TMPers

Stamping ground: The specialist newsgroups.

Spore:

// factorial
template <int N>
struct fact {
enum { res = N * fact<N - 1>::res };
};

template <>
struct fact<0> {
enum { res = 0 };
};
// initialise j to 8!
int j = fact<8>::res;

Progenitor: In 1994, Erwin Unruh turned up at a C++ standardisation meeting with a program that didn't compile, but which output a sequence of prime numbers in its compilation error messages.

Evolution: Ten years later, many TMP programs now compile. There again, not that many.

Notable characteristic of Template Meta-Programming programs: Computation is done at compile time not runtime.

Mating call: My compile time is longer than yours.

Where do they come from, these meta-programmers? Those kids, the ones who were given 'My Little C++ Compiler' for their seventh birthday, have grown up.

Wait a moment. Your 8 factorial evaluates to 0 instead of 40320. You want a '1' in the template specialisation. Oh, leave me alone, clever clogs.

You're sore because these TMPers are smarter than you. I admit it. I am envious, to envy level nine. You will recall that the envy scale is logarithmic.

Pathetic challenge: If they are so clever, let's see them write a GUI dialog with this technique. A complex one with lots of tabs and maybe a slider. And make it look nice.

What to do if one becomes trapped in the house: If you can possibly do so without putting yourself at risk, open the front door and see it run friskily out onto the snow—black on white, black on white, black on white, and then gone.

DDJ


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.