FP

Discussion in 'Programming General' started by iJava, Jul 3, 2016.

FP
  1. Unread #1 - Jul 3, 2016 at 9:36 PM
  2. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    FP

    Whats your guys thoughts on functional programming? Have you tried it? Do you like/dislike it and why?

    Personally I enjoy writing pure functions which don't rely on state and are easy to test, also helps you me to keep my fields immutable which means I have a lot more confidence in making processes concurrent.

    Interested to get other peoples opinion, that's only my brief one.
     
  3. Unread #2 - Jul 6, 2016 at 10:07 PM
  4. GOAT
    Joined:
    Sep 27, 2015
    Posts:
    19,354
    Referrals:
    8
    Sythe Gold:
    200
    Discord Unique ID:
    232534753969045505
    Discord Username:
    goat7777
    Nitro Booster CoolHam Two Factor Authentication User Toast Wallet User

    GOAT <THE GOAT> DISCORD goat7777 UID 232534753969045505
    GOAT Donor

    FP

    I don't know any purely functional languages but I do a lot of Java, and I haven't used any of the Java lambda stuff very much since Java 8 came out. I think it's because I read an article which said it was very poorly optimised a while ago and I've never had any particular need to use it over other solutions. I imagine I'll have to start using it eventually though.
     
  5. Unread #3 - Jul 8, 2016 at 10:27 PM
  6. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    FP

    Yeah I wouldn't really recommend java 8 lambdas to anyone, you're better off using a language which is largely aimed at being functional.
     
  7. Unread #4 - Jul 17, 2016 at 8:54 AM
  8. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    I'm very much so into Haskell. For certain problems it really shines but my biggest love for it is the type checking and the fact that the concepts are slowly being brought into other programming languages (like Java or C++ or C#) that make our lives so much better in them.
     
  9. Unread #5 - Jul 17, 2016 at 9:57 PM
  10. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    I did a lot of Elixir a couple months back and really liked it. I made three web scrapers to compare languages. I used Java, SmallTalk, and Elixir. The Elixir version was short, very readable, concise, and easily debugged. The Java version was similar but was much longer. Don't even get me started on fucking SmallTalk though. I can appreciate what they were going for with that language but holy hell the environment (Pharo) is the worst. The documentation is also some of the worst I've ever seen.

    Anyway, I feel like FP is absolutely fundamental to any programmer's repertoire of knowledge. It teaches a lot of really important concepts that are transferable to OOP. Immutability is a very good way to "force" modularity. I don't know that I'd ever use FP to develop anything serious though. Small, specific tasks? Hell yes. Full programs? Unlikely.
     
  11. Unread #6 - Jul 18, 2016 at 9:37 AM
  12. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    I'm writing a Haskell program to parse Sythe pages to extract information from them and it's going pretty well. It might be easier in another language but maybe not. I'm moving along at a decent pace even though I'm not great at Haskell and the library I'm using is rather old.
     
  13. Unread #7 - Jul 18, 2016 at 12:13 PM
  14. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    You should take a look at Elixir. It uses the Errlang VM and has similar syntax but without the fuck-uppery. I never liked Haskell.
     
  15. Unread #8 - Jul 22, 2016 at 12:36 PM
  16. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    I really like Haskell. What didn't do it for you?
     
  17. Unread #9 - Jul 23, 2016 at 1:23 AM
  18. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    School probably ruined it. In my FP class we learned a new language every week and a half or so and redid the same assignment in each one. Haskell was the last one and I had exams to study for in the FP class and every other class too so it was rushed and unenjoyable.
     
  19. Unread #10 - Jul 23, 2016 at 4:29 PM
  20. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    I had to take a class like that. I had an entire class about Haskell and I really enjoyed it. Learning about monads and higher order functions and lazy evaluation has been really cool and I see the concepts that Haskell has coming more and more into other languages. I don't think you really need to learn multiple functional languages but Haskell is really cool none the less.
     
  21. Unread #11 - Jul 23, 2016 at 5:29 PM
  22. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    FP

    Interesting, I would without a doubt use FP for a full program. The reinforcement it provides on immutability forces me to writer cleaner code that I can trust has a greater level of thread safety than if I was mutating state all the time.

    There are certain places you have to mutate but wherever I can I don't which is in 95% of applications I create.

    Never used Elixir but it looks interesting but I think I'd learn Clojure over it.
     
  23. Unread #12 - Jul 30, 2016 at 1:09 AM
  24. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    I think it's just a matter of easy modularity. I don't know that I've spent enough time with FP to really nail any sort of proper maintenance and continuity tactics but OOP is, for me, infinitely easier to change and manipulate with patches and updates. That's why I feel like FP is better suited for smaller tasks, where the code is shorter and more easily maintained.
     
  25. Unread #13 - Jul 30, 2016 at 2:46 PM
  26. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    Functional languages really force you to break everything up into small modular components or it just doesn't work well. Ideally any program you write will be a few generic libraries stuck together to do one specific task well. I can a test to the fact that making even small changes is a big pain in the ass.

    Haskell is actually really nice to write quick scripts in for stuff you might use bash for. The only reason not to is the type checking can be a tad annoying and you have to manage compiling and stuff which makes me reach for bash instead but I still find it much easier to compose the simple building blocks in haskell than I can in like c++ or java.[/QUOTE]
     
    Last edited: Jul 30, 2016
  27. Unread #14 - Jul 30, 2016 at 4:01 PM
  28. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    Elixir bro

    Also typically for quick scripts at the moment I'll avoid bash like the plague and go for straight C
     
    ^ Astro likes this.
    Last edited: Jul 30, 2016
  29. Unread #15 - Jul 30, 2016 at 4:08 PM
  30. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    Ewwww. How do you manage to get stuff like a POST request or something done easily in C?
     
  31. Unread #16 - Jul 30, 2016 at 4:12 PM
  32. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    Oh I wouldn't, I'd use something else for that. When I need to make quick scripts it's usually for math.
     
    ^ Astro likes this.
  33. Unread #17 - Jul 31, 2016 at 4:34 AM
  34. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    FP

    Why not use something like Python?
     
  35. Unread #18 - Jul 31, 2016 at 8:57 PM
  36. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    I'd like to learn Python next, but for now every *nix distro ships with gcc so it's actually easier and more portable than Python.
     
  37. Unread #19 - Aug 1, 2016 at 8:13 AM
  38. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    FP

    I mean every Linux box I'm on has python installed so it's normally a pretty safe bet. I keep meaning to learn it but I've just never had any reason to. I've actually written a lot of a random small programs in Node (please kill me) to avoid having to learn something like python (also my team loves node....).
     
  39. Unread #20 - Aug 1, 2016 at 3:26 PM
  40. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    FP

    Fucking javascript man
     
< ►Shape-Ship Run◄ | >

Users viewing this thread
1 guest


 
 
Adblock breaks this site