Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Operator Overoverloading

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-02-22 6:56

Studying part of a large complex middleware for a management web application, and wondering why this:
InitechString str1, str2;
...
if(!(str1 != str2))
{
    ...
}


occurred almost as often as this:
InitechString str1, str2;
...
if(str1 == str2)
{
    ...
}


I dug a little deeper and found...


// CASE-SENSITIVE COMPARISON
//
int InitechString::operator==(const InitechString& r) const
{
    return !strcmp(m_ptr, r.m_ptr);
}
// CASE-NONSESTIVE COMPARISON
//
int InitechString::operator!=(const InitechString& r) const
{
    return !!strcmp(m_ptr, r.m_ptr);
}

Name: Anonymous 2013-02-23 3:55

This is a bit of a serious post in a silly board, but when I see stuff like this I think to myself that I can do decently well in a career in programming.

If people like this have jobs, why can't I? As difficult as it is to judge your own abilities, I've always thought of myself as good as programming.

I don't know a lot of tricks that is common among programmers, but math and logic have always come easy to me. Still, I question whether I can jump into a career. Whether it would be better than continuing my path in Engineering.

It's a very difficult choice for me to make. I love programming, but I understand people get burnt out from it and want to move on quickly.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List