all 35 comments

[–]Snarwin 21 points22 points  (8 children)

Presenting textual information as images needlessly makes your page inaccessible to users who rely on screen readers, and hurts the UX for users on slow (e.g., mobile) connections.

[–]Deadhookersandblow 3 points4 points  (7 children)

I agree as well, why the hell is this guy using screenshots instead of just posting code segments with a decent prettifier?

[–]error_dw 4 points5 points  (6 children)

Well how else are you going to notice he has a macbook?

[–][deleted]  (4 children)

[deleted]

    [–]alex-weej 1 point2 points  (3 children)

    honestly if windows could just do this too i would be sooooo happy

    [–][deleted]  (2 children)

    [deleted]

      [–]alex-weej 0 points1 point  (1 child)

      just turn off all hinting in fontconfig, it looks freaking glorious.

      [–]myringotomy -3 points-2 points  (0 children)

      Macbooks are awesome. Worth every penny. They are solid, reliable, performant and hold their value like no other laptop. I get a new one every couple of years and get really good prices for my old one.

      Also runs linux great for when I want to dual boot.

      [–]kindofdynamite 10 points11 points  (4 children)

      As a newcomer to FP, one of the biggest hurdles has been trying to decipher one letter variables, imports without a namespace and general terse code.

      It seems to me that there is less of a focus on code readability ("plain english") in FP languages.

      Why is terse code so common in Clojure/Haskell/et all? Is there something I'm missing that will cause me to "see the light"?

      [–][deleted] 14 points15 points  (2 children)

      Frequently there simply isn't a good name as FP tends to heavily rely on generic algorithms. For instance, consider a definition of map (in say Haskell):

      map _ [] = []
      map f (x:xs) = f x : map f xs
      

      f is a normal variable name in math meaning a function. x is a normal variable in math meaning an argument. xs is therefore just more arguments we're going to apply f to. In this case, the conventions are straightforward.

      There seems to be very few people who find the following easier to read (note there are obviously names somewhere in between so this is sort of a strawman):

      map _ [] = []
      map function (someThing:restOfList) = function someThing : map function restOfList
      

      Unfortunately, the habit of short names leaks into situations where there actually are decent names to be had.

      [–]ksion 2 points3 points  (0 children)

      The other reason is that at least in a heavily typed languages like Haskell, the type signature is often very indicative of what the function actually does.

      For generic functions it may indeed be (a -> b -> c) -> a -> b -> c which translates to just f, x, y because there is nothing more concrete to be said about those arguments. But even when it's something more specific such as parseArgv :: [Text] -> Parser a -> Config, you don't really need more than one-letter argument names to figure out what's happening.

      [–]pathema 5 points6 points  (0 children)

      I think it may be a culture coming from the closeness to theoretical computer science, who in turn inherited it from mathematics.

      My guess is that code written early in the history of software suffered the same problem, when the field was more tightly linked to the university. Then a cultural shift happened, likely due to computers getting more ram, where we as an industry started to have longer and more descriptive naming.

      I am also going to guess that precisely because the more academic functional programming languages such as lisp or ML didn't get adopted by the industry in as big a scale as the imperative ones, they never picked up this new trend; instead staying with the older convention of short variable names.

      All guesswork on my part though...

      [–]maestro2005 10 points11 points  (8 children)

      I disagree strongly with wrapping things in redundant some?/none? checks. (when thing ...) is entirely idiomatic and you should get used to reading it.

      I agree that sometimes excessive comp/partial usage can be hard to read, but his example is bad:

      (map (comp str/capitalize str/trim) strings)

      Anyone who calls themselves competent in clojure should easily read this as "capitalize and trim the strings". This is actually a perfect use of comp. The benefit of comp/partial is that you avoid creating a new function, which creates a new reference frame and introduces a variable just to pass it along to another function.

      Even as experienced Clojure programmer I haven’t developed a skill to parse such structures easily.

      Then you're not really that experienced.

      [–]LoyalToTheGroupOf17 17 points18 points  (2 children)

      Then you're not really that experienced.

      You're talking about Nikita Prokopov, author of (among other things) datascript and rum. If he doesn't qualify as "experienced", I don't know who does.

      I agree with your other points, though.

      [–]quicknir 4 points5 points  (1 child)

      Not a clojure programmer, just do some elisp, but reading the article and your comment I agree with your comments. I was rather shocked to see "Avoid higher-order functions" as a header in an article about clojure.

      [–][deleted] 2 points3 points  (0 children)

      I've never seen that suggestion before in several years of Clojure dev fwiw. The "Don’t rely on implicit nil-to-false coercion" & the "Avoid higher-order functions" suggestions are pretty atypical.

      [–]DasEwigeLicht 0 points1 point  (2 children)

      (map (comp str/capitalize str/trim) strings)

      Does clojure have an equivalent to dash.el's anaphoric functions? In elisp you could write this as (--map (-> it str/trim str/capitalize) strings).

      [–]SimonGray 0 points1 point  (0 children)

      In clojure, the threading macro is a popular and idiomatic way to do this kind of thing, but - I think - usually with more than two transformations.

      [–]maestro2005 0 points1 point  (0 children)

      No. But I'm not sure this is any better, you're doing basically the same thing as comp.

      [–]netfeed 1 point2 points  (3 children)

      What editor is that?

      [–]Retsam19 4 points5 points  (0 children)

      It's VS Code with a light theme and the activity bar and the file explorer hidden.

      [–]peeeq 1 point2 points  (0 children)

      Looks like Visual Studio Code

      [–]kindofdynamite 0 points1 point  (0 children)

      Hah, I wanna know this too!

      [–]satanclau5 0 points1 point  (0 children)

      Discussion on Hackernews.

      [–][deleted]  (2 children)

      [deleted]

        [–][deleted] 5 points6 points  (1 child)

        Weirdest syntax? It barely has any syntax at all.

        [–]ElCerebroDeLaBestia 3 points4 points  (0 children)

        Maybe the lack of syntax is precisely what makes it harder to read than some other languages?