Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Yes & the sheer amount of existing code/fra (Score 1) 414

There's a difference between abstracting complexity away; and relying on a cute, obscure, not-quite-feature of a syntax in your program because it saves a few characters.

Of course there is, but at no point have I (or anyone else I've seen in this discussion) suggested doing the latter just to make the code shorter. The point is that there are plenty of languages that can say in one clean, readable line of code what takes half an editor window in Java. I gave some typical examples in my reply to another post.

Comment Re:Intellectual Monopolies violate property rights (Score 1) 224

Ideas are not scarce. They can be freely reproduced without loss.

Right. The marginal cost of extra copies of information is very low. Unfortunately the initial cost of putting that information together may be extremely high, and if the information is never collected it won't be distributed either.

So we create an economic incentive to encourage that creation and distribution, effectively amortizing the initial development cost over all those who ultimately obtain a copy. This might not be the perfect economic model, but I'm still waiting for anyone to offer a plausible better alternative.

Comment Re:Or they're just proxying their connections (Score 1) 224

So what you're saying is that...the extremely long copyright durations have no real impact on the bottom line of copyright holders?

No, but I'm saying it appears to have relatively little impact on the bottom line of copyright holders. More importantly, so does vast amounts of empirical data.

Comment Re:Yes & the sheer amount of existing code/fra (Score 1) 414

Your haskell and Python implementations are unreadable and requires the user to think about each line.

Maybe you personally aren't familiar with higher order functions or comprehensions. However, millions of programmers are, and would read and understand those lines without a second thought.

Using filter in Haskell or a list comprehension in Python is as routine as using your for-loop is in Java, and the associated syntax is similarly familiar to anyone who's ever done a significant amount of programming in those languages.

Moreover, these tools are declarative, which means you can use them in languages that better control side effects for safety, and you can use them in languages that optimise based on that extra knowledge for faster performance, and you will be able to use them in the data parallel languages of tomorrow to make more efficient use of modern processing hardware. In other words, in languages designed to take advantage of them, these styles immediately convey more information than the imperative style required by your for-loop version.

Perhaps it was the filter function that confused you, if you aren't familiar with that particular terminology? If so, I would remind you that you just wrote a code example full of integers and an add function that has nothing to do with calculating the sum of those integers. (At least, I think you did. I notice that you missed out several lines of initialisation and type declarations for those variables, making your example code considerably shorter than it otherwise would have been if you'd actually written a like-for-like equivalent.)

They're inferior to straight forward programming by orders of magnitude and should never be used.

I honestly don't understand how any programmer, whatever their preference of language, can claim that an expression that says filter (<10) items and means choose the items that are less than 10 isn't straightforward. I think you're just trolling here.

As for never being used, you're welcome to stick with yesterday's programming tools if you like. No doubt there will be plenty of need for programmers to maintain legacy systems for a long time to come. But tomorrow's programming tools will let us build bigger, more efficient, safer programs, and we'll be doing it faster and with fewer resources. If you're not familiar with these idioms yet, you might want to consider broadening your knowledge, because before long every 21-year-old kid who learned programming by messing around with JavaScript in their browser is going to be using them.

Comment Re:Not as easy to read as Python though (Score 2) 414

And in development I have seen lots of python programmers who printed out their own code to meditate on where the one bug is they could not find on screen - only to waste another few hours because the tab/space bug was obfuscated by a page break in the printout.

Good for you. The last time I saw a programmer do that was... also never in my entire career, actually. If your programmers have trouble meditating on a print-out of a language with syntactic whitespace, you might suggest they instead use any modern text editor and a macro/plug-in that makes mismatched whitespace show up in bright red. Then they can become enlightened, spend less time "meditating" like programmers who work with punch cards, and spend more time making useful software.

Curious, which editor from 1927 would you recommend?

I doubt that there was any text editor available in 1927 that got tabs/spaces wrong when working with Python code. Take your pick.

Comment Re:Yes & the sheer amount of existing code/fra (Score 4, Interesting) 414

Yeap, of course repeat the type of the object twice, the ugly diamond operators, use else if instead of elif, etc, produces verbosity, but this is not related to be easy or not to understand.

The thing is, I think it is related to how easy something is to understand.

If I can express an algorithm as a single function of 10 lines then, other things being equal, that will be easier to understand than distributing the same algorithm across 5 functions each of 20 lines. You can see the whole thing at once, instead of jumping around within or between files. You don't have overheads of passing around and returning values.

Similarly, if I can express a simple bit of logic as a clean one-liner, while a verbose style requires 6 lines of manual loop/conditional logic and maybe a function wrapped around it, then I'm thinking about what that logic is doing and it how it fits in with the other logic around it while you're still worrying about loop counters.

Here's a version of finding all the items less than 10 in a list, written in Haskell, a relatively powerful language:

items = [1, 15, 27, 3, 54]
result = filter (<10) items

Here's a slightly more verbose version, written in Python, also a language known for being clean and expressive:

items = [1, 15, 27, 3, 54]
result = [item for item in items if item < 10]

And in contrast, here is the best Stack Overflow has to offer about implementing this sort of requirement in Java.

