GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Arch 💕 (archenoth@chitter.xyz)'s status on Tuesday, 28-Nov-2023 05:08:26 JST Arch 💕 Arch 💕

    i feel like such an anomaly being a functional dev who actually likes java

    In conversation Tuesday, 28-Nov-2023 05:08:26 JST from chitter.xyz permalink
    • Embed this notice
      tech? no! man, see... (technomancy@icosahedron.website)'s status on Tuesday, 28-Nov-2023 05:08:20 JST tech? no! man, see... tech? no! man, see...
      in reply to

      @archenoth doesn't the null problem just depend on the libraries you use tho?

      like ... the good thing about the Option monad is that it allows you to create a language that doesn't have null; you can guarantee it's never going to exist

      whereas if you have null *and* Option, now you never really know what you're going to get, unless you're just super disciplined about your own coding and never call any code written by someone less-disciplined than you are?

      In conversation Tuesday, 28-Nov-2023 05:08:20 JST permalink
    • Embed this notice
      Arch 💕 (archenoth@chitter.xyz)'s status on Tuesday, 28-Nov-2023 05:08:22 JST Arch 💕 Arch 💕
      in reply to

      then again, we are talking about a language that now has destructuring pattern matching, and quite a few mostly-monads that let you chain together lambdas and method references while still giving you type guarantees

      all while never needing to touch null

      plus, as a neat bonus, you can interop with it using clojure! my favorite language (or even outright embed it!)

      In conversation Tuesday, 28-Nov-2023 05:08:22 JST permalink
    • Embed this notice
      tech? no! man, see... (technomancy@icosahedron.website)'s status on Tuesday, 28-Nov-2023 06:15:23 JST tech? no! man, see... tech? no! man, see...
      in reply to

      @archenoth gotcha; so you just have to be diligent about protecting your boundaries then; just assume that any library that doesn't mention Options needs to be wrapped up

      seems like it would still be quite difficult if you had a pre-existing mid-to-large codebase and you were trying to modernize it gradually, but for greenfield it shouldn't be as much of an issue

      In conversation Tuesday, 28-Nov-2023 06:15:23 JST permalink
    • Embed this notice
      Arch 💕 (archenoth@chitter.xyz)'s status on Tuesday, 28-Nov-2023 06:15:24 JST Arch 💕 Arch 💕
      in reply to
      • tech? no! man, see...

      @technomancy partially! `Optional.ofNullable()` is an okay thing to shove returns from external libraries into, since you can then treat them the way you usually would, you can also use `.map()` instead of `.flatMap()` to call nullable methods in ways that, if they return null, still are inside Optional

      ...or you can do what i did and make a Result sealed interface that you can just say Result.of(anything), and then use it in pattern matching like Rust (or chain it into an Optional)

      In conversation Tuesday, 28-Nov-2023 06:15:24 JST permalink

      Attachments


      1. https://media.chitter.xyz/media_attachments/files/111/484/341/936/988/424/original/3f22f02ca9d3dfa8.png
    • Embed this notice
      tech? no! man, see... (technomancy@icosahedron.website)'s status on Tuesday, 28-Nov-2023 06:55:06 JST tech? no! man, see... tech? no! man, see...
      in reply to

      @archenoth it kinda sounds like Java has been doing a lot of catch-up, yeah, which is great if you're using Java

      but it doesn't seem surprising to me that "we caught up to most of what everyone else has been doing" isn't enough to get new people to use it who aren't already using it; there's nothing compelling there you can't get elsewhere

      In conversation Tuesday, 28-Nov-2023 06:55:06 JST permalink
    • Embed this notice
      Arch 💕 (archenoth@chitter.xyz)'s status on Tuesday, 28-Nov-2023 06:55:07 JST Arch 💕 Arch 💕
      in reply to
      • tech? no! man, see...

      @technomancy it's funny that you mention this, because modernizing a mid-sized (~1000 class) codebase is actually exactly what i've been up to~

      one thing it really does make abundantly clear is why people don't like java (or rather, the java that everyone who doesn't like it recognizes)

      - the dilligent finally usage needed (instead of autoclosing try-with-resources blocks)
      - relying heavily on class hierarchies (instead of modern mixins)
      - limited generics and Object to get past it
      - no lambdas
      - no method references
      - no Optional
      - no switch expressions (just switch-case statements)
      - no pattern matching
      - zero destructuring
      - egregeous boilerplate for classes that only need to hold a couple related immutable values (as opposed to records)
      - only platform threads (as opposed to being able to spawn millions of structured green ones no problem)

      the before and after in some of these cases is absolutely drastic, but also super-satisfying

      but, java is blub, so its new stuff get ignored

      In conversation Tuesday, 28-Nov-2023 06:55:07 JST permalink
    • Embed this notice
      tech? no! man, see... (technomancy@icosahedron.website)'s status on Tuesday, 28-Nov-2023 07:15:00 JST tech? no! man, see... tech? no! man, see...
      in reply to

      @archenoth it would be a really compelling list of features! if it were 2015 =)

      but nowadays Java spent so long adding ML features that OCaml caught up and actually does multicore now, haha

      In conversation Tuesday, 28-Nov-2023 07:15:00 JST permalink
    • Embed this notice
      Arch 💕 (archenoth@chitter.xyz)'s status on Tuesday, 28-Nov-2023 07:15:01 JST Arch 💕 Arch 💕
      in reply to
      • tech? no! man, see...

      @technomancy oh yeah! this is definitely true

      it definitely has an edge against the things people compare it to the most--but there are very few ways it's actually breaking any new ground

      In conversation Tuesday, 28-Nov-2023 07:15:01 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.