Live data from Hacker News

Apple Developer Documentation Is Missing

v4.chriskrycho.com

121–130 of 400 posts

Re: Apple Developer Documentation Is Missing

#121
post #74

Earlier quoted context omitted.

What is a "cascaded nil-coalescing operator" ?

Think the ternary operator, but worse. In Swift, this is expressed by "??". It means "If the previous test returns nil, then execute what is after the ??". For example, if you have a concrete Int, but the source might be an optional, then you could do something like this: let a = b ?? 0 That means that if b is nil, then set a to 0. Otherwise, set it to whatever value b has. You can chain these, like so: let b: Int? =…

Strongly disagree with the "but worse" characteristic. As soon as you learn what "??" does, it's actually an improvement in readability in many cases. For example:

  nameLabel.text = user?.name ?? "Guest"
This, as opposed to:

  if let name = user?.name {
    nameLabel.text = name
  } else {
    nameLabel.text = "Guest"
  }

Re: Apple Developer Documentation Is Missing

#122

Some time ago, I was contacted by Apple to apply for a job. My code is insanely well-documented. I like to think that a lot of the inspiration for my code docs comes from Apple's open codebases. Their code is exceptionally well-documented. In any case, as is usual with all employers, these days, they completely ignored the focused, relevant links that I sent them to elements of my extensive portfolio of repos, and, i…

Most interviewers don't give a crap about one's GitHub/Bitbucket/X portfolio. It might help one to get the interview in the first place but after that point it's useless. Why? Because any single interviewer has a set of well rehearsed questions they know like the back of their hands. They know the different possible solutions and understand their pros and cons. This makes the interviewing a routine that lessens the b…

Asking the same questions also makes it easier to compare between candidates and the questions can become optimised over time to ensure they are fair and valid performance predictors.

Also, it's never obvious how much someone contributed to their portfolio. Just being able to explain it doesn't mean you were the sole contributor, or the contributor at all, and it doesn't give a great indication of how you work or how well you can analyse problems.

Re: Apple Developer Documentation Is Missing

#123

Earlier quoted context omitted.

And this reminds me of the documentation quality of Symbian around 2005-2007. I would highly recommend the author of the article the check it out, before lamenting Apple's documentation.

I mean it's a discounted OS is it really a comparison? We're talking about one of the biggest platforms in the world here with unlimited money to throw at this problem there is no excuse

Symbian was at one time the number one mobile platform for apps.

Re: Apple Developer Documentation Is Missing

#125
post #111

Earlier quoted context omitted.

"Think the ternary operator, but worse" Giving the developer succinct ways to prevent program failure from unexpectedly undefined values is a feature.

"Giving the developer succinct ways to prevent program failure from unexpectedly undefined values is a feature." Most languages have had this since the 1960s. It's called the "if" clause. The ternary and nil-coalescing operators are shorthand (sugar) for an if test (or guard, in Swift). Like I said, I actually like them, but I have to be careful, when using them. I really like Swift, but it's quite possible to write…

> Most languages have had this since the 1960s.

> It's called the "if" clause.

If we got rid of everything we don't absolutely need in programming, we would have to get rid of 98% of Swift syntax, and probably every modern programming language including Swift.

Re: Apple Developer Documentation Is Missing

#126
post #104

Some time ago, I was contacted by Apple to apply for a job. My code is insanely well-documented. I like to think that a lot of the inspiration for my code docs comes from Apple's open codebases. Their code is exceptionally well-documented. In any case, as is usual with all employers, these days, they completely ignored the focused, relevant links that I sent them to elements of my extensive portfolio of repos, and, i…

To be honest, while documentation is extremely important in the real world, interviews are time-constrained, and it makes no sense to write documentation when you have 45 minutes to implement something like that.

Ignoring dozens of repos (non-forked), and thousands of lines of testable, shipping code, is probably not helpful.

I was a manager for a long time. I loved long résumés and relevant material.

I was hiring expensive people to work on really important stuff, and there was no way that I wanted to rush the vetting.

Also, I never gave a single test, and I think I got it right, every time.

Re: Apple Developer Documentation Is Missing

#127

Some time ago, I was contacted by Apple to apply for a job. My code is insanely well-documented. I like to think that a lot of the inspiration for my code docs comes from Apple's open codebases. Their code is exceptionally well-documented. In any case, as is usual with all employers, these days, they completely ignored the focused, relevant links that I sent them to elements of my extensive portfolio of repos, and, i…

> I'll make it clear that I'm NOT a fan of these. I am mediocre, at best, at them, as I don't come from a traditional CS background (I started as an EE).

I come from a CS background and struggle with these too.

The big problem I have is this performance stuff is often barely relevant to the position. You need to know the principle of a BST. Unless you're building a database working in a unique scenario, actually traversing it going to be done by some library.

Re: Apple Developer Documentation Is Missing

#128

Earlier quoted context omitted.

Think the ternary operator, but worse. In Swift, this is expressed by "??". It means "If the previous test returns nil, then execute what is after the ??". For example, if you have a concrete Int, but the source might be an optional, then you could do something like this: let a = b ?? 0 That means that if b is nil, then set a to 0. Otherwise, set it to whatever value b has. You can chain these, like so: let b: Int? =…

In Objective-C (and some other languages with ternary operators) the same can be written like this: int a = b ?: c ?: 0

The second conditional is unneeded as the 0 will only be returned if c evaluates to 0, so it can equally well be written

    int a = b ?: c;

Re: Apple Developer Documentation Is Missing

#129
post #104

Earlier quoted context omitted.

To be honest, while documentation is extremely important in the real world, interviews are time-constrained, and it makes no sense to write documentation when you have 45 minutes to implement something like that.

I have personally found that sometimes writing out comments that explain how a confusing function is going to work will help me to understand the ins and outs and flow of the function before writing it, which will in turn help me to actually write the function, especially with algorithmic functions. Those comments might as well be written as long-standing documentation that doesn't change as long as the implementatio…

Writing a function docstring is just muscle memory for me. It's part of my process. Explain the objective, then implement it. Docstrings are usually the first or second thing I write after the function signature.

I would also have serious reservations about taking a job where documentation is considered a negative during a coding interview.

Re: Apple Developer Documentation Is Missing

#130
post #81

Earlier quoted context omitted.

Not sure if it is a sarcasm or not.

Of course it’s sarcasm. It’s just like people who sat that the iPhone is a “status symbol”. How can something be a status symbol when 50% of smart phone users have it in the US and that anyone on any of the four major carriers can buy one an interest free 24 month loan. Geeks can’t stand to face the fact that people who can afford to have a choice, overwhelmingly shy away from Android.

How can something be a status symbol when 50% of smart phone users have it in the US

It's more that Apple has gotten people to view anything other than the iPhone as low status, e.g. green bubbles.

Post reply on HN