Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doctor w-rw-rw-
Jun 24, 2008

status posted:

I wouldn't really expect a whole lot of autorelease knowledge these days...maybe the specifics of ARC instead?

edit; unless I'm misunderstanding what you're getting at here..?

If someone applies for a senior iOS dev position and doesn't know autorelease, for me, that's an instant no-hire. At least down to the @autoreleasepool directive or NSAutoreleasePool class, and some details there. Better if they can go down to the NSRunLoop level. If nothing else, how low they can go is a hint for how deep you can go with your other questions.

Those questions are pretty decent for a quick evaluation of iOS knowledge to the point you can start jumping into the details of whatever they've done before, or if your style is to interview them on algorithms, to do that.

Adbot
ADBOT LOVES YOU

dc3k
Feb 18, 2003

what.
So are you talking about how it works as in "what do autorelease pools do/what are the benefits of @autoreleasepool vs NSAutoreleasePool instances/etc" type of answers, or how it works as in "how is autorelease implemented"?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Don't forget the cool ARC autorelease callstack-walking optimization poo poo if you're collecting trivia.

Doctor w-rw-rw-
Jun 24, 2008

status posted:

So are you talking about how it works as in "what do autorelease pools do/what are the benefits of @autoreleasepool vs NSAutoreleasePool instances/etc" type of answers, or how it works as in "how is autorelease implemented"?

pokeyman posted:

Don't forget the cool ARC autorelease callstack-walking optimization poo poo if you're collecting trivia.

All of the above, but if someone is ARC-trained I'd expect them to still know the basic workings of autorelease.

Another good weeder question is to ask how long a frame is (~16ms, 1/60 of a second), and pick their brains on how to hit that target (do stuff in the background wherever possible). Also, what things they might punt to a background thread, and what they might not.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
All that I bother asking about with autorelease is for an example of when it's still relevant with ARC (simplest answer is probably when you're allocating temporary objects in a loop). As long as they have a vague understanding of autorelease pools the details are basically just trivia. Especially the return value optimization.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
On the flip-side of this topic, if I want to get an iOS dev job, what sort of intricate details should I know, versus what's good to leave as look up as-needed? I've done a few small projects now, but as I've taught myself and the projects were fairly superficial I haven't had to go very deep.

Kallikrates
Jul 7, 2002
Pro Lurker
One question we do is a series about NSInteger, int, NSNumber etc what they, are differences usages etc. It filters too many people to stop asking.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
I had an ex-intern who told me was asked in an interview what happens if you call a selector on `nil`, and he answered along the lines of "it'll throw an exception" :doh:

I know that he knew better and probably just tensed up, but I had to tell him "yeah I wouldn't have hired you either".

Edit: And to elaborate, nil handling is something I think I've had come up in every iOS-related phone-screen I've had (though not as often in the interview proper). There's always at least a quick question along the lines of "what if <function that adds an element to a collection> is passed nil" or "what would you expect if someone passed in nil and you called x with it" (the answer usually being "crash" or "nothing but maybe unexpected state", if you forgot to nil-check).

ultramiraculous fucked around with this message at 05:44 on May 12, 2015

Doctor w-rw-rw-
Jun 24, 2008

ultramiraculous posted:

I had an ex-intern who told me was asked in an interview what happens if you call a selector on `nil`, and he answered along the lines of "it'll throw an exception" :doh:

I know that he knew better and probably just tensed up, but I had to tell him "yeah I wouldn't have hired you either".

Edit: And to elaborate, nil handling is something I think I've had come up in every iOS-related phone-screen I've had (though not as often in the interview proper). There's always at least a quick question along the lines of "what if <function that adds an element to a collection> is passed nil" or "what would you expect if someone passed in nil and you called x with it" (the answer usually being "crash" or "nothing but maybe unexpected state", if you forgot to nil-check).

Oh, on that note, another trivia question: what's the difference between 0, nil, Nil, NULL, nullptr, and NSNull?

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Doctor w-rw-rw- posted:

Oh, on that note, another trivia question: what's the difference between 0, nil, Nil, NULL, nullptr, and NSNull?

Now that I would definitely classify as trivia. When interviewing candidates I sometimes ask trivia-ish questions but just to see what they know - I'd never make the actual yes/no recommendation only based on that.

