What's Going Down at the Tiobe Index? Swift, Surprisingly
blog.metaobject.com
blog.metaobject.com
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).
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.
> 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".
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.
Anyhow, regardless, the point is TIBOE is measuring some meaningless stuff.
There’s not really any defending it; it’s just some arbitrary metrics about languages, not really worth paying attention to particularly...
It isn't a measure of popularity - its a measure of which languages either intentionally or accidentally have the best SEO.
https://www.tiobe.com/tiobe-index/javascript/
Javascript in 2019 only has 0.5% more market share than in 2004?
2019 has basically every new UI (and many rewrites of old ones) being built in Javascript, 2004 it was being used for the occasional drop down menu.
(Even if you include Typescript, the only compile-to-JS language in the top 50, it still only gets to 2.7% today compared to 2% in 2004).
See also C unassailably at number 2. I think we can all agree that in 2019, there is more active development in Javascript, than C - Likely it's benefiting from their methodology giving it credit for C++ and C#, so at least we can theorise about that one, but I really have no idea for Javascript.
Lots of developers use Javascript in the course of their work. Few of them will refer to their work as "Javascript programming" -- they will typically use either a broader term, like "web development", or a more specific one, like "React development". Neither of these would influence TIOBE's rankings.
I’m using DDG bangs to reduce the noise from the start and take me straight to a site specific result : `!mdn function apply` or eg `!php preg_split`.
Clojure is right next to it on the list. It’s not only compile-to-JS but 100% of the people I know using it use it that way.
yeah... no
> See also C unassailably at number 2. I think we can all agree that in 2019, there is more active development in Javascript, than C
bubbles, bubbles, bubbles. the immense majority of large companies I see start new GUI projects in Java, C#, C++, ... daily. Count the hundred of thousands of programmers working for gigacompanies like Samsung (with more than 40k devs), ATOS (122K employees, mostly devs), CapGemini (211k employees, mostly devs), etc... they are far from all doing JS.
Listen kids. A colossal amount of the software engineering that takes place on this earth is paid development for closed source apps and services. It's not on GitHub. It's not written in JavaScript. It's not done on Node.js. A great deal of it doesn't happen in California. And it dwarfs the amount of software on GitHub or GitLab.
It happens in Java and C++ and C# and Visual Basic and other not-sexy languages and involves writing crappy enterprise interfaces and tons of backend code.
The great thing about TIOBE is its a good indicator of what jobs are being hired for. That's why it doesn't match whatever trendy expectations most people expect to see in a languages ranking. That's why Visual Basic is always ranked so highly. Because the actual world of paid software engineering and your mental view of that world are wildly different.
Personally I think TIOBE is very valuable for what it's for. I tell young developers to use its top 10 list as a guide for where to invest your time IF you're taking a "safe" approach to career skills and employability. If you use one of the other guides for that, you may decide that learning new and exciting languages might be optimal for employment. Generally speaking that's not the case.
If one wants filter bubble expectations met, I recommend sticking to language rankings that are solely based on GitHub and other publicly available source code.
The best measure of a language's popularity needs to take job vacancies and github metrics as their most meaningful measures. Stackoverflow posts and google searches will help too but contain a lot of natural bias.
Example build.rs: https://github.com/emoon/rust_minifb/blob/master/build.rs
- 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.
Swift is just too much, too many things, and yes, they kind of dorked optionals. To me it's just trying to hard.
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.
No, they don't 'miss' it. I think what you're missing is that is perfectly possible to 'get' optionals and be as, if not more, productive than in ObjC. Not all people get the Swift model and for them it may be unintuitive, but many do get it.
I find it distressing that some developers just want to bang out code as fast as possible and any tool that tries to impose a bit of good software engineering in between that is seen as 'evil'.
I've seen similar sentiments expressed about Rust i.e. 'I'd rather take my memory leaks and data races over the borrow checker'. That's fine, but please be aware that I'll try my best to not let you execute any code on my machine if that's how you approach the craft.
And "let x = someOptional" doesn't, right?
So the first form does have something to do with Optionals, and it is true that the two forms of let behave differently with respect to them.
(I have moved on from Swift, so if things have changed since Swift 3.x and 4.something, my apologies.)
That is to say, the if statement is satisfied if the "result" of the "function" (if you follow me; clearly I don't mean it's actually a function in the implementation) returns .some(T) (not nil) rather than .none (nil).
That we can do an assignment with `let` is just syntactic sugar for:
if someValue != nil {
let x = someValue!
}
Basically, we want to know if the value is non-nil. There are instances where the result can be nil, and if so, nothing gets assigned. For example: protocol Fruit { }
protocol SeededFruit: Fruit { }
protocol SeedlessFruit: Fruit { }
struct Mandarin: SeedlessFruit { }
let mandarin = Mandarin()
if let someFruit = mandarin as? SeededFruit { }
Okay, so the compiler will actually disallow this, but you get the basic idea: `mandarin` is not a SeededFruit, the cast will always be false, therefore someFruit will be nil, therefore the "result" of the "function" will be nil, which is counted as false.The thing is, this isn't specific to the `let` keyword, either. You could just as easily define a new variable with the `var` command.
So `let` and `var` don't mean different things in different contexts and never have. Swift just allows them to be used as syntactic sugar in if statements.
switch someOptional {
case .none:
// whatever
case .some(let x):
// do stuff with x
}I suspect that might be a sympton of excessive complexity and parent's example of C++ seems spot on.
However, break from the old habits is hard. I was there moving to f# and the first month or so I try to bend the rules.
Same now with rust. I try to mold it as a OO language, and get SUPER annoyed with how rust is so different. But you embrace algebraic types and pattern matching and suddenly a lot of other hidden problem simple disappear forever.
You can see it all over the place in code people write, posts on Stack Overflow, etc. The Apple Swift book does a poor job explaining the rationale and benefit of using option types.
I wouldn't want to work with someone like that I doubt anyone else would, either.
I think optionals are a great way of saying: “Hey developer, this value can sometimes be nil; be sloppy or not, your call.”
Any language you pick is an interplay of choices and compromises. No such thing as perfect.
This is a common sentiment, but it rarely holds up to closer scrutiny (such as measurements...). Swift is both slow to run and very slow to compile. Both compile and runtime come with extremely high variance. Such unpredictability is arguably even worse than just plain slow performance.
[1] https://web.archive.org/web/20190402100249/https://benchmark...
Incidentally I've spent considerable effort on this problem, including writing a prototype faster JSON parser in Swift (still about 3x slower than Rust, but a huge speedup over what's there). I couldn't get anyone in the Swift community to care enough to motivate me to finish the work, which is indicative of a deeper problem: Swift just doesn't have "performance culture," the benchmark game results notwithstanding.
fannkuch / pidgins: essentially the same
binary-trees / fasta / Mandelbrot: ~ 1.5x slower
spectral-norm / reverse-complement: >= 2x slower
k-nucleotide / n-body: ~4x slower
regex-redux: 45x slower
And that is GOOD. This mean that wrong code look wrong:
https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...
and many instances of it mean something is badly wrong in the codebase, and the developer(s) haven't adapted to how must be done.
In contrast:
bad.shit.happends
Good look with that...- "let" is a mess
Overloading keywords have problems, but in this case the rules are simple. And is not that many context to worry about.
- I would much rather have = mean assignment
Agree. Overloading keywords are fishy, but operators are in another league!
Have some sense for maths but in other contexts is not worth the extra "feature".
- Reference counting is a bad compromise
You mean, ARC. Is not exactly the same, and the compromise is totally worth. I work with .NET for iOS/android and man, is heavy.
All is about what is default.
With GC, by default, eat memory and unpredictable destructors. With (A)rc only need to worry about break cycles. That not happened often enough to be a real problem
BTW, I have use obj-c, pascal, .net, python, rust. The ARC model is the best for most kind of code most do. I honestly have more unpredictable and unfixable problems with GC (mostly on android with underpowered devices), so I prefer to get something less automatic..
...as long as you don’t use any implicitly unwrapped optionals (which virtually all Mac/iOS code does), or use any frameworks that predate Swift (like AppLit/UIKit/Foundation), or wrap any C libraries (most third-party libraries in the world).
So basically that’s true for the 5-line samples showing how cool Optional is, and no real program I’ve ever written. It was a nice experiment but in practice I have more issues stemming from Optional than I ever did with nil.
> In contrast: bad.shit.happends
Do you not read any Swift forums? There are newbies posting every single day asking why "a.b.c" crashed in Swift.
That is fair. And totally show why optionals are the right thing. Because obj-c and others NOT have it the world suck MUCH more. That is why nulls are the billon dollar MISTAKE with capital letters.
The solution is to more and more languages, libraries and frameworks embrace the idea of algebraic types, not just declare "interfacing with old codebases with this huge MISTAKE is not nice, so why bother??".
What rust make nice is declare stuff as UNSAFE. I wish this was the case with swift and obj-c so make clear to everyone that you have entered the realm of nasty things and must be more careful...
- Optional has made null pointer exceptions virtually non-existent. There are occasions where deserialization does result in a nil value where one is not expected, but that's rare. I think this is as massive as garbage collection was back in the day.
- The language is in a sweet spot between something convoluted and heavy like Java and something overly simplistic like PHP/Ruby/Python. It's perfect for software development and large code-bases with a low learning curve.
- There is no magic (methods, properties, etc). Everything is explicit but not wordy. This may change in the future but I hope it never does.
- It's more legible than Kotlin with fewer unnecessary language features. Speaking of which...
- It's a simple language and its syntax is straight forward
It's not a perfect language:
- The package manager needs a lot of work
- Extensions can lead to confusion (eg. in the case of conformance to protocols (interfaces)).
- I would like an optional garbage collection system for long-running processes (e.g. server-side applications)
- I would like it to perform even better
You can nitpick syntax anomalies with any language, but a language is defined by how easy it is to scale to multiple programmers, how applicable it is to a problem, how well it performs, how easy it is to read for someone new to the system, how it helps the programmer not commit mistakes, etc. Of all the languages I've written, none has been as successful in all regards as Swift.
Wha? It has about 100 reserved words — more than C++, now, I think. Even its own designer said [1]:
“You’re unlikely to run into anybody that says that Swift is a simple language. Swift is a complicated language.”
If you consider Swift simple, what language do you consider complex? Of all the languages I've written, none has been as complex as Swift.
There are a lot of keywords in Swift, but that is not what makes a language complicated. They are all in English, after all. Symbols and unique concepts are what complicate a language because they are not explicit or unorthodox. For instance, using `:=` or `(setq x (1+ 2))` for assignment instead of `=`.
And then you end up with Java where you have to write so many boilerplates for getters and setters, even if they are only plain attribute access, just in case you want a function later.
This is such a bizarre statement to me. I have to wonder if the commenter has ever dealt with production systems or code that uses GC? Because with years of writing and tuning Java servers, I've long since come to the conclusion that GC is largely a false economy.
You still have to deal with memory leaks but the cause this time is objects maintaining references they don't need. Sure GCs become cleverer at detecting unused forests of objects and so on but this largely makes another problem worse: so-called stop-the-world pauses for a full GC. It's still an issue you have to deal with on Java, Go and probably every GC language.
This isn't to say that ref-counting is a panacea (what is?). Particularly on servers the critical region for updating the ref-count itself can become hot and a bottleneck.
But this isn't really a problem on mobile app code. I've long said that iOS's uses of ref-counting (ARC since 5.0+) is a strategic and competitive advantage to Android's Dalvik/Java GC.
Google's Plan9 2.0 (ie Fuchsia) makes me sad (for many reasons). Just one is that they've embraced Dart/Flutter at the application level (which isn't required as anyone who works on it will tell you, yada yada yada) but Dart is such a strange choice because it still relies on GC. What's the point?
Oh and just to be pedantic, you list ref-counting as a negative of Swift compared to Objective-C. ARC is orthogonal to that. Like I said, ARC came about in iOS 5.0.
Although I guess it doesn't matter much since the library ecosystem isn't there. I think it would have been an interesting choice for Flutter instead of Dart though.
For just memory management, I don't see the downside of GC (vs reference counting) if the latency is good enough. Sure you can still leak memory by maintaining references but at least it deals with cycles (and it's one less thing that any dependencies can screw up).
If GC latency is OK, the only remaining advantage of reference counting I can think of is the deterministic destruction of non-memory resources like file handles etc.
My Swift usage stopped in 4.x, so I'm unfamiliar with the 5.0 improvements.
Optional is the best thing that could happen to a language that allows nil values ( the only other option being not allowing them at all, but that’s not common).
If let ( and guard let) is an elegant idiom for unwrapping optionals safely, but that’s about the only cass you’re going to see a let in something that looks like an expression. The only complain you could have in that part in the language is between let and var, but that’s actually quite useful in practice for self documenting code.
Operator overloading could become dangerous, but it seems that it is used very sparingly in the swift ecosystem. Standard library doesn’t overuse it, so people don’t as well.
Reference counting to me has quite the same drawback as GC : it makes you forget about memory cycles and ownership. But apart from rust who tried something very different ( and is scaring a lot of developers), once again i don’t see a lot of other options.
I have no problem with var vs. let. I like that distinction. And I do understand that let is used only sparingly in expressions. But that's what bugs me about it, it is so limited. It is not an "orthogonal" feature, (usable in any expression). An expression is ideally functional (no side effects). Let definitely does have a side effect, declaring and binding an identifier. I find it awkward to mix the two ideas. This may be many years of mental baggage, from C, C++, and Java, but it is there, and I think that the introduction of such a major side-effect into the world of expressions is a genuinely bad idea.
GC vs. reference counting: GC really does allow you to forget about memory management. Until you start running into problems requiring GC tuning. But then, the fixes tend to leave the code alone completely. With reference counting, tuning requires more intrusion into code. Yes, this is subjective. Just explaining my reasoning.
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.
Because of this, I wouldn’t at all be surprised if searches aren’t common because Apple provides documentation, regardless of its quality.
I think also JS won a lot due to good documentation, in fact there used to be an SEO campaign to boost MDN docs because the JS docs used to be so bad making people write bad code, I think the language's reputation still didn't recover from that.
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.
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.
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.
Eh, you don't need to though. Python can be the glue for your tools, if you will. Writing the meaty parts can be done in C/++, while you glue everything together in Python, giving you the best of both performance and ease of writing.
https://medium.com/@richardeng/smalltalk-and-tiobe-5409afb19...
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?
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.
Now I wouldn’t even consider starting a new app in ObjC but it’s been a bumpy road to get to this point and the tooling is still pretty bad in some respects.
Tiobe is strange. Either they blend all Basic together (legacy code bases) or something more stupid happens :)
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.
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.
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.
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
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-comp...
IMO Rust's type system is more principled but does much less for you, and so is more annoying to use. As a simple example, incrementing a reference count in Rust requires a clone() call; in Swift this happens automatically.
I also find Swift's "inout" params deeply confusing (especially when aliasing is involved), and I wish it made dynamic dispatch more explicit (like Rust).
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.
The tradeoffs swift chooses make a lot of sense for mobile app development.
https://www.hntrends.com/2019/mar-postgresql-vs-mysql-no-lon...
That said I’ll take Swift over Objective C any day.
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?
Yes. Every Swift project I am aware of fights with this problem. Two of the CocoaHeads Berlin talks in the last year or so were about workarounds for slow Swift compile times.
For one, I computed the compile speed for the frameworks in question, it turned out to be in the double digits of lines / second. That's not bad, that's truly horrific, starting to get into "transcribe into machine language by hand"-joke territory.
The other talked about splitting all their UI features up into little mini-frameworks in order to be able to work on this one feature in isolation without having to compile the rest of the app. While I am a great fan of framework-oriented development, that's not really how that's meant...
Swift however has significant mindshare, there are even Swift-only iOS devs. Lots of developers and most materials have shifted to Swift. That’s where the excitement is.
Swift interopts with Obj-C well. Lots of development has switched over to Swift, even if the rest of the codebase remains Obj-C.
There will still be plenty of Obj-C jobs over the next 5 years, but there will be more Swift oriented jobs.
Swift is also making strides into other areas: Swift on the server is growing, Swift on Linux and Windows is improving, and Chris Lattner is forging ahead with Swift for Tensorflow.
Whether it is successful in any of those beachheads remains to be seen, but there is significant effort going towards them.