News for hackers. Stuff that matters.
Re:My misalignment with Apple's love affair with Swift by rockshassa on Sunday June 10, 2018 @06:44PM (#17280591)
IMO Swift is a language written by a compiler guy to solve compiler problems. the syntax is dense because it forces you to make a lot of decisions that could otherwise go unmade in objc.

If a variable is read-only, you're forced to think about that by deciding between let/var. contrast this with objc, where all vars are writable unless you do the extra work of adding the const keyword. objc makes us do more work to get the faster (and safer) behavior.

Similar with Optionals, you're now forced to decide right away if a parameter can ever be nil, whereas with objc you didn't need to declare nullability. Again, it makes the safest and fastest choice easier to make, and allowing nullability is actually more work.

Generally Swift forces you to pass as much information to the compiler as possible at compile time, and it does it with a delightfully readable syntax. This theme repeats itself throughout the language. more information at compile time is always going to result in safer and more predictable behavior.

full disclosure: i'm an iOS dev working in objc and swift. i love both languages, and i think swift is the obvious path forward.

Re:My misalignment with Apple's love affair with Swift by beureum on Sunday June 10, 2018 @11:36PM (#17281561)
You've hit the nail on the head, but I take the opposite conclusion.

Swift is designed around premature optimization. In my experience, improving programmer productivity is more important. The more time spent with compiler enforced busywork is less time in Instruments. The same goes for compile times. If you want people to write fast code then help them to iterate quickly.

Re:My misalignment with Apple's love affair with Swift by MR4D on Monday June 11, 2018 @01:29AM (#17282041)
Great comment!!

One of the problems I have is that I love python, but I was hoping that swift would be like python on steroids. Instead, I can’t make the leap because python lets me iterate so freaking fast. If I could have something like that with the ability to incrementally improve my code and compile to a binary, I’d be happy. I thought awift would be it, but your comment helped me understand why it isn’t working for me.

Full disclosure, I’m not a full time dev, so YMMV.

Re:My misalignment with Apple's love affair with Swift by valuearb on Sunday June 10, 2018 @11:44PM (#17281601)
Most developer time is spent finding and fixing bugs. That’s what makes developing in Swift much more productive than in Objective C.
Re:My misalignment with Apple's love affair with Swift by beureum on Monday June 11, 2018 @12:31AM (#17281806)
Well yeah pretty much anything is better than ObjC.
Re:My misalignment with Apple's love affair with Swift by saghm on Sunday June 10, 2018 @11:17PM (#17281485)
> IMO Swift is a language written by a compiler guy to solve compiler problems.

I'm not convinced; the examples you give require _more_ work for the compiler writer, not less. In general, a stronger type systems means that the compiler has to do more.

Re:My misalignment with Apple's love affair with Swift by jkulubya on Sunday June 10, 2018 @11:45PM (#17281607)
I see it in the sense that if the target for both compilers is to produce a correct program, then that target is much easier to achieve with more information (and less assumptions) passed in the source code by the programmer (ie Swift).
Re:My misalignment with Apple's love affair with Swift by mpweiher on Monday June 11, 2018 @02:20AM (#17282214)
> require _more_ work for the compiler writer

Exactly. In Objective-C, the compiler can't do much, which is kind of a bummer if you are a compiler guy. Chris is a compiler guy.

Consider Swift a kind of public works program for your local compiler team.