News for hackers. Stuff that matters.

pkese

Do note, that some functional languages have good out-of-the-box support for both backend and frontend. An this is not negligible. I'm using F# which in combination with Fable (F#->.js transpiler) lets me really quickly share code, datastructures and serialization with frontend code.

Now, I'm a primarily a backend developer. But sometimes it is just really convenient to be able to hack together an in-house real-time data-analysis or reporting service and render statistics as webpages rather than .csv documents.

If your frontend team is functional as well, then the benefits of sharing the language could be even bigger.

Sure, not everything is perfect in the F# world. However having the possibility to share code with frontend saves me more time than I spend in fighting with the F# ecosystem. And also: programming in F# is just fun joyful. And productive.

Re:Ask HN: Why isn't F# more popular? on Thursday June 01, 2017 @07:46AM (#14459470)
So far I've used F# form smaller projects, basically anywhere there's any un-trivial problem. Just the fact that the editor helps you write correct and concise code means that once you correct the mistakes that the editor (Ionide) higlights for you, things will just compile and work out of the box.

Compared to Python, I'd assume that 1) I write a bit less code to solve the same problem in F# as I would in Python, 2) it takes a bit more time, but it is more fun, 3) once it compiles, there are seldom any bugs.

So technically you trade some of programming speed for less time spent in debugging and writing test code. In the end, you are way faster and more productive. Especially once the code base starts getting bigger, the type system starts bringing in extra benefits.

Major point is that detecting and correcting bugs in editor is faster than in compilation, and in compilation is better than at testing. So compared to Python, you get 2 orders of magnitude of better and faster development.

Re:Ask HN: Why isn't F# more popular? on Thursday June 01, 2017 @06:18AM (#14459122)
It might be worth also looking into ReasonML, which is a very similar language, but gets some of F# issues right, like:

  - Targeting native compilation and javascript transpilation out of the box
  - Proper functionally architected libraries
  - (including React and React-native for GUIs)
  - Ocaml style functors
  - Easy syntax for people who are familiar with javascript
  - Prime-time promotion by a large company (Facebook)
  - Targeting unikernels (i.e. MirageOS) makes it geek/buzzword compliant
The only downside for ReasonML right now I guess is that the tooling and developer experience (especially on Windows) is nowhere near to what F# / .Net core / VS Code+Ionide already offers on all platforms (Win/OSX/Linux).
Re:Ask HN: Why isn't F# more popular? on Thursday June 01, 2017 @06:03AM (#14459067)
I think the main problem is that F# never went beyond .Net platform (e.g. they never released a native compiler). .Net is nice and gets the work done, but the fact that existing .Net libraries are OOP style means 1) they don't fit as nicely into the F# paradigms (see other people's answers) and 2) adoption is easy for people already familiar with .net and not as easy for people coming from other languages/platforms.

In addition, inside the .Net world, F# got a role of just "And you can even do functional programming in .Net if you like", rather than "this is a proper way of how people should write safe high-level code". I think Ximian is the only one giving F# proper handling.

Re:Ask HN: Why isn't F# more popular? on Thursday June 01, 2017 @05:45AM (#14459016)
Funny. I'm also love Linux, but for me, the combination of .Net Core/Standard, Visual Studio Code and Ionide provide by far the best programming toolset/experience of anything I have ever seen in my 30 year programming career.

And all of it works on Linux just as well as it does on Windows.

Re:RxJS is great. So why have I moved on? on Friday December 18, 2015 @02:22PM (#10760363)
RxJS has a steep learning curve and is quite hard to really understand beyond basic examples that fit on a presentation slide. It might be a great tool for really smart developers, but I wouldn't share any large RxJS code in a developer team where all developers are not at least 200% geniuses.

The whole thing reminds me of C++ years ago, where the language allowed for really smart and efficient coding style, but many less skilled developers at the time had problems with deep understanding of templates, operator overloading, multiple inheritance, various constructors and such. Pragmatic companies (e.g. Mozilla) thus decided to ban all the advanced features and stick just to basic ones so that the code would be maintainable.

I think RxJS is facing similar fate. I've spent quite some time learning it and I think it is one of the more complex paradigms on the market today. In addition there isn't much useful documentation. Feel free to check stack overflow and find out about the struggles people are going through tying to extend basic examples (e.g. google for rxjs mousedrag).