10 ms·
What's Going Down at the Tiobe Index? Swift, Surprisingly
- 3jckd 8y agoMy first thought once I saw this was "flutter". It's really getting a lot of market share in mobile dev and all you need to write is Dart, for better or worse. Also, whenever you need to do iOS specific duct-tape-plumbing, it seems that Obj-C is still more capable than Swift because of the accumulated legacy. However, take it as an educated guess rather than a fact since I have never been a mobile dev apart from hobby apps. EDIT: typos.
- seanalltogether 8y agoI've recently been stuck with a react native project and I was surprised to learn that objective-c is still the language of choice for interop.
- kitsunesoba 8y agoAs an iOS dev I’m not thrilled with Flutter because it’s tied to a niche language and like most cross platform toolkits, it throws platform conventions out the window. Apps built with it sit firmly in the uncanny valley, feeling somewhat smooth but still “wrong” due to dozens of small cues being wrong or slightly off somehow. And yeah, Objective-C is still the duct tape language of choice because it interacts well with C++. Swift handles plain C well but has no interior with C++ at all.
- VectorLock 8y agoI'd be curious to hear from iOS devs what they think is going on here. Did anyone try moving to Swift and what was the specific reason for going back to Obj-C?
- exelius 8y agoI would suspect it’s because even many of the core libraries are still written in Obj-C. Swift is neat and I really like it, but the ecosystem is such that even when using it on a new project you end up writing ~25% of your project in Obj-C.
- rimliu 8y agoThis sounds extremely strange. Last time I neede to write Obc-C was early 2017. My current project started as pure ObjC, now there is zero lines of this in production.
- kitsunesoba 8y agoDepends on the nature of your project but I can count the number of Obj-C libraries I’d be likely to use in my projects on one hand, and they all play secondary roles (e.g. analytics). For almost anything else Foundation/UIKit and third party Swift libraries would be used.
- gregkerzhner 8y agoI really like Swift as a language. To me it feels more elegant and less verbose than Objective C. However, the tooling around Swift is worse, so you have to live with longer compile times and other random bugs. This drawback is still not enough to make me go back to Objective C. Also, I am not sure I get the argument about ecosystem - you can easily include Objective C dependencies into Swift projects.
- asaph 8y ago> Swift is worse, so you have to live with longer compile times Is this truly a factor? Aren't the vast majority of mobile apps relatively modest in scope due to the very nature of the platform? How long does it take to compile an average Swift app?
- enneff 8y agoThe Tiobe index is not a reliable indicator of anything; their methodology is extremely noisy. A fractional percentage drop is meaningless.
- eyerishcoffee 8y agoAgreed, but having said that there are a lot of people developing for iOS who never made the switch due to past language instability and continued poor quality tooling. Outside of iOS I don’t think it’s made a dent and I would be surprised if things like Swift for Tensorflow make a difference there (if only because the number of ML devs is very small and the appeal of Swift for ML is also pretty small).
- brianprovost 8y agoThis is the impression I get as well. VB.NET > JavaScript? Here's what they say about their methodology: > The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written.
- duskwuff 8y agoAnd some of that "methodology" is seriously suspect. > Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. Bing and Yahoo! are both front ends to the same search engine. Wikipedia, Amazon, and YouTube aren't general-purpose search engines at all, and it's unclear how accurate the results of a Baidu search would be for English-language search terms like "Javascript programming".
- duskwuff 8y agoThe Tiobe index is based entirely on search engine result counts. Those numbers aren't even particularly meaningful as a count of web pages; treating them as an authoritative source of programming language popularity, as TIOBE does, is ridiculous. There are a couple of really strange comparisons you can spot in the results. For example, Scratch -- a visual programming language made for children which is only usable on its own web site -- is ranked higher than TypeScript, Lua, Scala, Kotlin, or Rust. Similarly, D -- a proposed replacement for C++ which has never found any real traction -- is ranked even higher.
- mpweiher 8y agoOh, and it appears that Smalltalk has at least re-entered the top 50 after a 5 year absence: https://medium.com/@richardeng/smalltalk-and-tiobe-5409afb19ef3 https://medium.com/@richardeng/smalltalk-and-tiobe-5409afb19...
- Yhippa 8y agoThis took me down a rabbit hole. I wonder if there are any legit reasons to use Smalltalk (Pharo) these days?
- raphlinus 8y agoI'm an extreme outlier, but I'm about to start an Objective-C codebase (a 2D renderer on top of Metal), because I suspect interop with Rust will be a lot easier. In particular, it looks like you can just build .m files from a build.rs, and I'm pretty sure that's not true with Swift. It's also possible to invoke Obj-C from Rust using the dynamic features, but I think that's both code bloat and a runtime cost. [I'm interested in exploring these issues further, but it's probably outside the scope of this HN thread, get in touch if you want to discuss.] Example build.rs: https://github.com/emoon/rust_minifb/blob/master/build.rs https://github.com/emoon/rust_minifb/blob/master/build.rs
- saagarjha 8y agoWhy can’t you build Swift from your build.rs?
- raphlinus 8y agoMaybe I can, I just haven't found an example of it. Certainly the "cc" crate doesn't seem to know how to compile Swift files. This might be more of a documentation issue than a real technical limitation though.
- saagarjha 8y agoIf you can figure out a way to run arbitrary commands, I’d suggest looking at swift -frontend, which works like you’d expect a normal compiler to.
- suraj 8y agoIf you want to call rust from Swift, it should be easy. I work with C libraries and it easy to interface with module maps. However, with objective C the interoperability is trivial. As long as you pay attention to retain cycles, you can hold reference and call objc methods directly. That said, please make sure your framework can be imported into Swift properly. As most of the users will be using Swift.
- 8y ago
- geophile 8y agoI don't care about the random TIOBE fluctuations. But I really don't get the love for Swift. - Optional is a nuisance and I don't think it is highly effective at preventing the dereference of a nil pointer in practice. People are going to fiddle with ? and ! until their code works, and the protection that Optional provides then disappears. - "let" is a mess. In one context it means unwrapping an Optional. In another, it doesn't. If you use it in an expression, it interferes with the usual refactorings that people apply to expressions. - There is so much fussy detail around preserving the syntax of object.field = expression. didSet, willSet, getters, setters, oldValue, newValue. WHY IS THIS SYNTAX SO FRIGGIN' IMPORTANT? One of the justified criticisms of C++ (IMHO) is that operator overloading means that all sorts of functions can be running under innocent-looking code. I would much rather have = mean assignment, and use function call notation when I really want functions to run. - Reference counting is a bad compromise between the unpredictability of GC, and the burden of explicit memory management. It's mostly unobtrusive, but I've seen examples of code that require careful and non-obvious use of weak to avoid memory leaks, (sorry, I don't have the reference handy). It sure beats Objective-C, and it does have some nice modern features, but I think they made some unfortunate design choices.
- sonnyblarney 8y agoI don't think there is a 'love' so much as it's the future of iOS platform. Swift is just too much, too many things, and yes, they kind of dorked optionals. To me it's just trying to hard.
- christoph 8y agoI'm glad I'm not the only one who feels this way. I used to absolutely love writing Objective C, like totally get into a zone and lose track of time. I've never managed to achieve that same feeling with Swift.
- fooker 8y agoThis is what most people seem to totally miss. You want to solve interesting problems. You do not want interesting tools getting in the way. A boring, old, flawed tool would often work better for solving the problem without interruptions.
- barbecue_sauce 8y agoMy main issue with Swift, at least initially, was how much of a moving target it was/(is?). It's been in public use for under five years and it's already on it's 5th major version. I'd learn it to a certain degree, start working on something else, then come back and find that a lot had changed while I wasn't paying attention. That said, the difficulty in iOS development stems from getting a good understanding of the core libraries, and thats much easier to do in Swift than in Objective-C (unless you're already familiar with that language or coming from something like Smalltalk).
- saagarjha 8y agoSwift is no longer a moving target.
- plorkyeran 8y agoSwift 3 was the last version that had dramatic changes. The first two years it was pretty upfront about being a work-in-progress that wasn't for people who wanted something stable, and the last two years it's been pretty stable with only very minor incremental changes.
- infinisil 8y ago> The first two years it was pretty upfront about being a work-in-progress that wasn't for people who wanted something stable I've been very much on the Swift train in its first 2 years, but I've never heard of anything like that. Do you have a source?
- pixelrevision 8y agohttps://swift.org/blog/abi-stability-and-more/ https://swift.org/blog/abi-stability-and-more/ Almost every release has been pushing towards this. That’s not to say that that swift has been “unstable” as it was pretty solid from the beginning but they did make it pretty clear that you would need to accept a lot of changes in the early days.
- cageface 8y ago
- mountaineer 8y agoNot much movement for Swift either direction in the job postings shared in the monthly whoishiring thread, but still consistently beating Objective-C https://www.hntrends.com/2019/mar-postgresql-vs-mysql-no-longer-close.html?compare=Swift&compare=Objective-C https://www.hntrends.com/2019/mar-postgresql-vs-mysql-no-lon...
- karmakaze 8y agoSwift is a good but not great language considering when it came out. One good thing about it is that it lets iOS apps run as well as Java/Kotlin apps in ~60% the memory. I'm sure the layers of legacy Android APIs also contribute to this. The other good thing is that it's close enough to Kotlin to switch between iOS/Android without as much friction.
- js2 8y agoI code for iOS (in ObjC) and Android (in Java) and honestly the language differences are trivial to me. The much harder parts to deal with are the APIs and the IDE differences. (In particular, I really loathe gradle and Android Studio.)
- childintime 8y agoTiobe compares search engine queries and lists the most popular languages mentioned in its list. So as an example PHP will naturally end up high on the list and Closure will end up low. Because PHP has lots of irregularities to check, and Closure doesn't. So it might be Swift is simply a better language than ObjectiveC?
- symlinkk 8y agoI don't see Swift used for anything outside of iOS development. I don't really think it has enough to offer over more neutral languages like Python or TypeScript to make it worth the time of learning a new language. It's in a position similar to C# in my opinion.
- zmmmmm 8y agoMaybe over TypeScript but I would love it if Swift displaced Python. Python is ridiculously popular for some good reasons (the clarity of code that tends to come out of it) but a whole lot of bad ones - complete lack of an effective type system, no usable multithreading etc let novice developers write bad code lazily without really feeling bad and it still passes as good code ... it's effectively the PHP of this decade.
- sk0g 8y agoThis simply won't happen till Swift can interop with C, C++ and possibly even ASM, fluently. Even then, you need structure, data types, and actual foresight while writing code, which leaves out all the less CS/SE trained peeps, such as scientists. And Swift is never going to be better as a scripting language. Lua, Python, Bash etc all have a few things in common, and Swift would stand out like a sore thumb in that company.
- mwfunk 8y agoHow would you improve the existing C/C++ interopability in Swift? What needs to work that doesn't work right now?
- jasonhansel 8y agoI really wish we could build iOS/Cocoa apps in Rust. Like Swift, we could use reference counting instead of GC, but Rust has a much nicer type system.
- blub 8y agoSwift's type system was designed to make developers happy, Rust's to make the borrow checker happy. As it turns out, some people think like a borrow checker and don't have any issue with Rust's choice. But most don't and we should not make them miserable.
- drb91 8y agoMake some developers happy* The tradeoffs swift chooses make a lot of sense for mobile app development.
- jasonhansel 8y agoWell, really it was designed for ObjC interop. Hence the limits on (e.g.) generic protocols.
- m463 8y agoFor years and years I've really thought ios/macos should support scripting languages to build apps. For instance, why can't you build an app that does something useful in python or bash or perl? The way I see it: - applescript is not good - cocoa and swift require compilation and generally xcode - there are hacks that let you do a thing or two through osascript (back to applescript anyway) - there are other hacks like PyObjC or python with tk, not really useful
- mpweiher 8y agoI think you're spot on, in that a lot of iOS/macOS is gluing together existing components, very much like a scripted-components/Software-IC[1] pattern. For most of this, a scripting/coordination language would be great. However, it needs to be interactive, not require the same (if slightly faster) Xcode build cycles. Also, most of those languages interoperate only partially. My crack at this is Objective-Smalltalk[2]. It can script interactively [3][4] and is a full-fledged programming language. [1] https://blog.metaobject.com/2019/03/software-ics-binary-compatibility-and.html https://blog.metaobject.com/2019/03/software-ics-binary-comp... [2] http://objective.st http://objective.st [3] https://www.youtube.com/watch?v=sypkOhE-ufs https://www.youtube.com/watch?v=sypkOhE-ufs [4] https://www.youtube.com/watch?v=sypkOhE-ufs https://www.youtube.com/watch?v=sypkOhE-ufs
- tonetheman 8y agoNot sure I believe much in what Tiobe has to say about programming languages but I would happier if Objective C was dead forking last.
- epynonymous 8y agohave used swift since version 2.x to create several mobile apps so i consider myself proficient, for the record, i have also used php, nodejs, c/c++, java, ruby, python, and golang quite extensively. i consider myself a full stack developer. regarding swift, i am not a fan of the language at all, i use it more out of necessity, when i started to write ios apps, swift was available and i had already gotten used to not having to deal with memory management and such so chose the language, i also thought objc as a language for ios apps was a bit too verbose after looking at some tutorials, i had been used to using interpreted languages and syntactically concise languages like golang so thought i'd give swift a try. somehow, over the years, i've managed to write a few apps with swift, so it does the job, the 2 things i dislike the most is the "as/as?/as!" statement, e.g. when i have a dictionary like object [String: Any] and having to "as" that is annoying to me, and you can't cast which to me is more direct, you have to first "as? Int" and then de-convert the optional with an ! The second thing i really hate about the syntax is the whole thing with "let" constants, i'm fine having to check for NULL first, but to do if let apples = fruits["apples"] as? String {...}, i guess this is kind of related to the first issue. my swift code is such a spaghetti mess of these statements, i imagine a lot of it has to do with me, but this doesn't seem to be a problem with other languages. it could also be that i'm just trying to plow through the code so that i can get functionality working asap.
- infinisil 8y agoIf you're doing so much casting you're doing something wrong. Swift's power comes from the type system, which alleviates the need for all casting in general. Instead of using a [String: Any] dictionary which bears no meaning at all, consider converting it to a struct with accessors of the right types. If you work with the type system, Swift will be a joy to use, because that's where it shines.
- pixelrevision 8y agoI’d agree with this completely. A lot of the people I see having issues with it are trying to write it like python or something. For this style of coding objective-c is a much better choice.
- baron816 8y agoIs there any good reason why Apple couldn't just let us code apps directly in JS/React and not have to go through React Native with its overhead? React surely isn't perfect, but it's likely the best way to create large scale UIs. Far better than Swift.
- millstone 8y agoNeither React nor Swift can create UIs alone.
- saagarjha 8y ago…they can?
- millstone 8y agoReact is a set of JS APIs and tools that live on top of a an underlying model (the browser DOM, litho, etc.) Swift is a programming language. The comparison doesn't really make any sense.
- saagarjha 8y agoWell, yes, but this is a pedantic comment in relation to the post you were replying to.
- millstone 8y agoIt wasn't meant to be. OP expressed a desire to "code apps directly in React" and avoid "React Native with its overhead." But that's meaningless: the React design is a layer on top of an underlying model, and that layering will always impose some overhead.
- shuoli84 8y agoPersonal opinion: if the index is based on search, then if one language has better documentation, better ide support, less surprises, then the search count will be less and probably has a lower ranking in Tiobe. And also, since swift's adoption domain mainly in ios development, it heavily affected by the iOS ecosystem. My take on why objective c is higher ranked, not because it is better, but it has tons of gotchas, that people have to do heavy search to get things done.
- kyberias 8y agoThis is not a rank of which language is "better". It's merely about usage. I'm sure there is a lot of documentation and not that many "gotchas" in Java for that to be the reason for searches by Java developers. There are a lot of Java searches because Java is popular.
- Hamuko 8y agoDoes Swift have "better documentation"? Because I've always found Apple's developer documentation a bit lacking.
- danpalmer 8y agoIt might be lacking, but there is definitely a culture within iOS of using the Apple docs for things, Apple tooling, Apple development practices, etc. It’s a much more closed ecosystem in many ways than most of the other ecosystems I’ve been exposed to (JS, Python, Ruby, even .NET in some ways). Because of this, I wouldn’t at all be surprised if searches aren’t common because Apple provides documentation, regardless of its quality.
- cageface 8y agoTo the extent that this is even meaningful I suspect it reflects a disenchantment with native apps in general. The app goldrush is long since over and getting an app on a user’s home screen now is extremely expensive and difficult. That said I’ll take Swift over Objective C any day.
- deleted 8y ago[deleted]
- Doubl 8y agoThe tiobe index always seems to be way out of line with the other indices out there. Nobody but tiobe ranks VB.net above c#. Also the other day I read that Lazarus isn't taken into account in terms of assessing the popularity of object Pascal, because Lazarus is an IDE, not a language. Tiobe also seen to be constantly tweaking the methodology such that if you look back at historical rankings they can be totally different to the rankings for the same period that were reported historically. Which is verging on the dishonest. It would be like a tipster going back and revising his tips after the fact.
- oaiey 8y agoMicrosoft own "statistics" claim million of C# devs, 100ks of VB.NET devs and 10ks of F# devs. Tiobe is strange. Either they blend all Basic together (legacy code bases) or something more stupid happens :)
- staffanj 8y agoIts not strange. Just a result of bad input. Search for: +"C# programming" - 2 340 000 results <- USED +"Visual Basic .NET programming" - 17 000 000 results <- USED +"C# .NET programming" - 26 600 000 results.
- oaiey 8y agoOkay. So it is "more stupid happens" :).
- Doubl 8y agoSo is c# the new vb6 then!
- oaiey 8y agoThat would break my heart.