14 ms·
Kotlin Is Better
- cromwellian 9y agoThe only problem with Steve's rant is that he starts out describing his experience with APIs, but then it turns into an issue of better languages. Presumably Kotlin doesn't wrap the entire Android API with some kind of better API, but most Android API calls would be direct Kotlin->Java calls, so how does Kotlin solve the nasty API issue? Really, this seems to be another Java critique by Steve. He's also written critiques against typed languages in general, including Scala. Android's API issues are language independent I think. Compare the design of Guava vs Android, you can make well designed and easy to use Java APIs, it just takes thoughtfulness.
- Scarbutt 9y agoI was asking myself the same question, then he wrote: Kotlin manages to help you route around just about all of Android's Red Lights, and turns the experience into something that on the whole I now find superior to iOS development. I haven't done any android and don't know kotlin either, so maybe someone here who does can expand on this.
- andybak 9y agoAnd this paragraph: > I was first in line to throw the Android book at the wall and give up last summer, but now with Kotlin I'm finding Android programming is, dare I say it -- enjoyable? I think this suggests that Android's "bad" APIs weren't all that bad to begin with, but rather that Java has been masking Android's neat functionality with a bunch of Java-y cruft.
- cromwellian 9y agoI don't think it's Java fault per se, just the API design. Java8 streams, RxJava, BufferKnife injection, Guava, etc are pretty nice to use, especially in combination with Java8. There's no async/await, but if you use ReactiveX, you don't really need it. Kotlin looks very nice, I'm just pointing out that if the Android View/Fragment lifecycle design is an issue, language design isn't the cause or solution, and most likely, you will need a middleware/facade to mitigate it.
- stevenwoo 9y agoI don't know Kotlin but I have done both IOS and Android programming and they both have their plusses and minuses compared to each other. I am not a superstar programmer like Yegge, learned IOS first and Android seemed really weird coming from that background but I eventually grokked it and converted existing IOS app to Android, and next few apps we did I wrote it for Android first. One key obstacle for me to get over is that some of the stuff one learns by attempting to learn through Google's documentation and copying their examples is pretty horrible in a non-toy app. IIRC I had to learn this the hard way by making an app and finding it getting geometrically harder in complexity when adding features one by one with image downloading async tied to activities and message passing from service to activity tied to message number/activity number.
- hota_mazi 9y agoI think Steve is unjustly being harsh on the Android API, probably because he's not very experience with it, and I suspect that he'll be hard pressed to produce an example of an API that's completely ugly with Java but is somehow good with a Kotlin wrapper.
- jackmott 9y agoextension methods may be what provides him the ability to fix the api to his liking.
- Larrikin 9y agoExtension functions as mentioned are extremely useful. There's just some functionality you need on different types of Android classes (especially views, activites, and fragments) very often but it really isn't worth it to subclass it since not all views or activites need all of the functionality. The improvement to findViewById was met with tepid applause today because its hardly used anymore due to there being a lot of better options. Kotlin's Android Extensions for the most part has completely eliminated one of big use cases I had for the data binding library, which was refactoring a view where an id and/or the type of view changes and also not needing to constantly have the xml open to directly compare which ID I need to use. I assume its also true for people using a tool like Butterknife. The autocomplete in the IDE could use a little help but its still great. Anko makes the awfulness of dealing with SQLite on Android almost bearable, although I've only briefly experimented with it. Creating views in code also seems like it is a much more pleasant experience with Anko, although I also have only briefly experimented with it. My day job had me creating fairly complicated views where a preview was absolutely needed, but a lot of apps don't have that complicated a view hierarchy and would probably benefit. This is just off the top of my head without even looking through the codebase or at my experiments. Edit: Forgot to mention being able to write an async task like async() { val thing = ... uiThread { method(thing) } } Is just lovely
- cel1ne 9y agoIf you got time, play around with extensions with multiple receivers, you can do pretty neat stuff with them. See my comment here: https://news.ycombinator.com/item?id=14365317 https://news.ycombinator.com/item?id=14365317
- fauigerzigerk 9y agoWhat's the advantage of extension functions compared to plain functions? fun String.shout() = this + "!!!" fun shout(s: String) = s + "!!!" Looks pretty much the same to me. Extension functions use static dispatch so what's the point of using member syntax? Also, extension functions can be overwritten by a member function with the same signature. That seems quite fragile to me considering the class and the extension function very likely have different authors. That said, I don't know Kotlin very well. So perhaps you can set me straigt on any misconceptions I may have.
- seanalltogether 9y agoI agree. The Activity and Fragment lifecycles that create such a pain are based on architecture decisions, not language. Kotlin can't overcome the fundamental fact that activities are stateless, and all the knock-on effects this creates.
- wtetzner 9y agoWell, he does say this: > but now with Kotlin I'm finding Android programming is, dare I say it -- enjoyable? I think this suggests that Android's "bad" APIs weren't all that bad to begin with, but rather that Java has been masking Android's neat functionality with a bunch of Java-y cruft.
- nemothekid 9y ago>And Android has some pretty big red-light APIs. Fragments, for example, are a well-known Flagship Bad API in Android. Ugh. I left Android development right around Honeycomb - where Fragments were supposed to be the cool way to manage your app and you'd get screen orientation and device screen configuration all for almost free. In practice I found Fragments far more confusing to use than the already complex Activity lifecycle. To hear that 3 years later that everyone may think Fragments were a bad idea doesn't leave me feeling good.
- deleted 9y ago[deleted]
- lokedhs 9y agoIt's not so much that fragments is a bad idea as a concept. It's that its implementation is a textbook example of bad API design. I dovt know about other people but I certainly end up cargo culting every time I want to use the fragments API.
- annnnd 9y agoInteresting - I thought it was just me. I couldn't comprehend the way they are supposed to work until I spent lots of time figuring it out. And then I had a year off Adndroid and when I came back I couldn't make sense of my own code... awful interface. I have no idea why they didn't replace it with some better concept.
- runT1ME 9y agoDoes anyone remember when he wrote this? http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.ht... And in the comments section he got lit up because he was unfamiliar with Haskell/Scala/OCaml type languages... and here he is 9 years late to the party touting a baby version of these statically typed FP languages. I actually laughed out loud reading this blog post.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- chr1 9y agoWell, here he says that kotlin is better than java, not that statycal typing is better, so it's not an argument in favor of one of those "all frog legs and calf brains and truffled snails" languages;)
- deleted 9y ago[deleted]
- wand3r 9y agoI mean guys been blogging for ages and it's been like a decade so maybe his position changed or he is contradicting himself. No dog in the fight personally as I don't use any of that stuff. Maybe I am missing some deep technical blunder but on the face of it seems a bit silly to cite the guys decade old work against his current; then be surprised they aren't fluidly consistent..
- runT1ME 9y agoIt's not that there's anything wrong with someone changing their mind. I certainly thought FP was useless ten years ago, java was the best and generally had some bad ideas about software engineering. However, the difference is I had the sense to not blog about things I only had cursory knowledge of while attempting to sound like the ultimate authority on the matter...
- barrkel 9y agoOther language built around IDE support: Delphi. The compiler was built with callbacks to provide code completion; it runs in process, as a DLL, as part of the IDE. No accident that Hejlsberg also design C#, and innovated further with TypeScript's language server. He wrote the original Turbo Pascal (IDE + Compiler in the same executable) in assembler, so he's been building IDE + language combos all his life.
- comboy 9y agoOh Delphi.. every time I fight with CSS and think about how easy making GUI apps used to be almost 20(sic!) years ago, I feel like something went wrong. Mandatory: https://www.youtube.com/watch?v=8pTEmbeENF4 https://www.youtube.com/watch?v=8pTEmbeENF4
- panzer_wyrm 9y agoBorland management went wrong. 20 years...
- flukus 9y agoI had to do maintenance on an old winforms app recently, it's insane how simple it is to develop with, how quickly it starts up and how quickly it show users the data they want. I signed myself up as the project maintainer. And even that is an incredibly bloated technology compared to delphi.
- jackmott 9y agoyep. yep. yep.
- marktangotango 9y agoSo did Delphi handle dynamically resizing and positioning layouts? My impression is all the old highly productive gui languages (Delphi, Visual Basic, ...) used absolute positioning. Personally I'd rather have a more complex gui framework (css, swing, wpf) that handles positioning than to be forever cursed tweaking pixel width, height, x, y values.
- bpicolo 9y agoI've started to come around on a similar thought recently, after a few years avoiding static typing in python. I've been toying with C# specifically. C# with visual studio is, I think, the most productive environment I've come across in programming. It's ergonomically sound, straightforward, and the IDE protects me from all sorts of relevant errors. Steve mentioned Intellij is a bit slower than he'd hope typing sometimes. I totally agree with that. I think Visual Studio doesn't quite suffer from that (though I haven't worked on huge projects, and that may well affect it). My main problems with IDEs are twofold: for non-static languages like Python, they're just not very good. Sometimes they do exactly what you need, and 70% of the time they're just totally useless (which is a knock on the programming languages more than the IDEs). The zippiness on reaction to my typing is another huge deal. If it's anything other than instantaneous, then I notice my editor in a negative light. When you pair a tremendous IDE with a good language though, the productivity loss of typing becomes pretty much negligible, and the gains for all the other reasons start to become apparent. Changing one parameter or type on a class or function to refactor, and then just following the chain of compiler errors, reaching the end, and seeing that everything just works exactly how you want it to was a big eye opener to me. Definitely going to give kotlin a go some time as well.
- andybak 9y ago> Sometimes they do exactly what you need, and 70% of the time they're just totally useless. I thought that but PyCharm scores way better than 70%. I even trust it to do automatic refactors. Sometimes... > The zippiness on reaction to my typing is another huge deal. If it's anything other than instantaneous, then I notice my editor in a negative light. Maybe I grew up on IDE's but I type stuff in full only if autocomplete fails me. Maybe I have an appalling memory. Or maybe I'm really slow at typing. Or maybe my variable and method names are too short.
- bpicolo 9y agoI think I'm pretty sensitive to even a minor typing delay. That's not necessarily true for everybody, but it irks me. > I even trust it to do automatic refactors. Sometimes. Function extract refactors and the like are definitely within the realm of possibility. Once you want to refactor code across many files it becomes a lot harder in dynamically typed code, for sure. I guess for a long time I sort of had this view of "ooh I have this awesome expressive language that won't get in my way and I can just power through it all". Don't get me wrong, I totally love python as a language. But I think languages like C# have started to make typing feel like it's more out of your way with type inference, etc. I mean, this is the sort of code you can write in C# these days (to take a super trivial example): var somestuff = someList.Where(x => x.Id > 7) .Select(x => x.Name) Typing in this case is 100% out of your way, but you get all the benefits regardless, and you get all those sort of nice functional-style list operations you expect in other languages.
- jbeja 9y agoWhy you are so dumb that you don't know anything about language desing and how inferior Kotlin is.
- dozzie 9y agoWhy my programming languages are smarter than whatever dumb writer that knows nothing about my toolset and my needs is at hand with his trivial cliches.
- coldtea 9y ago>whatever dumb writer You're new to this HN thing? Steve Yegge is kind well known around this here parts... Also you seem to be responding to the (meant as joke) title, not TFA.
- dozzie 9y ago> You're new to this HN thing? No, not really. > Steve Yegge is kind well known around this here parts... Well, I haven't noticed. > Also you seem to be responding to the (meant as joke) title, not TFA. Actually, to TFA as well. His arguments are trivial generics without much substance. Such articles irritate me greatly.
- darksaints 9y ago> Well, I haven't noticed. Don't feel bad, Sergey Brin also thought he was annoying at one point in time. Personally I think it's cool that he's well known enough to annoy Sergey Brin but that's just me.
- coldtea 9y ago>Actually, to TFA as well. His arguments are trivial generics without much substance. Such articles irritate me greatly. Well, it is a personal blog post and this post in particular is meant to convey personal preference (as evident by the whole semi-autobiography about his game app). The title was probably jokingly chosen to be generic on purpose (the post alludes to that in the fist paragraph).
- falsedan 9y ago> articles Ah, see, a Yegge blog post isn't an article, it's an essential touchstone of the computer geek experience. You don't get persuaded by his arguments, but instead… delighted, filled with whimsy, and joy? sarcasm off, his posts also fall south of my reading:substance ratio
- shawkinaw 9y agoTwo thoughts. First, I also thought Android programming was horrible at first, but have since come to see it as no worse on average than iOS programming. The only really sucky thing about it IMO is the lack of ability to pass an object to another activity without serializing it (or maybe there is one I don't know about.) But since everything is done with fragments now that's moot anyway. Second, I tried Kotlin and liked it a lot, but found it so much like Swift that my brain kept thinking it was Swift, so I ended up making mistakes and getting frustrated. That would probably go away with experience though.
- jayd16 9y agoIt's hard to pass objects like that because it's a terrible idea. If you can't serialize the object then your state isn't stored and you'll possibly lose that object on a screen rotation and activity restart.
- sidlls 9y agoIt's a pretty terrible design to couple activity state to the physical orientation of the device.
- jschwartzi 9y agoTo be fair, there may have been really good reasons for it back when Android devices had 500 Mhz single-core CPUs with 32 or 64 Megabytes of RAM.
- AstralStorm 9y agoStill good reasons when a web browser eats 500 MB.
- jonas21 9y agoYou can always handle the orientation change manually if you want to. But if you don't want to bother, restarting the Activity seems like a reasonable default.
- excalibur 9y ago> Kotlin Is Better Than Whatever Dumb Language You're Using Hab SoSlI' Quch!
- ufmace 9y agoI'm glad to hear Steve Yegge's take on Kotlin. I've played with it some and thought it was quite interesting, and I wouldn't mind doing a project in it sometime. Although I don't use Java much, I'm more into Rails for personal projects, and I'm not about to switch any of them to JVM just to play with Kotlin. Anyways, I broadly agree with his take that it adds all of the cool toys you could ever want to Java without the difficulty and mental overhead of learning Clojure or Scala. Strong compatibility with the existing Java ecosystem seems like a plus, but I've never dug into it deep enough to notice that. I did find myself really wanting to know what he figured out to make Android UI programming non-awful though. I've messed with it some, and I don't see how adding in Kotlin would make it much nicer. Maybe he loved Kotlin so much that he was able to forget about the Android UI API.
- chrisallick 9y agoGreat article. Slamming android and talking about Russian software. Click bait to boot? Sold. My only issue is with his comment on swift. Which also sucks. Objective-C is wonderful and delightful. I'm sad to see it losing favor. Oh well, off to try Kotlin. Maybe I'll finally make an android app... no.
- saimiam 9y agoHello fellow Obj-C fan. I tried to teach myself Swift much like I taught myself Obj-C. It didn't feel right.
- JustSomeNobody 9y agoFunny how that is. Some language just click with certain developers.
- pje 9y agoThe "ew gross weird" reaction to Scala and Clojure is tremendously disappointing (especially coming from someone whose thesis is basically "give this new language a chance")
- icedchai 9y agoI worked on a commercial project that used Scala. Never again. Compiles were slow, IDE support was terrible, everyone had their own subset they used. I'm sure it's improved since 2010.
- dzdt 9y agoTwo million line scala codebase -> 2 hour clean and rebuild with a top of the line workstation. IDE support has improved, compile times not so much.
- lmm 9y agoAgreed as far as it goes. But can one person really understand a 2 million line codebase? Can a team large enough to use a 2 million line codebase stay in close enough communication that they all know what each other are doing? IME to stay sane on a codebase that large you need separated components with strict separation between interface and implementation and independent versioning of each, at which point you might as well make that split at the module/VCS level and take advantage of what your tools can do for you.
- partycoder 9y agoI think it has changed for good. There are also initiatives to simplify Scala (e.g: dotty), and initiatives to go native (e.g: Scala native via LLVM). I think Scala has some good potential.
- runT1ME 9y agoI work on a large Scala team. We use microservices so my regular compile times are somewhere between 4s and 20s. I rarely have to do a full rebuild. IDE support is bad, that's a good criticism but a good chunk of us don't use IDEs, and instead write it like a dynamic language. Live inside the REPL, copy paste back and fourth. As for 'subsets' everyone uses, I find this advantageous. Our team strongly encourages a pure functional style, but we realize not everyone is going to start out that way, and it doesn't get in the way of shipping software.
- wisty 9y agoIt seems to mostly be compared to Java. Sure, if you don't like functional languages or dynamic languages (Jython, Groovy, JRuby) then I guess it's the best high profile JVM language.
- wisty 9y agoIt seems to mostly be compared to Java. Sure, if you don't like functional languages or dynamic languages (Jython, Groovy, JRuby) then I guess it's the best high profile JVM language.
- wisty 9y agoIt seems to mostly be compared to Java. Sure, if you don't like functional languages or dynamic languages (Jython, Groovy, JRuby) then I guess it's the best high profile JVM language.
- charlieflowers 9y agoThe biggest news is: Yegge is blogging again! Glad to see it!
- Cyphase 9y agoAs soon as I saw "blah blah blah (steve-yegge.blogspot.com)", I came looking for this comment. I hope he keeps it up. Also, apparently he actually "came back" back in November[1]. That post is even sort of related. [1] https://steve-yegge.blogspot.com/2016/11/the-monkey-and-apple.html https://steve-yegge.blogspot.com/2016/11/the-monkey-and-appl...
- zengid 9y ago>How many languages can you name that were built with IDE support from the ground up? Visual Studio Code is pretty nice with TypeScript. I've enjoyed having the autocomplete for my little Phaser game.
- unlmtd 9y ago> IntelliJ doesn't like it when you type fast. Is that really true? Then that might explain why the qwerty keyboard is still around.
- BJanecke 9y agoKotlin is really nice and I am very happy to have more than one great/fun/productive language however I feel like mentioning typescript might be worthwhile (yes I know it's "just" a superset of JS and you have a personal gripe with whatever you think JS is but hear me out). * Runs everywhere js/asm * MIxed bag of tooling, but generally you can find something amazing and you won't have to venture to sourceforge or similar to submit a patch * Doesn't suffer from the coljure/scala "We can totally use other JVM libraries but we only really do that If we have no other option" * Absolutely beautiful generics and spot on inference ``` function pluck<T>(key: keyof T, from: T[]) { return from.map(item => item[key]); } ``` * First class functions * Incredible flexibility * sketch in js then annotate * decide on strict nulls * decide on implicit types * various approaches to composition * Amazing IDE support(VSCode)(This technically falls under tooling ;)) * One of the few cross-platfrom languages that feel pretty much identical on all the platforms [edit] Formatting
- deleted 9y ago[deleted]
- awinter-py 9y agointellij is soooo sloooow
- anjanb 9y agoAnyone knows how it performs versus, say, Clojure for server-side development ?
- iLemming 9y agoGood question. I would also be interested in seeing some concurrency related benchmarks. Clojure excels on that field due to immutable data-structures. There's simply no point of talking about concurrency without immutability.
- i386 9y agoKotlin wouldn't be happening if Java was shipping things developers actually cared about.
- bartread 9y agoIt's impressive to see Kotlin finally getting some traction. The first time I heard of it was years ago: I was doing a piece of competitor analysis at Red Gate and I clearly remember reading about it and having a distinctly "whatever" reaction. Part of that was because every time I'd seen some (relatively) small shop invent a language or platform in the past, it sort of sucked. But JetBrains are a rather different animal. They've done a great job of getting the right kind of people on board, with the right background and experience, to do language design well. They also have a talent for making long-term plays and consistently investing in them; they're patient about achieving long-term success (examples: IntelliJ, TeamCity, even YouTrack), which isn't so common. I probably shouldn't be surprised to see the same happening with Kotlin - they've been plugging away at it for about 6 years, I think. Great work.
- jakub_g 9y agoSide note: Even if you're not interested in Kotlin, or don't know Steve Yegge, give a read to this blog post. The writing is as good and hilarious as in the old good times when he used to write way more often. Lots of fun for the morning. For aspiring blog-writers, it's also a good study how to write blogs to keep readers engaged. I only know 2 people writing in that style, him and Joel Spolsky, but it's highly effective.
- zebra9978 9y agothe title has been made politically correct - the actual title is "Why Kotlin Is Better Than Whatever Dumb Language You're Using". I wonder if that was intentional editorial oversight.
- norswap 9y agoIt's been changed. Lol at that.
- sigi45 9y agoAwesome article! Not one practical comparison between java and Kotlin. Anyway as any hype like scala and co. Java works very well, has small issues and no issue which really hurts me.
- sandGorgon 9y agoi wonder what server side platform are they using ? there's been a lot of buzz around vertx+kotlin or Reactor ... and with android support, it is a very compelling stack to have for android focused startups. if they begin to build first class hooks for tensorflow in kotlin (as they might already have, considering Tensorflow Lite on android), i think it could replace python as the first language for data scientists.
- codecamper 9y agoJust wanted to point out that Kotlin is not from Russia. It's from Prague, Czech Republic. Almost the furthest west you can go and still be Slavic. Maybe the founders of Jetbrains are Russian. Not sure. edit: aha Kotlin is in fact developed in Russia. From Russia with love!
- askvictor 9y agoFwiw, jetbrains originates in Prague not Russia; although the kotlin dev team is based in Russia.
- andrewstuart 9y agoA few people have said that IntelliJ is slow. Why is this so, if Java is not inherently slow? Sure JetBrains are some of the smartest developers around and yet their IDE is still slow. I can't help but feel that Java is slow and problems with performance in something like IntelliJ do nothing to dispel that feeling.
- emodendroket 9y agoBecause IntelliJ does a lot of work. Similarly, Visual Studio is not usually slow but sometimes it will mysteriously become so slow as to become unusable, or at least that was true a few years ago when I spent a lot of time in it.
- iLemming 9y agoVisual Studio is a hosting environment for Resharper. And Resharper makes it awfully slow. IntelliJ compared to VS (even without Resharper) is like Emacs compared to IntelliJ.
- peterashford 9y agoNetbeans is written in Java and is pretty fast. Java is objectively not slow. Unless slightly slower than C/C++ is what you call "slow"
- MarkMc 9y agoIntelliJ is written in Swing, which 10 years ago was certainly slower than an alternative UI framework like SWT. Not sure if there is a noticeable difference nowadays.
- tannhaeuser 9y agoWith IntelliJ using Swing as a major vendor and showing its potential, is there a chance for getting a new developer community behind Swing/geom2d? Or is IntelliJ in the progress of migrating away to something else? Asking because I'm having an old (but useful) Java2D diagramming app lying around that I'd maybe like to lift, but the lack of a future perspective for java2d and Swing always held me back on working on it. I don't even know if java.awt.geom can handle HiDPI these days. Would be a pity to loose it, since java 2d certainly is a useful programming model for these kind of apps; what's missing is commitment (by Oracle or other party) to it.
- andrewstuart 9y agoIs there reason to choose Kotlin if you don't already live in the Java world? Put another way, is it a language that makes living in the Java environment less painful, and thus only of value to people who continue to need to live in the Java world? Why would someone who has never programmed in the Java ecosystem use Kotlin? I'm surely ignorant and prejudiced but when I read this I thought "Hey why not try Kotlin?", then I thought of Java and images came up in my head of thousands and thousands of files being installed, and the vast, lumbering Java engine cranking slowly and chugging and masses of XML configuration up the wazoo for everything and I shuddered and thought "I'll stick with JavaScript, where the pain of configuration is merely excruciating, as opposed to the pain of Java configuration which is similar to bowing before throne of the Java king of ninth level of hell awaiting punishment for a lifetime of sin.".
- haspok 9y agoYou can compile Kotlin to Javascript, as a start. You get the benefits and drawbacks of static typing and object-oriented (or rather "class-oriented", if we call Javascript object-oriented) programming support. But if you choose to stay with the JVM, you get: - the JVM - multithreaded, highly tuned and high performance JIT VM, well documented and continuously being improved - mature tools - libraries from the Java ecosystem - for pretty much anything you can think of - coroutines (with Kotlin 1.1) for async support. XML configuration is being phased out slowly (I guess you are talking about Spring here), in the last ~10 years annotations have become much more popular. You still have to support those legacy apps though. This made me laugh: "then I thought of Java and images came up in my head of thousands and thousands of files being installed" - well, don't check your node_modules directory then, or you might be in for a surprise :)
- paulddraper 9y ago> You can compile Kotlin to Javascript Java (GWT) has been compiling to JS years before Kotlin was even a twinkle in JetBrain's eye. I can't think of a language that doesn't compile to JS.
- bollockitis 9y ago
- r3m3mb3rm3 9y agoHaving all parameters to be read-only is a deal breaker for me.
- andrewstuart 9y agoThere's got to be a good reason why though?
- r3m3mb3rm3 9y agoHonestly, I can't think of anything that is not bullshit. Having to declare a new variable for each parameter that you need to manipulate makes the code a lot messier.
- MarkMc 9y agoIt's a trade-off. Yes, the code is messier for the 20% of functions where the input is manipulated. For the remaining 80% it makes it slightly easier to analyse the behaviour of the function.
- r3m3mb3rm3 9y agoI understand that. But I think it's better to let the programmer decide whether their parameters are mutable or not. Then you don't have to compromise.
- j_m_b 9y agoOK now that's weird..
- newsat13 9y agoI don't get it. How does Kotlin actually solve Android's fragment/activity issues?
- smichel17 9y agoIt doesn't, but it eases a lot of frustration in other areas, which makes fragments slightly more bearable. The standard library[0] functions `apply` and `run` are really nice with builders. When I converted Red Moon[1] from Java to Kotlin (no functionality changes), the code base shrunk by around 1/6. [0]: http://beust.com/weblog/2015/10/30/exploring-the-kotlin-standard-library/ http://beust.com/weblog/2015/10/30/exploring-the-kotlin-stan... [1]: https://github.com/raatmarien/red-moon https://github.com/raatmarien/red-moon
- gigatexal 9y agoMakes bold claims, but shows no code.
- Tharkun 9y agoYet Another Java Rant. In my book, Java is a fine language, and has been since Java SE 6 was released back in 2006. It keeps getting better, too. "Glacial" pace or not. Whenever any kind of discussion about Java comes up, people start ranting about XML configuration or annotations. These are not language problems. These are developer problems. If you don't like XML or annotations, then don't use them. Problem solved. Very few Java features require the use of either. I rarely run into issues with the Java language, syntax or productivity wise. I've run into a couple of Sun/Oracle/IBM bugs in my 17 years of Java development. I've greatly appreciated productivity-increasing features like try-with-resources and Streams, but the lack of those features have never held me back as a developer. Given the sheer amount of Java code out there, I would say it deserves a little more praise and a little less negativity.
- specialist 9y agoKotlin (Ceylon, C#, Nice, Boo, Groovy, etc) isn't better. Just different. What I want, as a devoted Java partisan, is a Java (Oak) experiment do-over. More more and less less. A fantasy hypothetical effort I call Encore™. What are the sources of programming errors? Engineer them away. What causes the most boilerplate? Engineer those away. I've got a laundry list that I've collected over the years. Maybe I'll scrub it for publication. -- One specific, novel feature of Kotlin that is better, and should be swiped for every other OO language, is its automatic generation of the canonical object methods (toString, equals, etc). Data classes are dumb though. https://kotlinlang.org/docs/reference/data-classes.html https://kotlinlang.org/docs/reference/data-classes.html
- smichel17 9y agoWhy do you think data classes are dumb? The only thing I think they're missing is an automatic method to serialize to JSON or other text format, eg, so they can be easily stored in an android preference.
- MarkMc 9y agoI've also been coding Java professionally for 17 years and like you I feel Java is a great little language. What makes the biggest difference in productivity is the simplicity of the algorithm and associated object oriented design, and I've never really felt that Java was hindering me in achieving that simplicity. I wonder how well the like/dislike of Java correlates with like/dislike of object-oriented programming. I've always loved object oriented programming but there seems to be many programmers who feel the opposite, and for them Java would be going against the grain.
- agentgt 9y agoWhat makes me nervous about Kotlin is it could become Scala (or even Groovy) again. Don't get me wrong I'm a huge fan of Scala and highly expressive language but on the other hand there is something to be said for simple consistent and not that expressive languages. It pains me to say it but less choices and not more. That is I want Kotlin, or Scala, or Java to be a little more like Go (and I'm not a fan of Go). The development consistency with Go with gofmt and other build tools as well as having fairly good default concurrency (Java as a myriad of concurrency practices: eg. streams, actors, rx) help ramp up time. The ramp up time for all JVM languages is pretty awful compared to C# or Go. There are so many tools and libraries and different way people do things. I love the choices but it really hurts bringing on new talent. Luckily Kotlin is backed by a tools provider so perhaps extreme consistency will happen but when I look at the Spring 5.0 examples (also on the HN right now) I get nervous and think oh this is becoming Scala academic DSL confusion all over.
- rev_null 9y agoBetter than Java seems like a pretty low bar.
- deleted 9y ago[deleted]
- gankgu 9y agogolang is better.
- ensiferum 9y agoHow exactly does kotlin fix the bad Android apis? You'd imagine that you still have to deal with the apis. "Whereas Kotlin is made by world-class IDE vendors, so right from the start it has the best tooling support ever." And then... IntelliJ doesn't like it when you type fast. Its completions can't keep up and you wind up with half-identifiers everywhere. So sounds like the tool support really isn't great.
- grunca 9y agoYou can and should build your domain language on whatever base language you happen to like/use. This is where most failures happen on big projects. If you treat your solution as a script or glue code, and your complexity needs to scale, you will quickly reach a stalling point. A good, well thought structure & design is required,there is no language available (yet) that will replace that.
- RandyRanderson 9y agoSo this guy has [0]: . advocated Javascript on the server-side . tried to get goog to support Ruby . is active in Lisp, enough to get it mentioned in wikipedia twice And now is enough of an expert in Java and Koltin to instruct us on which is "better". That's a lot of languages to be an expert in! It's almost unbelievable. If someone who's been working in Java for years and then has done a significant Koltin project (100k plus SLOC) that's in production and they told me "Koltin is ?" I would listen to them. Otherwise I might be tempted to believe someone's writing another clickbait article. Regardless, looking to his wiki history, it seems he's, charitably, outspoken. Not someone i'd look to for a sober technical analysis. [0] https://en.wikipedia.org/wiki/Steve_Yegge https://en.wikipedia.org/wiki/Steve_Yegge