HACKER Q&A
📣 omosubi

What did you learn today?


People often say that software engineering requires you to constantly be learning, so what did you learn today?


  👤 russellbeattie Accepted Answer ✓
Finally decided to make a native macOS app so I pulled up the free Swift book and started digging in. Was surprised to see that Swift is available on Linux and Windows and that there's an effort to use it on the server. I hadn't been paying much attention to it. Not sure how much it's used outside of Mac and iOS, but I thought that was interesting.

Observations so far: Some of the syntax is nice, some is odd, some is truly bewildering. Functions are func, function return values use ->, the 10 different ways to write a closure seems excessive, interfaces are protocols, const is let (???), string params use "\(foo)" which is just weird. Probably more as I get more into it. Personally, I feel like this:

    func findIndex(of valueToFind: T, in array:[T]) -> Int? { ... }, 
is a bit overkill in terms of language concepts rolled into a single line, but to each their own.

XCode is just... Wow. I have no idea what's going on yet. That's next.

(Off topic... While writing this on my Android tablet, I am annoyed to discover that GBoard has updated itself, moved keys around and neglected to include the < and > keys unless I keep the number row permanently on, but inexplicably included ≤ and ≥ in the base keyboard. Thanks GOOG. Idiots.)