8 ms·
Whenever possible, I like using tech that I can mostly understand. A small simple language is something Swift is not.
by tambourine_man 8y ago
Whenever possible, I like using tech that I can mostly understand.
A small simple language is something Swift is not.
- saagarjha 8y agoSwift aims to be useful even if you don't understand parts of it by the principle of progressive disclosure.
- duncanawoods 8y agoHardly. Trying to read someone else’s code is “smack you in the face with a book” disclosure. Go/C# pose no issue but things like c++ cause total wtf where other people’s taste/habits become mutually unintelligible dialects.
- ken 8y agoAnd that is an interesting experiment and perhaps a worthy goal, but having used Swift for a few years now, I don't think they succeeded at this. I'd say it demonstrated that "progressive disclosure" may be a great concept for games, or apps, but there's just way too much difference between someone new to programming and a professional programmer for a language to cover all these cases. Apple doesn't even have a non-pro Final Cut any more. Even in my first few days, having read Apple's Swift documentation, I had to continuously resort to StackOverflow for answers, which frequently sent me to the language grammar (which had many mistakes in it, and I think still does), and the Swift bug tracker. The inflection point on the learning curve is right after "hello world", which makes for great demos, but that's it. Personally, I think even Common Lisp does a better job at progressive disclosure. There's huge areas of CL that you can simply ignore. I worked in CL for years before I bothered to learn about conditions, special variables, or 90% of LOOP's features. In Swift, almost right away I had to read everything related to errors. You can't ignore it, except in the simplest program. I studied generics in college, as part of my data structures class, or maybe my compilers class. I've watched Alexis Gallagher's "PATs" video at least 3 or 4 times. I still don't understand Swift generics. Or maybe I understand what tools are provided, but I don't understand why you'd build (or want) a tool that makes it so hard to, say, define a new type with an "isEqual" method to determine if it's the same as another. Every Swift programmer hits the "protocol can only be used as a generic constraint" phase pretty quick. My complaint with Swift generics was never that they're too simple. It would be great if this were just a corner that PL/type-system geeks could geek out on, but it's an area that you can't ignore.
- melling 8y agoWhat’s your ideal simple language? I’d argue that with type inference, immutability, and non-null as a default, Swift is an easy language for anyone to be productive quite quickly. let x = “I’m immutable and not null” let favorite = [“Java“, “Perl”, “Swift”].shuffled().first
- romanovcode 8y agoWhy is `shuffled()` a function and `first` a property? Seems weird and not simple.
- saagarjha 8y agoWhile you are free to implement functions and properties however you like, usually it's pretty clear which one is which. shuffled performs non-trivial computation and doesn't seem like an intrinsic property of the array, so it's a function; the opposite is true for first.
- skohan 8y agoAlso on an immutable array, `first` should always return the same value where `shuffled()` may return different values each time it's called.
- ninjaoxygen 8y agoIf it anything like C#, .shuffled needs to return a new object and has some expense incurred to achieve, so is a function/method, but .first is immediately available, requires only a trivial amount of calculation and does not return a new array/list, so is a property.
- the_duke 8y agoYeah first being a property is weird to me too. Although I do believe Swift has "virtual properties" that are really a method under the hood.
- deleted 8y ago
- omeid2 8y agoThat works only until what you can "understand" and "want" changes. I really like to learn everything about every tech that I use, bordering on obsession, and after a few solid times that I hit roadblocks or had to fight with the tool because it is too "simple", I started to grok the difference of "simple" and "easy".
- wool_gather 8y ago> the difference of "simple" and "easy" Don't know if you were already referring to Rich Hickey's talk on this, but if you weren't, it might appeal to you. Simple Made Easy: https://www.infoq.com/presentations/Simple-Made-Easy https://www.infoq.com/presentations/Simple-Made-Easy "Okay, the other critical thing about simple, as we've just described it, right, is if something is interleaved or not, that's sort of an objective thing. You can probably go and look and see. I don't see any connections. I don't see anywhere where this twist was something else, so simple is actually an objective notion. That's also very important in deciding the difference between simple and easy."