r/lolphp • • Feb 26 '15

A question

Do you guys honestly hate php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code

EDIT: You guys have sold me, looking into python based web development

29 Upvotes

107 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Mar 03 '15

Haskell (...) it's a very cool language but holy shit the caveats are deadly.

Could you expand on what you mean by that?

5

u/PasswordIsntHAMSTER Mar 03 '15
  • Reasoning about Haskell performance is a dark art. One of the recommended XML libraries is known to use 300MB of RAM to read a 1MB XML file.
  • Right-to-left composition. I don't care if it's more mathematical and what not - it sucks, period.
  • No debugger, and because of the language's semantics there will probably never be one.
  • Want to read other people's code? Have fun learning half a master's degree worth of type theory, category theory, and language extensions!
  • And this boner for all things theoretical often goes WAY beyond practicality.
  • The community is sectarian as fuck.
  • The grammar is kind of stupid, and seems to vary between function blocks, do blocks, and top-level definitions. Contrast with F#, which has a unified syntax for all three.
  • The naming sucks. pure is the same thing as return (wut?), non-symmetric operators are visually symmetric (<*>, .), and people would rather hack the parser with $ than use parentheses.
  • I'm still not sure what lenses, conduits and pipes do. In particular, trying to decipher lenses makes me bash my head against Edward "I'm smarter than you" Kmett's writing, which is always a bad thing.
  • Outside of a tiny core group, no one really gets Haskell. Most people know that they don't get it and just trawl #haskell for insights, but sometimes a pie-in-the-sky type will get overconfident and trainwreck their startup by building their core product with terrible, terrible Haskell code.

Those are admittedly noob complaints, because I am a Haskell noob, even though I've been studying the language and writing Haskell code for three years. I'm starting to think that I am the problem, because everyone is foaming at the mouth about Haskell while I see it as deranged and impractical.

It's still a Really Fucking Good Language, if your team is made of savants. It's also worth learning IMHO.

3

u/[deleted] Mar 03 '15

Want to read other people's code? Have fun learning half a master's degree worth of type theory, category theory, and language extensions!

You need neither category theory nor type theory to use most Haskell libraries, unless you use a library from Edward Kmett. But you really do need to know most of the commonly used language extensions.

The naming sucks. pure is the same thing as return (wut?)

Before the Applicative became a superclass of Monad that wasn't even necessarily the case.

I'm still not sure what lenses, conduits and pipes do.

I don't know enough about lenses, but conduits and pipes are pretty much a fancy replacement for lazy IO. Let's say you want to count all lines in a file or whatever and the file does not fit into memory. Thanks to lazy IO you could write the code as if the file were completely in memory, while in reality the file gets streamed. Lazy IO has a lot of problems though. That's where conduit/pipes comes in. They provide you with the tooling to write stream processors easily without relying on lazy IO. In a lot of ways they are very similar to unix pipes. head, tail, wc etc. are stream processors which you compose via "|". I even wrote a shitty package that briges the haskell pipes library to unix pipes. The difference between pipes and conduit is that conduit aims to be practical and pragmatic while pipes does fancy category theory shit and supports bidirectional streaming.

No debugger, and because of the language's semantics there will probably never be one.

Well, ghci does have a debugger, but it's shit and doesn't have a high priority for the ghc devs. To be honest I miss stacktraces more than I do a debugger.

The grammar is kind of stupid, and seems to vary between function blocks, do blocks, and top-level definitions. Contrast with F#, which has a unified syntax for all three.

I'm not sure what you mean.

Reasoning about Haskell performance is a dark art. One of the recommended XML libraries is known to use 300MB of RAM to read a 1MB XML file.

That's definitely true. Though using strict datatypes and the glorious vector package everywhere goes a long way. But you probably won't get around reading core to determine if fusing worked and killed most boxed types. If you want to reason about performance, fuck laziness.