News for hackers. Stuff that matters.
Re:Do I have to learn Functional Programming to get a decent... by wilsonnb3 on Tuesday January 08, 2019 @09:45PM (#18861855)
Absolutely not. Thinking that you might have to learn functional programming to get a decent job is a clear indicator that you are in a Hacker News/Silicon Valley bubble.

The world will run on object oriented and imperative programming for the foreseeable future. Functional programming is more or less a novelty professionally, although a highly visible one in certain circles.

Re:Do I have to learn Functional Programming to get a decent... by veddox on Thursday January 10, 2019 @05:30AM (#18872834)
Hardly a novelty, it's been around longer than object-oriented programming has. But apart from that, you are correct to state that it is a minority paradigm on the general job market.
Re:Do I have to learn Functional Programming to get a decent... by rhwk97 on Tuesday January 08, 2019 @10:00PM (#18861916)
I find the functional programming crowd can be very vocal on a site like HN...can't tell you how many times I thought..."you know, I should really learn Lisp" after visiting here!
Re:Do I have to learn Functional Programming to get a decent... by yesenadam on Thursday January 10, 2019 @03:47AM (#18872457)
Hehe. I started learning Prolog a few weeks ago - not sure why. Maybe after seeing one more story about it on here, and seeing it on lists of languages that're good to learn. But didn't know anything much at all....

What a surprise. I really like it. It's really sooo different from any other language I've tried (C, C++, Python, JS, SmallTalk, Lisp, bash, AWK etc etc) - Most programming consists of telling the computer how to go about doing something. None of that in Prolog. You 'just' describe how the solution will look.[0] And secondly, it's unexpectedly Functional - it's impossible to change variable values, or iterate.[1] Recursion only. 'Data' is same form as 'program', the program can change the data/program while running etc. And even Lispier than Lisp in some ways.

I think I'll be regularly using it in an AWK-like way - and already have been - quickly writing programs of a couple of dozen lines or less to do things that would take longer to do otherwise. And there's something cute about it that AWK has too, maybe it's that it does well in its own unique world. Just starting that book on how Erlang was 'grown' using Prolog...

I don't know why I wrote this. Prolog was just surprisingly FPish, and if I hadn't learnt about that stuff, I wouldn't have recognized it, or appreciated it.

[0] Really, you need a new vocabulary to describe what it's doing. [1] Ok, not impossible.

Re:Do I have to learn Functional Programming to get a decent... by vram22 on Thursday January 10, 2019 @02:32PM (#18877216)
>Just starting that book on how Erlang was 'grown' using Prolog...

What book is that?

Re:Do I have to learn Functional Programming to get a decent... by yesenadam on Thursday January 10, 2019 @02:55PM (#18877439)
Whoops. Not a book, just a 17 page paper. It's fascinating so far.

Use of Prolog for developing a new programming language (1992) by Armstrong/Virding/Williams.

http://192.121.151.106/publications/prac_appl_prolog.pdf

Re:Do I have to learn Functional Programming to get a decent... by vram22 on Friday January 11, 2019 @03:47AM (#18881876)
Thanks, will take a look.
Re:Do I have to learn Functional Programming to get a decent... by yesenadam on Friday January 11, 2019 @08:09PM (#18888777)
Armstrong's PhD thesis from 2003 Making reliable distributed systems in the presence of software errors (295 pages!) has the whole Erlang story, including an Erlang tutorial, large parts of which are identical to a Prolog tutorial (or virtually, just substituting -> for Prolog's :-, and ; for . etc), I would have had no idea how huge the similarities are, had I not become familiar with Prolog first.

http://erlang.org/download/armstrong_thesis_2003.pdf

Also, in the 17 page paper, he firstly makes a meta-interpreter, which I've since noticed is pretty standard in Prolog books, e.g. The Art of Prolog, The Craft of Prolog. ‎

Re:Do I have to learn Functional Programming to get a decent... by vram22 on Saturday January 12, 2019 @02:22PM (#18892805)
Thanks, will check that too. I remember The Art of Prolog coming up here on HN a while ago.