Spoiler: There are basically three kinds of replies. Some write out entire functions to implement the filter using a manual loop. Some use a third party library to do a more clumsy variation of the Python and Haskell examples above. And a few recent ones use Java 8 to do a slightly less clumsy variation of the Python and Haskell examples above. The clear trend is to try to get away from classical, verbose Java to something more powerful and expressive. Like Scala, according to the first comment on the original question...

Comment Re:Yes & the sheer amount of existing code/fra (Score 1, Insightful) 414

Generally speaking, the more information you pack into a sequence of characters, the harder it is to understand.

By that argument, doesn't any powerful abstraction make code harder to understand? Similarly, doesn't any verbose style make code easier to understand, even if the boilerplate contributes no additional meaning? Sorry, but I can't agree with this sort of reasoning at all. If it was that simple, we'd still be writing large software systems in assembly language and no-one would use any sort of libraries or modular design.

Comment Re:Yes & the sheer amount of existing code/fra (Score 4, Interesting) 414

I'd agree with the ecosystem being a huge factor in Java's success.

More than that, it is a relatively closed ecosystem. Tools like JNI are available, but in practice few projects seem to use them. Mostly, either you're working in JVM world or you're working somewhere else. That's a lot of momentum to overcome for any long-standing project or development team to move to another language, tool chain, standard library, and so on.

I also think the summary's claim that Java is easy for humans to understand at a glance because of its simplicity is a mischaracterisation. Java is a relatively verbose, inexpressive language, so actually it can take quite a long time to figure out how any given piece of code works. What Java does offer is that an average developer can reliably figure out how any given piece of code works, even if it takes a while. For long-running, large-scale projects that is a valuable attribute for a programming language.

Comment Re:Not as easy to read as Python though (Score 2, Insightful) 414

I've been programming in Python professionally for something close to a decade now, and in all that time the number of tab/space bugs I've seen in production is: 0.

Get a good edit -- any good editor -- and worry about problems that actually matter. This one was solved in about 1927.

Comment Re:Or they're just proxying their connections (Score 1) 224

People aren't downloading cracked versions of Donkey Kong. They're downloading cracked versions of the latest Assassin's Creed.

They're doing both.

Most of them aren't.

I agree with you that part of the copyright bargain is (or should be) that works fall into the public domain after a while. You can make reasonable arguments for different periods of protection, but I expect we'd all agree the current ones are absurdly long.

But this doesn't change the fact that most illegal copies being downloaded are relatively new releases.

Comment Re:Or they're just proxying their connections (Score 1) 224

I agree that some people do download illegal copies for practical reasons rather than cheaping out, though I think this kind of argument is relatively weak. In particular, games companies have actual stats on how many players on their servers are using dodgy copies, and if 90% of the people on their servers are using a version known to be cracked (which is not an unusual figure for some games) then it's hard to believe an argument that all of those people are "just trying it out" and will buy a real copy later, particularly when they are "just trying it out" for two or three months before moving on to whatever is the next popular game.

Your last paragraph is one that troubles me, because it seems to be very common attitude today. In fact, as someone in a new business that creates genuinely original content, I've argued with my government precisely that silly copyright terms erode general respect for copyright, to the point where a lot of people just don't care. This hurts small creative businesses and individual artists who aren't using DRM or otherwise exploiting customers but who also don't have the resources to protect their assets through the legal system.

We just want people using our content to pay a fair price for it so that we in turn can pay our rent at the end of the month. There are many thousands, perhaps even millions, of us for every corporate giant, and copyright is supposed to be there so our business model can work, too. In a world where a lot of consumers don't respect copyright any more, it's mostly not going to be the big businesses that go under; they're just going to push up the cost of next version of GTA or the next season of Game of Thrones by a dollar to compensate. It's the little guys -- the game programming duo slaving away in someone's basement, the individual photographer who travels the world to take beautiful pictures, the recording artists who don't have a big media giant behind them -- who really lose out the most if the system fails.

Anyway, I'd better stop there, because I have to go back to playing my cracked copy of Generic Sports Title 2015 with a bootleg album of Manufactured Pop Band playing in the background, while I download Arbitrary Sci-Fi Reboot Film to watch over dinner. For some reason, no-one seems to make anything good any more, so that's the best I can find.

Comment Re:Or they're just proxying their connections (Score 1) 224

It is not a black/white issue. If everyone ignored the law and downloaded cracked copies, clearly the games companies would go under as they would have huge costs and no revenue.

Downloading cracked games is like being the guy who drives up the bus-only lane and then cuts in at the junction to get past the queue everyone else is stuck in. You rationalise it with a "victimless crime" mentality, but if you look at the system as a whole, every time someone does that it damages everyone who played by the rules a little bit, and if everyone cheated the whole system would fail.

Comment Re:Intellectual Monopolies violate property rights (Score 1) 224

Those things violate your property rights in about the same way that you having your house violates my right to freedom of movement over the land it's built on.

All property rights are artificial, including physical ones. The natural state of things is that if someone has a bigger stick/rock/gun than you then they can take any physical possession you have if they want to. We create and enforce legal property rights in the hope that they will help society to run better than that. You just seem to want a version of property rights that says you get to have everything you want but everyone else doesn't get anything in return.

Slashdot Top Deals

"Gravitation cannot be held responsible for people falling in love." -- Albert Einstein

Working...