What is the hardest thing in C++?

Pages: 1234
Hello, I was wondering how hard programming can really get. Im not trying to get ahead of myself, Im still learning stuff at my level, but I was thinking about it and it was very intriguing. This just doesnt have to be restricted to c++, but just in general programming.

thanks

In my opinion it's TMP -- template metaprogramming -- and it's the reason why I'll never dare call myself a C++ expert -- because I made a conscious decision not to ever delve into that madness.
sticking at it
In general programming I would say 3D game; high-end graphics and physics.
Video games, operating systems and compilers are probably generally the most difficult projects you can undertake, but it depends on the scale. A compiler for a language like Brainf*ck is easier than a simplistic operating system is easier than a modern blockbuster video game.
Definitely template metaprogramming. I have a difficult time wrapping my head around it, mainly because I still am not fully aware of all the ins and outs of template syntax and specialization rules. Reading existing solutions is pretty easy, but trying to create my own is pretty hard.

Video games, operating systems and compilers are probably generally the most difficult projects you can undertake


Database systems are much harder than every of the above in many aspects: they are distributed, parallel, need not only scale vertical but also horizontal, they need to be extremely fast, they deal with much larger amounts of data any single OS or video game does, and they need to be fault tolerant. A crash of a video game, OS or a compiler is *nothing* compared to a crash of a database system that brings your whole business down (and loses precious data).
I thought that Java was preferred over C++ for that kind of stuff though, was I mislead?
@rapidcoder
Good point, although a DBMS of that scale isn't likely going to be developed by a single person
I thought that Java was preferred over C++ for that kind of stuff though, was I mislead?

I thought that C# was preferred over Java for that kind of stuff though, was I mislead?

:P
Last edited on
closed account (3qX21hU5)
I hate database programming in C++ its a pain in the ass even for small ones (Though that could be from very little of experience with DB programming in C++).

Where as in C# I was able to get a SQL Database setup and connected perfectly to my forms in under a half hour :). Which is why I use C# for most of the business application projects I do and C++ for my mini games.
@Zereo:
Same here. I still use C# for a large amount of stuff and use C++ for games mostly. My "life goal" however is game programing, so C++ is slowly becoming my primary language.
I agree with the template meta programming
Here's a simple utility that throws a compiler error if a compile-time condition is false:
1
2
template<bool B, class T = void> struct enable_if {};
template<class T> struct enable_if<true, T> { typedef T type; };


This will check for a prime number at compile-time:
1
2
3
4
5
6
7
8
9
10
11
12
template< int NUMBER, int DIVISOR = NUMBER - 1 > struct is_prime
{
    struct check { char check_it[ NUMBER - 1 ] ; } ;
    enum
    {
        result = (NUMBER % DIVISOR) && is_prime< NUMBER, DIVISOR-1 >::result
    } ;
};
template< int NUMBER > struct is_prime< NUMBER, 1 >
{
    enum { result = true } ;
};
Last edited on
I say anything you are not used to doing, would be hard. As for the "hardest" thing, there are thousands of answers that will all suffice, because each area has its own "hardest" thing. The "hardest" thing could be an OS, a compiler or even a program to solve the Traveling Salesman Problem in polynomial time.
I guess by 'hard' I mean 'impractical' but also 'common'.
programming the components of the international space station or components to Cern's LHC.
Yeah I suppose the hardest thing in c++ will be C++ + some other really hard science...with a cold in bad weather during a gunfight after finding out that your divorcing wife has given birth at your mothers funeral and you have no fingers and are deaf dumb and blind and your on LSD.
Yeah I suppose the hardest thing in c++ will be C++ + some other really hard science...with a cold in bad weather during a gunfight after finding out that your divorcing wife has given birth at your mothers funeral and you have no fingers and are deaf dumb and blind and your on LSD.

You don't need to force yourself to post anything, if you have nothing to post.

LB wrote:

Your empty space is not as good as my space++
Pages: 1234