• 0 Posts
  • 139 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle
  • Unless you’re writing Scala or something (which is probably the one exception to the rule), if you are using a language that supports OOP, you’re not really doing functional programming. Functional-esque features that have made their way into imperative languages like map are only a tiny fraction of the functional toolbox.

    There’s a bunch of features you want in a language to do functional programming, and imperative languages don’t really have them, like purity by default (and consequently, an orientation towards values rather than references) ergonomic function composition, algebraic data types, pattern matching, support for treating everything as first class expressions/values, etc.

    Perhaps this is presumptious (and I apologize in advance if so), but I’d wager you haven’t truly programmed in the functional paradigm. What imperative programmers tend to think of functional programming is very surface-level and not really reflective of what it actually is. It’s an entirely different beast from imperative programming. It requires a shift of your mindset and how you think about programs as a whole.

    Source: Senior software engineer writing Haskell full time for the last 4 years. Will avoid OOP until my dying breath.





  • expr@programming.devtoProgrammer Humor@lemmy.mlWhat the F#
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    3 days ago

    For Haskell:

    1. I’d say this is definitely a wtf. Tuples should have never been given Foldable instances and I’d immediately reject any code that uses it in code review.

    2. I actually didn’t know, so TIL. Not surprising since common wisdom is that a lot of the type class instances for Doubles are pretty weird/don’t make a lot of sense. Just like in any language, floating point needs special care.

    3. This is jjust expected syntax and not really a wtf at all. It’s very common for languages to require whitespace around operators.

    4. Agreed as wtf, the NegativeLiterals should be on by default. Just would be a pretty significant breaking change, unfortunately

    5. Not a wtf… What would you expect to happen? That operation is not well-defined in any language





  • File-based navigation is often inefficient anyway (symbolic navigation is much better when you can), but if you do need it, that’s what fuzzy finders are for. Blows any mouse-based navigation out of the water.

    The only time a visual structure is useful is when you are actually just interested in learning how things are structured for whatever reason, but for that task, tree works just fine anyway.










  • expr@programming.devtoProgrammer Humor@lemmy.mlI love Rust
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    2 months ago

    Don’t need the Ord instance for equality, just Eq is sufficient. Ord is for inequalities.

    The point of the post is that most mainstream languages don’t provide a way to automatically derive point-wise equality by value, even though it’s pervasively used everywhere. They instead need IDEs to generate the boilerplate rather than the compiler handling it.


  • Ah could be hardware/OS, yeah. I believe everyone at our company are on MacBooks (I’m a Linux guy myself, but orgs don’t usually like that).

    My personal laptop is a Dell XPS 13 and while I like it for various reasons, it has had plenty of problems with the built-in mic and video (mostly the mic). So it very well could be that.