Interviewing is weird. We just had a guy with a really "meh" interview submit excellent homework code, tests, good patterns, and did all the extra credit items. I've been pushing for more of that because it lets people do what they're actually good at in a low pressure environment.

Doctor w-rw-rw-
Jun 24, 2008

Ender.uNF posted:

Now that I would definitely classify as trivia. When interviewing candidates I sometimes ask trivia-ish questions but just to see what they know - I'd never make the actual yes/no recommendation only based on that.

Interviewing is weird. We just had a guy with a really "meh" interview submit excellent homework code, tests, good patterns, and did all the extra credit items. I've been pushing for more of that because it lets people do what they're actually good at in a low pressure environment.

Yeah, definitely trivia beyond NULL/nil/NSNull - but I think that makes it a decent question for calibrating someone's depth of experience with ObjC/C++, since it gives room for them to elaborate.

Code samples are way more important in general, though.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Trivia is not a good use of scarce interview time. You can learn a lot more about a candidate in those 2 minutes with better questions.

But the essential thing is: what do you want to learn about the candidate, and what questions will lead to the right conversation to reveal those things?

Doctor w-rw-rw-
Jun 24, 2008

Subjunctive posted:

Trivia is not a good use of scarce interview time. You can learn a lot more about a candidate in those 2 minutes with better questions.

But the essential thing is: what do you want to learn about the candidate, and what questions will lead to the right conversation to reveal those things?

To be fair, it's not a huge timesuck from other parts of an interview, and it lets me transition into more complex questions more easily. Also, I've been interviewed with terrible and worse interview questions often.

Care to throw us a bone and elaborate? I'd prefer to ask better questions.

brap
Aug 23, 2004

Grimey Drawer
I don't know poo poo about interviewing but if I were trying to gauge a candidate meaningfully I would present them with a problem that they can't know in advance or rattle off of the back of a flash card.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
Thanks for that insight!

Doctor w-rw-rw-
Jun 24, 2008

fleshweasel posted:

I don't know poo poo about interviewing but if I were trying to gauge a candidate meaningfully I would present them with a problem that they can't know in advance or rattle off of the back of a flash card.
Yes, and that's not mutually exclusive with weeding someone out who happens to not even know the solutions those problems.

Doh004
Apr 22, 2007

Mmmmm Donuts...
My way of interviewing people is The One True Way.

lord funk
Feb 16, 2004

Does anyone development on an iPhone that you don't have a wireless contract / data plan? I think I'm going to run out and get an iPhone 6 Big and just get an unlocked one. Do I need a SIM card?

King of Gulps
Sep 4, 2003

I recently booted a new one* up without a card, and setup definitely demanded I put a sim in at some point.
Edit: *unlocked, straight from apple

King of Gulps fucked around with this message at 18:44 on May 17, 2015

lord funk
Feb 16, 2004

King of Gulps posted:

I recently booted a new one* up without a card, and setup definitely demanded I put a sim in at some point.
Edit: *unlocked, straight from apple

Cool thanks.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

lord funk posted:

Cool thanks.

I'm not sure it needs to be a valid SIM. I've definitely got the "failed to activate cellular network" message before but still managed to get into the phone. You should be able to use a prepaid SIM from a carrier that supports iPhones just to get it going.

lord funk
Feb 16, 2004

Yeah I'm back from the fruit stand + olde computer shoppe and the $4.99 no carrier SIM card worked fine.

The 6+ is big.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Doctor w-rw-rw- posted:

Oh, on that note, another trivia question: what's the difference between 0, nil, Nil, NULL, nullptr, and NSNull?

What an annoying question, the full answer is so long and boring. I dunno though, maybe it's a good way to filter people who know C, too, and not just Objective C

Doctor w-rw-rw-
Jun 24, 2008

hackbunny posted:

What an annoying question, the full answer is so long and boring. I dunno though, maybe it's a good way to filter people who know C, too, and not just Objective C
IMO, it's not a good question without adjusting the follow-ups to dig into it further.

(0, NULL) for C, (nil, Nil, NSNull) for Objective-C, nullptr for C++.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
The existence of NSNull makes me angry. I still have nightmares about checking for NSNull in KVO operations. What elegant code that was!

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
There was a period of time early on where I was rolling with a category on NSNull that caused it to act like nil when sent a message. I mean why fix your problems when you can just ignore them?

