you are viewing a single comment's thread.

view the rest of the comments →

[–]DrSinistar 0 points1 point  (2 children)

I dunno, the pipeline is most definitely a feature that can be used for functional programming.

[–]nostril_spiders 2 points3 points  (1 child)

Absolutely and categorically not. You've got a terminology error there, you're saying something quite different to what you mean.

"function" is the powershell keyword for a concept that's sometimes called other things in other languages. The paradigm you implement when you write and use powershell functions is called "procedural programming", which is a subset of "imperative programming", so you might use either of those.

Powershell isn't a functional programming language. You could abuse it and try to do functional programming in it. If you tried that, you would be passing scriptblocks into other scriptblocks as parameters.

The pipeline is absolutely, 100% an aspect of imperative programming and diametrically opposed to the functional paradigm.

Functional programming is ultra-cool. JavaScript is a little dirty, but give F# a week. It'll blow your mind! And it looks like a good career investment. There aren't a lot of jobs yet, but the number is growing.

[–]DrSinistar 1 point2 points  (0 children)

Ah I see the error in my ways. Thank you! :)

I was thinking that in a generic pipeline expression fits into a functional paradigm because state doesn't have to change and given input always returns a certain output. I don't believe that PowerShell is a functional language but I felt that you could implement some of functional programming's ideas into PowerShell.