logoalt Hacker News

maccardlast Sunday at 4:21 PM2 repliesview on HN

I don’t necessarily disagree but anyone who is a c++ programmer and sees

    class foo { 
        public:
        foo() {
            ptr = new other();
        }

        ~foo() {
            
        }
    };
And doesn’t immediately question it doesn’t instil confidence.

Interviews are inherently high pressure situations for the candidate, the only way to avoid that is to just let people try out on the job and fire them if it isn’t working out. That’s unfair to everyone.


Replies

atomicnumber3last Sunday at 4:37 PM

Forgive me, I'm a Java programmer.

The glaring bug here is that ptr is - or rather the object being pointed to is - on the heap and allocated in the constructor, but the deconstructor doesn't free it?

show 1 reply
tremonlast Sunday at 9:11 PM

Does this example even compile, given that ptr is not declared anywhere?

show 2 replies