News for hackers. Stuff that matters.
Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Monday September 28, 2015 @03:03PM (#10292321)
> If the cost is less than the benefit, aren't we overall in a better place? Can't some people value the gain in efficiency, or whatever else the feature provides more than the cost?

If you work alone, you're right. Problems start when working in a team. The average lifetime of a codebase is about a decade, in which time it is read and touched by many hands, and falls under several management administrations. We know that languages that are too feature-rich can prove troublesome under these conditions.

> sounds suspiciously subjective

Of course its's subjective -- like many things that have to do with the choice of languages -- but unlike many other debates, we actually have some very good data on this: C++. For a few years, C++ was considered a blessing. Expressive, sophisticated, powerful. But after a few years, as codebases started to mature, the industry as a whole discovered that maintaining C++ codebases is a nightmare. Every team had its own style and its own subset of features it chose to use. Some features (like operator overloading and esp. cast and assignment operators) while useful, ended up making long-lasting, large-project collaboration extremely costly. Java's design was very much a reaction to C++, eliminating features right and left, and declaring from the get-go that it aims to be less expressive and more verbose. It worked. The question now is whether any new "rich" language would share C++'s troubles or not, and that is indeed subjective (so far). But at least we know that sometimes a combination of too many features can be really bad, especially when working in large teams.

BTW, today C++ is quite effective because it's become a (relative) niche language (even according to its creator). Niche languages are used by specialized teams that are good at enforcing discipline, and/or tend to be smaller.

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Monday September 28, 2015 @04:10PM (#10292842)
I suspect there are several interpretations of "feature" being used in these discussions, and without someone being a bit more explicit in what they mean, I doubt much useful progress will be made.

I also think that complex languages may be harder for teams with high turnover or a lower average skill set within that language (and as such the average allowed complexity per expression may play a role in this). I went into some depth on this in a cousin thread[1], but my conclusion may not be quite the same as yours. Part (well, most actually) of my original question on this topic was to ask for clarification, because I thought the assertion was inherently ambiguous.

That said, if you have actual numbers or studies to bolster your statements about C++ I would love to see them. What you assert is a common refrain here, but I'm truly not sure how much of it is confirmation bias and squeaky wheel. There are plenty of C++ supporters as well as detractors, but I'm not sure how to sort through the noise here to get an accurate assessment of the landscape. Interestingly, my relative distance from C++ may actually help here since my own experiences may not sway me as much, but that might be entirely overshadowed by C++'s similarities and differences to other languages that I like or dislike in some aspect that I am more familiar with.

In the end, since it's not as simple as "less features us better, more features is worse" (otherwise we would all be writing assembly), I suspect there are a few other important axes of comparison that actually describe the situation better, and language features is a useful abstraction but only over a very short range of values, outside of which it becomes increasingly useless as a metric for how hard or easy it is to manage a codebase.

> BTW, today C++ is quite effective because it's become a (relative) niche language (even according to its creator). Niche languages are used by specialized teams that are good at enforcing discipline, and/or tend to be smaller.

Is it? I know there have been other systems eating into the market share for C++ for a while, but my impression has always been that it's still extremely popular in certain segments where there hasn't been much new competition for a while. E.g. high performance computation, cutting edge/AAA games, etc.

1: https://news.ycombinator.com/item?id=10292093

Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Tuesday September 29, 2015 @08:05AM (#10295680)
> if you have actual numbers or studies to bolster your statements about C++ I would love to see them.

Note that most real-world case studies were done in the late '90s-early '00s so they are not that easy to find. A quick Google search, however, came up with this[1].

> There are plenty of C++ supporters as well as detractors

It's not about C++ supporters and detractors today. It is an undisputed fact is that the industry as a whole abandoned C++ (except for its relevant niches) and practically no one has looked back.

> In the end, since it's not as simple as "less features us better, more features is worse"

I'm not saying it is simple. I am saying that we have one experiment with conclusive results. Perhaps there are other variables, but given the strength of the results, the burden of proof -- IMO -- lies with those who claim that their super-feature-rich language will not meet the same fate.

> it's still extremely popular in certain segments

It is, and those are its niches. They form a largeish share of the market, but not anywhere as large as the segments that used C++ in the 90s or the segments that use, say, Java today. It is most certainly no longer a general-purpose cross-market industry-wide language.

[1]: http://www.lanl.gov/projects/CartaBlanca/webdocs/PhippsPaper...

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Tuesday September 29, 2015 @11:11AM (#10296859)
Thanks for the paper, I'll take a look.

> the burden of proof -- IMO -- lies with those who claim that their super-feature-rich language will not meet the same fate.

All you are doing is reducing the discussion to something so hand-wavey that it can't be argued anymore. I'm interested in how much is too much and what type of features increase tihs load. I assert that some features don't increase errors, but in fact decrease them (e.g. Java's automatic memory management), and if that's true, than the statement "more features is worse than less features" is trivially proven false. Is it really that hard to move the argument beyond the simplistic point of view that "features" are the problem?

Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Tuesday September 29, 2015 @11:36AM (#10297051)
Automatic memory management is what's known as an extra-linguistic feature. Those usually reduce complexity (JITs do the same, as they allow very efficient compilation while introducing different dispatch kinds -- static vs. virtual -- with different performance). I was talking about language-level abstractions. For example overloading, operator overloading, having both subtyping and explicit sum-types, etc..

It is handwavy because designing languages is an art, but usually providing too many ways to achieve the same thing or allowing code that hides its operation (or appears to violate the "normal" language semantics while looking innocuous) is, in general, bad (for large teams), as it hinders readability. Of course, things need to be balanced, and you have to consider what kind of projects the language is for, what would be the "average" code size, etc..

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Tuesday September 29, 2015 @01:44PM (#10298028)
> I was talking about language-level abstractions.

And I've been trying to get people to at least define what they are talking about in every single comment I made. Kudos to you for doing so. :)

> Automatic memory management is what's known as an extra-linguistic feature.

While that makes your position easier to support (but it's not what the original comment stated, which is why I asked for clarification from them), I'm not sure I buy it entirely. I need an explanation why a language with more language level abstractions is worse than one with less, given that you can enforce the restriction of some abstractions. Why is artificially limiting yourself the better solution than enforcing restraint, which leaves the possibility to work outside those constraints when the conditions are correct?

Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Tuesday September 29, 2015 @02:29PM (#10298441)
Because what C++ has taught us that it's impossible to enforce restraint in a serious project[1], because the people enforcing the discipline change. The discipline enforced by you is different from that enforced by the team-lead to follow you, and by then the codebase lacks any discipline. That was exactly C++'s lesson, which is why people are weary of languages that say, "all you need is a bit of discipline".

[1]: This is less true of C++ today, when it's mostly a specialist language used by specialist teams working in fields that have always required a lot of restraint. They know how to do restraints (well, at least better than the industry at large).

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Tuesday September 29, 2015 @03:11PM (#10298733)
> Because what C++ has taught us that it's impossible to enforce restraint in a serious project[1], because the people enforcing the discipline change.

So? the language's themselves change over the time frame you are looking at. You seem to be arguing that having the language enforce it is better than policy, but name one language that's seen any serious use that hasn't seen change to add new features over the last then years, of the exact sort you are saying cause problems. So we're supposed to entrust this to a third party that really doesn't care about our specific needs. The Java standards committee doesn't know who you are. And if they do, you are not a representative case of the vast majority of Java programmers. I would rather control my future, so I choose freedom with restraint.

I'm really not buying your C++ is niche argument. C++ is one of the top 3-5 languages in the world in every metric. Java is more popular, but not being the most popular has nothing to do with being niche. C++ is still in massive use in almost every industry. That is not niche. Using C++ as your go-to example and basing your argument on having lost so much market share as to be a niche language isn't really moving the discussion along. Shops switched to Java from many languages, not just C++, and for many reasons, not just because C++ features caused problems. That argument is far too simplistic and ignores far too many things for me to give it much credence.

Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Wednesday September 30, 2015 @01:34AM (#10301990)
> I'm really not buying your C++ is niche argument. C++ is one of the top 3-5 languages in the world in every metric.

If you see how Bjarne Stroustrup[1] describes C++ today, you'll probably agree that it's a niche language (he sees it that way today).

> That argument is far too simplistic and ignores far too many things for me to give it much credence.

Of course. But ignore it at your peril. If you want to use a language that is similar to C++ in many respects (many of the same respects that the industry complained about), you should at least acknowledge the risk and try to be damn sure that this is what you want or be sure that this wasn't a contributing factor to C++'s fall from dominance.

[1]: https://youtu.be/2egL4y_VpYg?t=12m9s

Re:Kotlin: A New Hope in a Java 6 Wasteland by dragonwriter on Monday September 28, 2015 @04:12PM (#10292868)
> I know there have been other systems eating into the market share for C++ for a while, but my impression has always been that it's still extremely popular in certain segments where there hasn't been much new competition for a while.

"Extremely popular in certain segments" is typical of "niche languages" -- those segments are its niche(s).

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Monday September 28, 2015 @04:50PM (#10293098)
Yes, but "eating into the market share" doesn't necessarily mean it isn't still a heavy contender. I think we can agree that while Internet Explorer has been losing market share for quite a long while, you can't classify it as niche. In that respect, my original statement regarding it dominating some industries and your reply don't really affect the answer to the question of whether or not it's a relatively niche language. The blame is mostly mine though since you were responding to something I put forth that wasn't really relevant.
Re:Kotlin: A New Hope in a Java 6 Wasteland by AnimalMuppet on Monday September 28, 2015 @06:19PM (#10293593)
Fine, but C++'s "niche" is larger than all but maybe four other language's total market share. So the word "niche" doesn't really fit very well...
Re:Kotlin: A New Hope in a Java 6 Wasteland by dragonwriter on Monday September 28, 2015 @06:52PM (#10293719)
> Fine, but C++'s "niche" is larger than all but maybe four other language's total market share. So the word "niche" doesn't really fit very well...

If the niche is well-defined, the size doesn't really matter in many respects, because its effectively a completely different market, and it doesn't matter whether that markets large or small in terms of what goes on outside that market.

Re:Kotlin: A New Hope in a Java 6 Wasteland by pron on Tuesday September 29, 2015 @12:04PM (#10297255)
But those four other language's total market share covers over 80% of the industry.
Re:Kotlin: A New Hope in a Java 6 Wasteland by AnimalMuppet on Monday September 28, 2015 @06:18PM (#10293589)
> In the end, since it's not as simple as "less features us better, more features is worse" (otherwise we would all be writing assembly)...

Arguably, assembly is the most feature-full language - everything is possible. But those features are very expensive, which is why it's only used where there is no alternative.

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Monday September 28, 2015 @06:58PM (#10293745)
Well, in that respect, every turing complete language is at feature parity, but I think the meaning of "feature" here for most people (I still think there's a few specific differences in people's interpretations) is "language construct making hard, complex to program construct or methodology more easily expressed through language level support."

That is, both C and Perl can implement Hash data objects, but C requires a library or implementation, and Perl makes it a core data type of the language.

Re:Kotlin: A New Hope in a Java 6 Wasteland by AnimalMuppet on Monday September 28, 2015 @07:32PM (#10293860)
No, assembly is more than turing complete. On many CPUs, you get instructions like "enter supervisor mode" or "flush the data caches" or "change the interrupt mask", which aren't part of the definition of a turing machine. (I know, floating-point multiplication isn't, either, but you're going to have to be able to do at least some kinds of arithmetic to implement a turing machine, whereas supervisor mode is completely outside the spec.)

And C, Java, Perl, etc, also don't have anything like "enter supervisor mode". But if the CPU supports it, assembly will let you do it.

Re:Kotlin: A New Hope in a Java 6 Wasteland by kbenson on Monday September 28, 2015 @08:09PM (#10294009)
Again, that depends entirely on how you define "feature". If the feature in question is "easy use of hashes as a built in data type" assembly doesn't have it. Yes, you can implement hashes in assembly, the the feature as outlined is not something you can ascribe to assembly. Additionally, assembly has a few features that are not replicated in most languages (but not all, some languages allow inlining assembly). So they are often just partially overlapping sets.