Live data from Hacker News

Swift is like Kotlin

nilhcem.com

141–150 of 364 posts

Re: Swift is like Kotlin

#141
post #71

Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.

> Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base.

This sounds really stupid, considering that many Ukrainian programmers are already using JetBrains products and that punishing a great company for the actions of politicians is kind of sad.

Re: Swift is like Kotlin

#142
post #42

Earlier quoted context omitted.

Having never used Swift, it feels like the syntax is being optimized for the less-common case; are named parameters considered the "default" choice in Swift, and is using different external names so common that it's worth cluttering the syntax for functions without external parameters in order to make the their own syntax easier?

Named parameters are very much the default in Swift. Positional parameters are rare exceptions. The internal/external name divide often works out beautifully. For example, let's equip Double with a multiply-add. An idiomatic Swift signature: extension Double { func multiply(by multiplier:Double, adding summand:Double) -> Double { return self * multiplier + summand } } print(3.multiply(by:4, adding:5)) Erase punctuati…

The javascript equivalent would be something like

    Number.prototype.multiply = function({by:multiplier, adding:summand = 0}) {
	return this * multiplier + summand
    }

    console.log((3).multiply({by: 4, adding: 5}))
But of course, javascript APIs are hardly ever written like that. I think it's interesting how the norms of your ecosystem and very small differences in ergonomics in expression make a big difference in behaviour.

Re: Swift is like Kotlin

#143
post #129

One has structures, ARC, proper extensions, good protocols/interfaces, flexible enums, and runs natively. The other one doesn't. I think I'll choose the former.

They're not really in direct competition. Try writing an Android app in Swift, or an iOS app in Kotlin. Technically possibly either way, but one's definitely more suited than the other for each purpose.

That's more about APIs and vendor support than language tbf.

As chance might have it, the Swift documentation has a section on programming for Android: https://github.com/apple/swift/blob/master/docs/Android.md

And RoboVM has an article on using Kotlin for iOS development: https://robovm.com/kotlin-for-cross-platform-mobile-app-deve...

Re: Swift is like Kotlin

#144
post #71

Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.

> Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This sounds really stupid, considering that many Ukrainian programmers are already using JetBrains products and that punishing a great company for the actions of politicians is kind of sad.

Would you work in a programming language called Hitler?

Any multinational company needs to do their research before deciding on a name.

Re: Swift is like Kotlin

#145
post #71

Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.

> Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. Well, except if you are an Ukrainian of Russian descent and root for the (ex)home team...

Which is actually not the case for most Ukrainians of Russian descent:

  Most of ethnic Russians in Ukraine signed for the 
  Ukrainian army, fighting against Putin’s invasion, 
  against the same Russians that came from the other side.
(from http://marginalrevolution.com/marginalrevolution/2017/05/con.... Note the source is Kasparov, who is not an entirely unbiased source where Russia is concerned ;))

Re: Swift is like Kotlin

#147
post #71

Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.

Also Kot means faeces in German.

And MongoDB means RetardDB which on the other hand actually is a reasonable name.

Re: Swift is like Kotlin

#148
post #136

Earlier quoted context omitted.

A simple heuristic: if a developer has a hissy fit over the project names of Coq, Brainfuck, or Stalin, don't work with them.

Ah, but is there a line? Where does it get drawn? Without explicitly naming them, once you get into the realm of Stalinism or the holocaust, surely it wouldn't take too much imagination to come up with a few names too unsavoury even for you?

I don't see a line. Though if there's an element of humor I see an orthogonal anti-line that will annihilate any attempts at line-drawing.

I'm sure you could find a name that if not met with indifference or a laugh would elicit from me an eyeroll or a statement like "come on, that's dumb" or maybe "that's just asking to derail conversations" but I don't think you could 'trigger' me into a fit. (Of course you're welcome to try via email.) It's just a name.

Re: Swift is like Kotlin

#149
post #56
post #54

Earlier quoted context omitted.

I think it likely that labeled arguments were introduced mainly for Objective-C interoperability.

For Obj-C fans though, named arguments are one of its best features. Yes, more verbose, easy to decipher, and led to great API design. For the first versions of Swift, they actually had two versions. For functions (i.e not functions inside classes), you didn't have to have named arguments for the first parameter, but you did for methods (functions inside classes). They explicitly added it for Swift 3 to make it more…

That's not quite right, the special case was the `init`s, where all the parameters were named, whereas the first parameter of `func`s was not named. This kind of made sense, as you could put the name of the first parameter as part of the function name, which is impossible for an initializer. In the end, they normalised it to all parameters being named.

On a side note, I like the _, it's a clear signal of not caring about something and doesn't take up a lot of visual space.

Re: Swift is like Kotlin

#150
post #71

Here in Ukraine it would be very hard to get adoption of a programming language that is named after a Russian military base. This is the rare case where bad naming choice really hurts. No matter how good is the language, you will have to hear and pronounce that name many times a day, and even associate yourself with it (e.g. "a Kotlin developer" in your resume). Not something to be taken lightly.

> Here in Ukraine it would be very hard to get adoption of a programming language ... just for curiosity, do you still have access to Internet and https://github.com/jetbrains/kotlin ? I have heard that social networks and many other services in Ukraine are prohibited by the government (after prohibiting other media like TV and newspaper) and now people are installing VPN and other tools by using experience of China…

Ukrainian here. Where did you hear that? Don't read news there anymore, they manipulate you. Ukraine introduced sanctions against russian businesses on its territory. As part of those sanctions, websites of three major russian IT companies have been blocked. That included Yandex (which is very similar to google, also has a lot of web services), and a couple of russian social networks.
Post reply on HN