brap
Aug 23, 2004

Grimey Drawer
The way objective C collections use nil to have a special meaning and the lack of generic types in the language make me sad.

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
The pre-eminence of Swift as the only language to write new code in cannot come soon enough, in my opinion.

...I admit my ignorance on all the different null types. I've not encountered anything but nil of that list in what I've worked on. Does someone experienced care to explain the difference for those of us who don't know, or at least point out some good reading material on the subject?

Kallikrates
Jul 7, 2002
Pro Lurker
http://nshipster.com/nil/ covers the obj-c side of that question.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.

ultramiraculous posted:

There was a period of time early on where I was rolling with a category on NSNull that caused it to act like nil when sent a message. I mean why fix your problems when you can just ignore them?
I'd be tempted to do the same if I run into a similar KVO mess in the future. Is there a reason for having NSNulls be bombs in a language where nil objects are dandy? I'm sure the reason is there but just beyond me.

brap
Aug 23, 2004

Grimey Drawer
So NSNull freaks out like a null in most programming languages when you send it a message?

Doctor w-rw-rw-
Jun 24, 2008

ManicJason posted:

I'd be tempted to do the same if I run into a similar KVO mess in the future. Is there a reason for having NSNulls be bombs in a language where nil objects are dandy? I'm sure the reason is there but just beyond me.

For holes in NSArrays before NSPointerArray existed? Same NSMapTable. The initializer lists were nil-terminated. It wasn't that long ago that we didn't have array or dict or number literals.

Also for JSON values where the key is present but the value is null, and the parser isn't set to ignore the key.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

fleshweasel posted:

So NSNull freaks out like a null in most programming languages when you send it a message?

It's just a singleton object that doesn't do anything which is used as a sentinel value. It behaves like any other object when you send it a message it doesn't respond to.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Axiem posted:

The pre-eminence of Swift as the only language to write new code in cannot come soon enough, in my opinion.

...I admit my ignorance on all the different null types. I've not encountered anything but nil of that list in what I've worked on. Does someone experienced care to explain the difference for those of us who don't know, or at least point out some good reading material on the subject?

I enjoy not working in Objective-C anymore but I can safely say Swift and the tools supporting it just aren't there yet.

Soon though. Soon (I hope :ohdear:)

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
The worst part of Swift for me is Xcode's lovely auto-indentation. Like if I wrap a func declaration to the next line (which almost always happens because hey, ObjC-derived names are long as gently caress), then I indent that wrapped line in 4 more spaces, then it wants to put the first line of the body 2 more spaces in from THAT, instead of 2 spaces from the start of the first func line. Come onnnn

Would give anything for clang-format to support Swift. I love having format-on-save enabled and I never think about formatting in ObjC again.

lord funk
Feb 16, 2004

Flobbster posted:

The worst part of Swift for me is Xcode

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
I understand why NSNull exists. I do not understand why it throws exceptions for unknown selector.

dc3k
Feb 18, 2003

what.

ManicJason posted:

I do not understand why it throws exceptions for unknown selector.
because that's what NSObjects do when you send them an unknown selector :confused:

Doctor w-rw-rw-
Jun 24, 2008

ManicJason posted:

I understand why NSNull exists. I do not understand why it throws exceptions for unknown selector.

I'd sum it up as: If you want nil semantics then use nil. If your collection doesn't support nil then don't violate its assumptions. It's otherwise just a sentinel object, not some special class of object that isn't like other objects. Not being different means it's simpler to reason about.

Which is basically what status said.

Adbot
ADBOT LOVES YOU

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.

status posted:

because that's what NSObjects do when you send them an unknown selector :confused:

It makes sense for normal objects. It does not make sense for me in the one case of NSNull in a language where nil objects happily accept anything. It can easily be made to behave that same way, but it was not for some reason that's above my pay grade.

I'm sure there are cases where that behavior makes sense, but the only times I've encountered NSNull have been in cases where I'd be much happier if it worked like a nil object, e.g. the KVO change dictionary. I imagine I'm totally wrong for a million reasons since I have barely ever seen NSNull outside of KVO and JSON. I'm not trying to start some religious argument; I'm genuinely curious where it makes sense and why it was done that way. If I'm just an idiot for thinking the current way is stupid, so be it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply