Hacker News new | ask | show | jobs
by formula1 3648 days ago
Its disengenious to imply that functional cant be as insane as procedural. Also, everything is strong and securw until vulnerabilities are found (heartbleed as an example). Its in the hackers best interest to never let these vulnerabilities known. Also since there are many less eyes on less popular languages, vulnerabilities will take more time to be discovered.
1 comments

The combination of stronger type systems (especially dependent typing), less error-prone design (no manual memory management, no mutation, no global state, no loops/off-by-one errors), separated side effects (crashing during computation won't break things, less places for outside interference/external failure, etc.), and better error handling (no null, usually no exceptions meaning you have to encode failure into the return value itself without losing type information) solves many common bugs in imperative code.
Type systems - already available in the most popular languages

no memory management - c++, go, java come to mind

No mutation - has a side effect which you probably will never mention. But it will become important as the internet of things gets smaller

No global state - in what environments would that ever be an encouraged paradigm? Javascript?

No loops/off by one - you still need loops, they are just recursive. The difference is you need to jump around to figure out what the hell is going on instead of reading it top to bottom

Better error handling - nothing you just said seems better to me

Sure, there are many thing I like about functional languages. I like how you can create a tree to reason about you code to the point it looks like a flowchart. It has forced me to question my own coding style and how I compartmentalize and where I can run things in parralel. How infinite lists, streams and arrays can all be considered the same interface. But I think there is room for growth.

- forces me to the bottom of a document to find out where it starts

- uses obscure language in order to avoid oop

- Cannot use symbols represent the start and end of a typed object constructor with a single string argument (regex, jsx, queries, etc)

I don't believe GP meant 'type systems' the way you mean them. He's talking about the more powerful concepts such as dependent typing, not just the existence of types.

There are very few popular languages which would fit this category IMO, depending on how one defines powerful type system and popular. Scala is the only candidate that I can think of for my own definitions of those two concepts.

>Type systems - already available in the most popular languages

This implies you haven't actually spent time with a strongly typed functional language like Haskell. Once you have, it's hard to continue thinking of Java or C++ as having "type systems".