Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×

Comment Re:What does this do to content? (Score 1) 34

It seems unlikely that EU law will prevent a vendor from selling something at all in selective member states if there is a good reason not to. We looked into this issue when the EU VAT mess was the big news a couple of years ago, fearful that some sort of anti-discrimination provisions would say otherwise. The experts made some straightforward arguments that, for example, declining to sell to customers elsewhere in the EU would be OK if the costs of operating the new tax scheme were prohibitive, because that would be a strictly commercial decision. Presumably complying with the law of the land would also be considered an acceptable basis for making such a decision.

Comment Re:Good or bad for customers? (Score 1) 34

The EU is working being a common market, where it started.

That's lovely, and when the economic situation in all EU member states is similar, maybe they'll achieve it. In the meantime, it is far from clear that this is a good thing.

At least in the sort of context we're talking about here, the "real market price" you mentioned is what someone is prepared to pay for something, no more and no less. Forcing people from areas with very different economic situations to pay the same price just means a lot of things won't be accessible to people from those places that can't afford the same rates as their wealthier neighbours.

Comment Is this "Nunews"? (Score 1) 163

When Wikipedia was proposed, I thought the original intent was that Wikipedia would be the drawing board for Nupedia articles maintained by professional writers. Is there a similar relationship between Wikinews and Wikitribune?

RTFA? I closed the CNN tab when an ad started playing audio.

Comment Re:It has its uses (Score 1) 405

I'm going to argue there are no special cases that don't fit.

In a strictly mathematical sense, yes, various things are equivalent and various patterns are universal. However, that's a bit like saying you can do anything with sequencing, selection and repetition. While true in a sense, realistically it doesn't necessarily represent the clearest way to express everything. In practice, I have sometimes found that while I might build individual parts of a complicated algorithm from tools like folds, it may be clearer and easier to write the "big picture" using explicit recursion rather than trying to adapt everything to fit some standard algorithm.

As a practical example, not so long ago I was working on some code that would take some information in a certain format as input, and update a rather complicated graph-like data structure to incorporate that extra information. This algorithm involved walking the graph, and depending on the properties of each node reached and of the information to be merged in, either updating that single node "in place" or changing the structure of the graph around it. Each such step would typically transfer some of the remaining information into the graph, and then continue walking the rest of the graph to merge in the rest of the information until one or the other ran out. No doubt with enough mathematical machinations this could have been shoe-horned into some standard pattern, but in practice it was far simpler and more transparent to write a small set of mutually recursive functions that implemented the required behaviour at each step. And of course each of those functions then received information about the state of the graph walk and the state of the information being merged in through parameters.

At this point I think purity allows for laziness and laziness demonstrates a lot of the advantages of purity.

If you only care about the result of evaluating a function, sure, but if you also care about the performance characteristics of your program, I don't think it's so simple. Laziness can be both a blessing and a curse.

As for lazy with large amounts of data, Hadoop is lazy. So I'm not sure what you are saying.

In short, unrestricted laziness can cause huge increases in the amount of working memory required to run a program, until finally something triggers the postponed evaluations and restores order. As I recall, there was even a simple tutorial example in Real World Haskell that could wind up exhausting the available memory just by scanning a moderately large directory tree because of the accumulated lazy thunks.

Comment Re:It has its uses (Score 1) 405

Until functional programmers start speaking the same language as people in industry, we'll keep rolling our eyes and ignoring you.

I'm pretty sure maths has been around longer than programming, so who is really redefining the language here?

Also, false dichotomy is false. Functional programming concepts are widely and effectively used in industrial programming. The idea that what we're talking about is some academic, ivory tower idea is decades out of date.

Comment Re:It has its uses (Score 1) 405

That's just bad functional code.

It was a simplified example, but I think the point would still be valid in some more complicated case that doesn't fit one of the everyday functional programming patterns. The state is still there, it's just conveyed by accumulating function argument(s) in recursive, functional code instead of storing it in loop control variable(s) in imperative code.

The other thing is you don't want to be "doing stuff" and iterating. You want to be computing stuff and then "doing stuff" on the entire set of output. The system as it pulls output will drive the iteration on the computation.

I think you're conflating lazy evaluation with functional programming here. In any case, I think that sort of claim needs some qualification. Haskell-style laziness is nice for composition in theory and sometimes it lets us write very elegant code in practice, but it can also become a liability, particularly if you're working with very large amounts of data or anything time-sensitive.

Comment Re: It has its uses (Score 1) 405

On the other hand, if you've used a language that is designed to support functional programming, you probably wouldn't be in much doubt.

For example, here's the all-positive check written in Haskell:

all_positive = all (>0) [1, 2, 3, 5, 8, 13]

which is just a convenient notation for:

all_positive = all (\x -> x > 0) [1, 2, 3, 5, 8, 13]

where the backslash is Haskell's general syntax for introducing a lambda.

Criticising the ideas of functional programming because, for example, C++'s syntax for lambdas is horrific is like criticising OOP because setting up dispatch via vtables is a bit messy in assembly language. It's just not the right tool for the job, and it's unlikely to give great results no matter what you do with it. You have to look at the underlying principles to see whether they're useful or not.

Comment There is no "The Only Way" (Score 1) 405

But it should not be The Only Way to approach a program - unless you are Truly One with the Tao.

Unless you are a total newbie who has only been exposed ot one tool, or a hypothentical/mytical code-master-of-all-code-masters who is "Truly One with the Tao," then you know there is no "Only [one reasonable] Way" to approach a program/problem, at least not one of any reasonable complexity.

Slashdot Top Deals

When it is incorrect, it is, at least *authoritatively* incorrect. -- Hitchiker's Guide To The Galaxy

Working...