New job coding c++, new to c++, new return null? c veteran

so, at my new job today, I find that it is standard practice there to check newly constructed object pointer for null
that is, they create an object with new
and then check that it's not 0

I ask why (our code analysis tool keeps flagging these as redundant checks), and they say because they disabled exceptions due to the overhead (it is an embedded system).

but some reading showed me a few things.
1) c++ standard gurantees the memory will be reserved,
2) if it were actually returning null pointers instead, our software wouldn't be able to deal with it anyway and would probably crash and burn.
3) I was under the impression that you design and code first, optimize later, and there has been no detailed justification provided for doing this (such as, how much space and/or cpu usage was saved, how much did we need? etc... you know, software engineering)

am I wrong? or am I in the wrong place for work?

HOW
How do you know-nothing shitheads keep jobs and I can't even get replies to my resume for an entry level junior dev position.

delete this;

I have a degree and 4+ years experience?

besides, if you're so damn great tell me where I was wrong, I'm trying to learn here

How long did you have your last job. You need to realise all workplaces have a different set of rules and do things differently.

I was there 4.5 years, yes I realize that, but I'm looking for reasons, insight

this place doesn't document hardly anything, and they don't really have coding standards either, so how do I know if they're even following their own set of standards

>mfw there is 1 delete this in the codebase I work with
I contemplated it for ten minutes.

shouldn't they be checking for nullptr instead of NULL?

I mean, you can hardly call yourself a software engineer if you don't justify your reasons for doing things, especially something non-standard

I wont be able to accept "just because" for very long, how do businesses change and improve if they don't even know why they're doing things in the first place, if you rely on one guy for your knowledge, if you don't train new employees or even provide documentation to them?

you there, you want this job? move to michigan and apply to automotive companies, go for the one that actually gives you a technical test (not just a personality test), show an example of your work, boom done

actually they're just checking the pointer for 0 or not 0 (depending on the situation), so not even null really

what? isn't that bad?

I can't really help you but I would suggest asking your colleagues what the hell is going on.

is it? honestly I dont know

I got out of just low level C because I wanted to be part of the mainstream in coding, I don't fucking know if this is OK or not, at my last place we'd hardly tolerate checking against "magic numbers", they had to be macros with a name that described what we were really trying to accomplish

the other reason I took this job instead of doing the same as I did before is because i'm a fucking idiot, seriously, I could be making more money and not have more than a 5 day awkward phase instead of this 2 months in and my tools are still fucking broken and I still don't have a permanent desk or any of my equipment and I don't know how much more I can stand. You can read all the documentation but that will never tell you what's expected of you in a place where they just don't write those things down or take the time to actually train you otherwise

guess I'll crack and do it, I honestly don't care if I get fired, i'm that stressed out, I just hate sticking my neck out for some reason, and I'm a firm believer that if I think things should be done differently then I need to sell the benefits, and not just "thats what we did at my last place"

want to trade?

it'd be funny as hell, you'd have to take care of my cat though otherwise I'd cut ya

you got a girlfriend? friends? maybe a job as a janitor, maybe not? who cares, yes

unemployed, fresh out of college, applied math degree, one very exciting job prospect, probably just butched a phone interview for another job
no gf (but a well-liked/visited OKC profile), two good friends (one on the other side of the country)
a deal's a deal user

learn SAP and do statistical analysis, might want to consider a contracting agency, lots of employers are shit-heels and do the whole contract-to-hire things, that's how one of my professional friends got work

You are wrong, OP.

1. Obviously wrong. What do you think happens when the system runs out of memory?
2. It sounds like your software would handle it just fine because they're consistently accounting for this fact.
3. Disabling exceptions is a perfectly reasonable thing to do, even on non-embedded systems. Exceptions are glorified gotos that don't work well in practice.


Sure, your desktop linux distro will overcommit and -fno-exceptions will abort() instead anyways, but it's part of your job as an embedded systems developer to know that desktop is not the universe.

thank you, while I still have questions, I'm open to professional practice not matching the standard or what's taught in schools (kinda why I took the job, to learn what's real)

thankfully we aren't really using linux, but another posix OS