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:CEO's fear (Score 1) 75

I seem to recall a study a few years back that showed that most highly paid CEOs' decisions were not better than random and, in a number of cases, were significantly worse. They shouldn't be worried that they can be replaced by AI, they should be worried that they can be replaced by a magic 8 ball.

Comment Re:Robots are good (Score 1) 75

The problem isn't robots taking all our jobs, it's robots taking half of our jobs. How do you manage a society in which 50% of the working-age population are contributing essential work for the functioning of civilisation and the other 50% are not able to do anything that a machine can't do better? Unemployment rates of 10-20% are currently seriously problematic for western societies and cause huge economic problems. For some jobs, you can solve it by dividing the work among more people, so you have four people working a 10 hour week instead of one working a 40 hour week, but that doesn't help you to deal with the people who aren't able to do any available jobs.

Comment Re:It's not that I want to brag I'm old... (Score 1) 289

Add to that, the defining feature of a functional language is the set of things that it disallows, not the set of things that it permits. A multi-paradigm language, by definition, has to permit anything that the various paradigms permit and so doesn't gain the benefits that you get from being able to reason about your code in a language that doesn't permit unconstrained mutability or side effects.

Comment Re:It has its uses (Score 3, Interesting) 289

This needs moderating up. Talk to an Ocaml programmer and a Haskell programmer about what makes a functional language and you'll see very different opinions and these two are languages that were actually designed as functional languages: the bits that end up in other languages are a tiny subset.

Coming from the Haskell side, I see functional programming as programming without side effects and with monads. You can implement monadic constructs in other languages, but it rarely makes code cleaner. Just having higher-order functions doesn't make a language a functional language any more than having structs makes C an object-oriented language.

If the question is 'do you think using higher-order functions simplifies the expression of some algorithms' then the answer is obviously 'yes': programmers have a lot of tools to choose from and most of them are useful at least some of the time.

Comment Re:It has its uses (Score 2) 289

In C++14 in particular, lambdas with auto parameters dramatically reduce copy-and-paste coding. If you have a couple of lines of code that's repeated, it isn't worth factoring it out into a separate templated function (in particular, you'll often need to pass so many arguments that you'll end up with more code at the end), but pulling it into a lambda that binds everything by reference and has auto-typed parameters can reduce the amount of source code, while generating the same object code (the lambda will be inlined at all call sites).

Comment Re:It is great, just don't make a religion out of (Score 1) 289

So if regular programmers who form the bulk of the workforce can't grok them, the languages need to be fixed, not people.

I know what you're saying, but there's a real danger here that the industry will find itself caught in a local extremum. An engineer of 1880 could easily have said that if regular engineers who form the bulk of the workforce can't understand this "electricity", then it needs to be fixed to conform to the world of steam.

The worst thing we can do as an industry is think we know what we're doing. And in a sense, we're already there.

Comment Re:It depends on the use (Score 1) 289

If one is well versed in category theory or has spent a significant amount of time working with functor spaces, monoids, and monads, then it's much easier to understand a non-trivial application written in Haskell than the equivalent object hierarchy in an object-oriented language. The up-front cost is greater in terms of study and learning the semantics, but the end result is significantly more powerful.

I strongly suspect (but can't yet prove) that the supposed up-front cost in understanding Milner-esque functional languages is just the same as the up-front costs for Simula-style object oriented languages. The difference is that in the case of Simula-style object oriented languages, most of the up-front cost has already been largely paid by the time you come to them.

If it's any help, consider that there seems to be a significant learning cost in wrapping your brain around "real" object-oriented languages such as Smalltalk when coming from "broken Simula" object-oriented languages such as Python or C++.

We teach set/function theory and basic logic to high school students. It shouldn't be that much harder to make the very small amount of generalisation to explain the fundamentals of a modern logic-based type system.

Comment Re:functional composition (Score 2) 289

It only makes code more readable if you're familiar with it (functional programming).

Well that's a truism. Object-oriented programming is the same: it only makes code more readable if you're familiar with it.

The main distinction between the two, however, is that object-oriented programming was invented, but functional programming was discovered.

Slashdot Top Deals

"Gotcha, you snot-necked weenies!" -- Post Bros. Comics

Working...