4 ms·
I'm not an expert on programming languages and for me they are the format that I obey to express myself to the computer to make it do things, Therefore I won't
by mrtksn 5y ago
I'm not an expert on programming languages and for me they are the format that I obey to express myself to the computer to make it do things, Therefore I won't be able to tell you what are the strong points and advantages of Swift over other alternatives.
What I can tell you though, is that the language is easy to read thanks to the choices they made in the way the syntax is and the language has enough abstraction tools to let me keep the parts of the code that I'm not actively working on away. For example, I like to use the property wrappers and extensions to put away the code that I'm done working on.
I also like that its strongly typed but also gives me enough wiggle room with generics.
I like the concept of protocols to vaguely define the basics of some kind of data structure and be able to pass around different flavours of it as if I'm on a weakly typed language where functions can take whatever you throw at them.
Another thing that I like about swift is that the toolset Apple provides. I used to do JavaScript as my main language but I got sick and tired of the amount of effort to keep the stack together. Endless number of tools that have many alternatives that do the same thing in a slightly different way, hours and days spent in configuring them is something that I don't want to go through anymore.
With Swift and the tools that Apple provide(various frameworks and xCode) starting something new to thinker on is as simple as creating a new Word document. It reminds me of the PHP workflows a bit, where you type your code in a text fil, put it in a folder and see the results immediately.
Essentially, I like the comfort of using Swift.
- cableshaft 5y agoProperty Wrappers seem pretty neat, I wasn't aware of that new feature. Thanks for mentioning it. https://www.swiftbysundell.com/articles/property-wrappers-in-swift/ https://www.swiftbysundell.com/articles/property-wrappers-in...
- Jtsummers 5y agoBecause it's a bit of a pet peeve of mine, what you term "strong" and "weak" are more typically called "static" and "dynamic" typing. They do not correspond to "strong" and "weak" as a general rule. Python, for instance, is "strongly" typed (try printing the result of `2+"3"` in its REPL) but also dynamically typed. Neither "strong" nor "weak" typing is well-defined, but the most consistent differentiator is about implicit conversions or casting. Like in Perl you would get "5" as a result of printing out that previous expression.
- mrtksn 5y agoThanks for the elaboration.
- Someone 5y ago“Endless number of tools that have many alternatives that do the same thing in a slightly different way” I think that is a risk that almost invariably comes with being open and popular. I saw the same thing with C# vs Java. In Java, you don’t have a logging API, you have a meta-logging API into which you can plug multiple logging libraries. Similarly, there used to be (maybe still are) zillion of viable options for parsing XML, json, different build systems, etc. That brings flexibility, but at the price of having to spend time picking the best tool and anxiety about the grass at the other side, maybe, being greener. Often, eventually, the dust settles and a clear winner emerges, but that’s not a given, and doesn’t help you when you have to make choices before the dust has settled. I don’t follow JavaScript closely, but I think it definitely still is in the “before the dust has settled” phase.