
iOS Development Isn’t in a Good Place - kartickv
https://medium.com/@karti/ios-development-isnt-in-a-good-place-5fb73c31483e
======
72deluxe
"Swift has been taken over by theorists who debate academic things or solve
yet another corner case in their type system, making a complex language even
more complex, rather than deliver what their users (developers) actually need
to build real-world apps."

I often wonder why they didn't choose a language like C++ instead of
implenting their own language again? I mean, C++ has its faults and some argue
that it is too complicated but you can still do plenty writing simple C++
without going over to the complicated stuff.

"NSInternalInconsistencyException " ouch

"Swift code can still crash in a way that the caller can’t recover from,
thanks to things like nil unwrap failures" Out of interest, what happens in
this instance? Does a nil unwrap failure not throw an exception of some kind?

Code analysis that is part of C++ compilers catch a lot of these NULL
scenarios, particularly if you use something like SAL on your code as a
standard practice.

With regard to the last C++ template example, why can Swift not do this? It is
possible to some extent in C# with generics but what is Swift missing?

I ask these Swift questions being a complete novice with regard to it; I've
got a book I mean to get around to reading one day...

XCode is indeed rather buggy (but always has been???). It does do code
analysis for C++ like identifying dead code (point 17 in the article) but I
don't know about other languages.

As for Flutter, it's written in C++ but the examples all appear to be in Dart
- any way of actually writing the application in C++??? Some pointers (excuse
the pun) would be welcomed. (It appears impossible at the moment - you need to
learn yet another language like Fart to be able to write for it...)

~~~
kartickv
> Does a nil unwrap failure not throw an exception of some kind?

No, it just kills the program, like a segfault in C++. Unlike Java, which
throws an exception that you can catch and recover from.

> With regard to the last C++ template example, why can Swift not do this?

I'm no Swift typing expert either, but my understanding is that:

a) Swift generics are type-checked at definition time, not instantiation time
as with C++. I believe other modern languages do it like Swift.

b) Swift doesn't promote types, so you can't subtract a float from a double.
That rules out heterogenous types, like a float or a double. Even if both
arguments are floats, the 0.1 on the right side of the < operator is a double,
which can't be compared against a float.

c) Swift doesn't have template specialisation either, so we can't provide
different implements, one for floats and one for doubles. If we could, we'd
use 0.1f for the float case.

------
codesternews
I disagree with most of the points. Every platform has some issues and no
platform is perfect.

The documentation updation I agree. But commenting on WWDC videos is not good.
You will not find any other platform videos like that. It is one of the
highest quality of documentation you can find.

No one is saying watch all the years videos. I see whatever I am working on
and intrested.

This article is written to find only mistakes.

The one major drawback of iOS platform is it's closed api other than that all
the API's are well documented and I do not get any problems while using them.

~~~
kartickv
> No one is saying watch all the years videos. I see whatever I am working on
> and intrested.

Yes, but if I'm working on image processing, videos related to that go back
many years, and things covered in earlier videos are often not covered in
later ones.

Other that than, let's agree to disagree. Maybe you're right, maybe not, we'll
see :)

