Federati Nu: Federated N-series GNU Social
  • Login
It's "All Of Us For All Of Us" Or We're On Our Own
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. André E. Veltstra (aeveltstra@mastodon.social)'s status on Monday, 11-Feb-2019 22:48:07 UTC André E. Veltstra André E. Veltstra
    Remote profile options...

    I like #eventDriven #software #architecture ever since I encountered it both in #JavaScript and in #VisualBasic. When I switched to the #Java #programming #language, it happened when Java still had to gain #lambdas. Applying an event-driven paradigm with that version of Java felt out of place and unelegant. But ever since #Java8 I find myself slowly returning to event-driven choices.

    In conversation Monday, 11-Feb-2019 22:48:07 UTC from mastodon.social permalink
    • André E. Veltstra (aeveltstra@mastodon.social)'s status on Monday, 11-Feb-2019 22:53:46 UTC André E. Veltstra André E. Veltstra
      Remote profile options...
      in reply to

      For instance, after a HttpResponse is returned from a web server, I check the status code: if failure, then run failure method, else run success method. I can do that with an if statement. Using an if statement means that I have to query the status code. I can also do it with a Consumer and Runnable: onSuccess(action, otherwise). The status code still gets checked, but now that gets done in the appropriate place: the response checks it, or the code checks itself.

      In conversation Monday, 11-Feb-2019 22:53:46 UTC permalink
    • André E. Veltstra (aeveltstra@mastodon.social)'s status on Monday, 11-Feb-2019 22:58:25 UTC André E. Veltstra André E. Veltstra
      Remote profile options...
      in reply to

      We see hints to this model in #Java's #Optional class, with its #ifPresent(Consumer) method, and its #ifPresentOrElse(Consumer, Runnable) method.

      And it's a shame that we can't apply this model to Strings or anything else implementing an isEmpty() method: the Java #programming #language won't let us #subclass most of its core classes.

      It feels easier to implement this in a #trait-based language like #RustLang.

      In conversation Monday, 11-Feb-2019 22:58:25 UTC permalink
    • André E. Veltstra (aeveltstra@mastodon.social)'s status on Monday, 11-Feb-2019 23:04:20 UTC André E. Veltstra André E. Veltstra
      Remote profile options...
      in reply to

      The #Java #programming #language of course has a long history with passing #Runnables into #thread runners and executors. We see it all over the place in #Swing and #JavaFX. It just always felt clunky to me. And that feeling got lifted, mostly, with Java gaining #lambdas.

      I remember when my #CSharp colleagues first introduced me to the concept of lambdas. We were very excited.

      May the remaining limitations Java imposes on lambdas get lifted soon!

      In conversation Monday, 11-Feb-2019 23:04:20 UTC permalink

Feeds

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

Federati Nu: Federated N-series GNU Social is a social network, courtesy of Federati Networks. It runs on GNU social, version 2.0.0-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Federati Nu: Federated N-series GNU Social content and data are available under the Creative Commons Attribution 3.0 license.

Switch to mobile site layout.