Needed: Rediculously complicated C++

S

somebody

We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>

-Thanks
 
U

Uenal Mutlu

somebody said:
We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>

Here's a practical one:

Write an API (class or standalone functions) for converting any
time_t value from one local time to the local time of any other region.
It can be any datetime a time_t can hold, ie. not necessarily the
current time. For example you have a local time_t value orginated
in New York (ie. the natural time; incl. DaylightSavingTime adjustment).
The task is to convert such a time_t belonging to a region to time_t
of another region, say Berlin, including Daylight Saving Time adjustment
for the destination region.

The solution must use standard C/C++ library functions only and by
this must be portable say between Windows and Linux/Unix, and
the timezone setting of the machine must not be changed.
The DST rule for any region should be definable on the fly
(ie. via a function call), and once defined for a region it should be
treated as being constant for all times (in reality it is of course not
since the politicians of the regions decide whether, when and which
rule they want to use).
Obviously the implementation should be fast.

Sounds maybe simple to do, but it could be a challenging task.
 
E

E. Robert Tisdale

Something said:
We have a C++ programming intern at work.
Last week he introduced himself and told me that
if I have any "crappy" programming jobs needed done,
he could handle them.
Can anyone recommend some programming task
that would be ridiculously difficult?
I just want to play a joke on him as a way of saying,
"welcome to the asylum!"

Are you paying your intern to do this?

Is this hazing ritual an accepted part of initiation where you work?
 
S

somebody

Are you paying your intern to do this?

Is this hazing ritual an accepted part of initiation where you work?


He's not actually going to be writing anything -- It's a joke.
 
K

Karl Heinz Buchegger

somebody said:
We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>

A function for converting strings from uppercase to lowercase which works
for all languages (ok: just German alone would be sufficient to keep
him busy for a long time)
 
A

Abecedarian

somebody said:
We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>

Let him write a program where everywhere he could use a Boost library
he must use a Boost library. Stop the joke before he quits the job!

::A::
 
P

Peter Koch Larsen

Abecedarian said:
Let him write a program where everywhere he could use a Boost library
he must use a Boost library. Stop the joke before he quits the job!

::A::
Just out of curiosity - why all this bashing at boost, std::string etc.
Actually, as soon as you see something using templates you seem to be
negative. Why? If you do not understand templates, you could just avoid
using them - right? If you find templates to be overused somewhere it is
just as much your right to tell the developer how to solve it without using
that "weird" template stuff. But this bashing without reason is just
pointless.

/Peter
 
B

ben

I remember in the early days of learning C++ I was told to avoid templates.
And I surely disliked templates at all, given those horrors of error
messages. This is well reasoned: template is harder to understand, has to be
store in headers, potentially grow code size, etc.

But just a year ago when I started to attempt templates seriously, I found
it not only useful but more importantly, fun to play with. That's the type
of the fun when I first used Prolog--alien but facsinating! So from then on
I became template maniac. I realized that templates have very different
roles as from classes and functions. They are perfect in adapting from
interface to interface, also perfect in manipulating compound types--all
without much runtime cost because they are sorted out at compile-time.

More recently I am switched back a bit. After some serious thoughts I
realized template, like the language as a whole, just but a tool that is
only going to make my programming more productive if it is used adequately.
It is always fun to use templates, just like firework, they'd got to be
handled with care and given deep thoughts.

ben
 
A

Abecedarian

Peter said:
Just out of curiosity - why all this bashing at boost, std::string etc.
Actually, as soon as you see something using templates you seem to be
negative. Why?

Because the enormous usability problems with templates/STL/Boost are
constantly ignored or downplayed ("it's all the fault of compiler
vendors").
If you do not understand templates, you could just avoid
using them - right?

In general, I have no problem understanding templates and accompanying
error messages. BTW, of course, everyone should avoid templates: Avoid
them if you can. Use them if you must.
If you find templates to be overused somewhere it is
just as much your right to tell the developer how to solve it without using
that "weird" template stuff. But this bashing without reason is just
pointless.

So you think it would be productive to tell a Booster to avoid
templates? :-D
IMO, it's better to tell users that it's not their fault when they have
problems using old-fashioned "modern C++".

::A::
 
P

Peter Koch Larsen

Abecedarian said:
Because the enormous usability problems with templates/STL/Boost are
constantly ignored or downplayed ("it's all the fault of compiler
vendors").
Well... if you are referring to the decryption of the error-messages, I can
understand your frustration. Still, this is just a question of habit -
should not take you long to learn.
In general, I have no problem understanding templates and accompanying
error messages. BTW, of course, everyone should avoid templates: Avoid
them if you can. Use them if you must.
What part of the templated standard library should be untemplated, then?
So you think it would be productive to tell a Booster to avoid
templates? :-D

Let me challenge you to name a library from boost, where the usage of
templates is inappropriate.
IMO, it's better to tell users that it's not their fault when they have
problems using old-fashioned "modern C++". Surely it is not.

::A::
/Peter
 
H

Howard

Abecedarian said:
Peter Koch Larsen wrote:
... BTW, of course, everyone should avoid templates: Avoid
them if you can. Use them if you must.

That's simply nonsense.

I'd much rather use the std::vector template than a plain array. Likewise
the std::string class is much better than a C-style array of char.

And in addition to using the STL, writing your own templates allows you to
accomplish much more in less code than writing seperate classes to handle
different but related types.

Sure, template code can indeed be difficult to read, especially at first,
but appropriate use of typedef's can make the job much easier.

Avoiding templates in C++ programming is like avoiding power tools in wood
shop.

Templates are an integral part of the language, and a powerful tool all C++
programmers should make use of. And I think many here would agree that
templates should be taught as part of the very basics of C++, and not, as it
seems is true in many cases, as some kind of "add-on" to the language.


-Howard
 
P

Peter Koch Larsen

Abecedarian said:
You did link to the wrong page:
Here is a copy of the basic usage of the singleton:

include <boost/singleton.hpp>
using boost::basic_singleton;

class ExampleSingleton :
public basic_singleton < ExampleSingleton >
{
public:
void DoSomething ( );
};

void DoSomething ( )
{
// if ExampleSingleton does not already exist,
// the following line will create it
ExampleSingleton::pointer ptr;

// now access the instance
ptr->DoSomething ( );
}
Is that to difficult for you?/Peter
 
M

Mark P

somebody said:
We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>

-Thanks

I'm sure there are some good NP-hard problems that would fit the bill.
I'd suggest the halting problem but that's probably too obvious.
 
Joined
Oct 14, 2010
Messages
1
Reaction score
0
Karl Heinz Buchegger said:
somebody wrote::ciao:
>
> We have a C++ programming intern at work. Last week he introduced
> himself, and told me that if I have any "crappy" programming jobs
> needed done, he could handle them. Can anyone recommend some
> programming task that would be ridiculously difficult?
> I just want to play a joke on him as a way of saying, "welcome to
> the asylum! <g>


A function for converting strings from uppercase to lowercase which works
for all languages (ok: just German alone would be sufficient to keep
him busy for a long time)

--
Karl Heinz Buchegger



TRY IT:

just add 32 with ascii of each element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top