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
    Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 01:58:58 JST Paul Cantrell Paul Cantrell
    • Ben Cohen

    I’ve always scoffed at the “explicit is better than implicit” maxim in programming. It’s hot nonsense.

    All code has •something• that’s implicit. (Do you write out the Peano axioms every time you declare an integer?!) Deciding •what• should be implicit and what should be surfaced as explicit is one of the most difficult and important fundamental questions in language and API design. “Nothing” and “everything” are both nonsense answers.

    Thought comes to me be because of this from @airspeedswift:
    https://mastodon.social/@airspeedswift/113810755456672499

    In conversation about 4 months ago from hachyderm.io permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: files.mastodon.social
      Ben Cohen (@airspeedswift@mastodon.social)
      from Ben Cohen
      Attached: 1 image Now I'm fully aware that there are plenty of people who still believe this code is better than Swift. But at this point I think they're a tiny minority. This screenshot demonstrates to me the fundamental core of why Swift strives to be a low-ceremony language. Not because all the ceremony shown here is a hassle remember or type, though it is. It's that the ceremony drowns out the core of what the code is trying to express: the business logic that is the actually important part.
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 02:11:39 JST Paul Cantrell Paul Cantrell
      in reply to
      • Don Whiteside

      @donw
      My own “decades of programming” conclusion kind of goes the opposite direction: I know that my opinion on an unfamiliar thing will almost certainly change if I actually use it extensively (as it did with implicit returns, among other things), and so whether I like it or not is not particularly useful information.

      In conversation about 4 months ago permalink
    • Embed this notice
      Don Whiteside (donw@mastodon.coffee)'s status on Sunday, 12-Jan-2025 02:11:40 JST Don Whiteside Don Whiteside
      in reply to

      @inthehands One of the pleasures of being a programmer in my 50s is that I no longer feel the need to pretend I hate things - say, implicit returns - for anything like any objective reason. I just don’t like it! Not only won’t I argue with you about it, I don’t care if you agree or not.

      Imma start a new religion that revolves around the phrase “it’s not for me.”

      In conversation about 4 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 03:21:59 JST Paul Cantrell Paul Cantrell
      in reply to
      • Ben Cohen

      @airspeedswift
      This kept kicking around in my head, so just for amusement, I wrote out the equivalent Swift, trying to stay as close to the original (no refactoring) while being idiomatically Swifty. (Caveat: untested code.) Original Objective-C is in the second screenshot for comparison.

      An interesting detail surfaces…

      In conversation about 4 months ago permalink

      Attachments


      1. https://media.hachyderm.io/media_attachments/files/113/811/109/660/543/744/original/cf655ce1a95f1c06.png

      2. https://media.hachyderm.io/media_attachments/files/113/811/109/747/494/256/original/47c9f352f70090b4.jpeg

    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 03:22:35 JST Paul Cantrell Paul Cantrell
      in reply to

      Swift makes at leats one thing •more• explicit: what do hasSupplementaryViewAfter/Before do if there is no element with the “cell” category?

      In Obj-C, indexOfObjectPassingTest returns NSNotFound, which happens to be max int (not -1!), so After •always• returns false and Before accepts •any• supplemental view.

      Is that accidental behavior? Who knows!! In Swift, index returns an optional Int, forcing the choice to use Int.max to be explicit.

      What should be implicit? It’s a huge question. Choose wisely.

      In conversation about 4 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: www.ok.is
        OK - Við elskum tölvukerfi
        Nýttu kraftinn með HP gervigreind HP EliteBook með nýrri tegund Intel Ultra örgjörva sem bestar frammistöðu tölvunnar hverju sinni, án þess að draga úr afköstum Skoða nánar Við elskum tölvukerfi Afritun Við afritum gögn og getum endurheimt stórar sýndarvélar á fáum sekúndum. Við gerum afritunaráætlun í samræmi við þínar kröfur Stafrænt faðmlag Þjónustuleið sem, með […]
    • Embed this notice
      Chandler Carruth (chandlerc@hachyderm.io)'s status on Sunday, 12-Jan-2025 03:29:12 JST Chandler Carruth Chandler Carruth
      in reply to
      • Ben Cohen

      @inthehands @airspeedswift

      Kate Gregory gave one of my favorite talks about this that has influenced how I like to think about the tradeoffs between explicit and implicit syntax: https://youtu.be/-Hb-9TUyjoo?si=tToVr-ZKBolLLh3P

      In conversation about 4 months ago permalink

      Attachments

      1. What Do We Mean When We Say Nothing At All? - Kate Gregory [ACCU 2019]
        from ACCU Conference
        #Cpp #ACCU #ACCUConfThey say silence can speak volumes. In a C++ application there are many places where not using a keyword or a piece of punctuation is a d...
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 03:34:38 JST Paul Cantrell Paul Cantrell
      in reply to
      • Ben Cohen
      • ((Jann Gobble)) 🏳️‍🌈

      @jgobble @airspeedswift
      har har

      In conversation about 4 months ago permalink
    • Embed this notice
      ((Jann Gobble)) 🏳️‍🌈 (jgobble@mastodon.social)'s status on Sunday, 12-Jan-2025 03:34:39 JST ((Jann Gobble)) 🏳️‍🌈 ((Jann Gobble)) 🏳️‍🌈
      in reply to
      • Ben Cohen

      @inthehands @airspeedswift I like Objective-C better. More descriptive. Tells you what you are sending and receiving! 😉

      In conversation about 4 months ago permalink
    • Embed this notice
      tinydoctor (tinydoctor@mstdn.social)'s status on Sunday, 12-Jan-2025 03:34:46 JST tinydoctor tinydoctor
      in reply to
      • Ben Cohen

      @inthehands @airspeedswift For a second there I thought you were talking about Jonathan Swift. His 'Modest Proposal' seems pertinent to our current situation. Sorry, my mind jumps like a jack in the box.

      In conversation about 4 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 04:50:41 JST Paul Cantrell Paul Cantrell
      in reply to
      • Ben Cohen
      • Chandler Carruth

      @chandlerc @airspeedswift Looks promising at a glance! In the beginning, some of the same thoughts as here:
      https://hachyderm.io/@inthehands/113679908310539599

      …and I like where the speaker is going about the importance of empty space. Thanks for sharing.

      In conversation about 4 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: media.hachyderm.io
        Paul Cantrell (@inthehands@hachyderm.io)
        from Paul Cantrell
        Attached: 1 image @deirdresm @dch@bsd.network @vkc@linuxmom.net We think alike! That’s almost exactly the thought I use on the first day of my Programming Languages class to frame the course:
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Sunday, 12-Jan-2025 04:55:49 JST Paul Cantrell Paul Cantrell
      in reply to
      • Aaron Turon ?
      • Ben Cohen
      • Chris Krycho

      @chriskrycho @aturon @airspeedswift
      That’s a good phrase, and a writeup full of good thoughts.

      One thing the writeup elides too much for my taste is the cost of ubiquitout repetition. Some features are powerful and context-dependent in the writeup’s rubric, but also so common and normal that making them explicit makes them repeated •everywhere•.

      There’s cost to that. Ben quoted me on that here: https://mastodon.social/@airspeedswift/113811104413706720 …and I stand by that, and agree wholeheartedly with his further assertion. Repetition creates noise. Noise is the opposite of communication. That needs to be part of the equation too.

      In conversation about 4 months ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Ben Cohen (@airspeedswift@mastodon.social)
        from Ben Cohen
        Evolution can go the other way too. The `any` keyword for existentials for example (hopefully as a step towards swapping `any` and `some` to give us `var body: View`). But attempts to add back in ceremony in pursuit of clarity are usually heading in the wrong direction. Take the proposal to require explicit self on member access. The rejection quotes @inthehands@hachyderm.io: "anything that is widely repeated becomes invisible” I would go further though. Anything repeated gets in the way, reduces clarity.
    • Embed this notice
      Chris Krycho (chriskrycho@mastodon.social)'s status on Sunday, 12-Jan-2025 04:55:50 JST Chris Krycho Chris Krycho
      in reply to
      • Aaron Turon ?
      • Ben Cohen

      @inthehands @airspeedswift There was a great summary of the “explicit/implicit” dynamics from @aturon when discussing “ergonomics”-focused changes to Rust back in 2017: https://blog.rust-lang.org/2017/03/02/lang-ergonomics.html#implicit-vs-explicit

      He points out there, and I think this is key, that we actually mostly want to be explicit about *the things in the domain we actively care about*, and implicit about everything else. The challenge for language design (and API design generally) is that “what domain do I care about?” is very dynamic!

      In conversation about 4 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: www.rust-lang.org
        Rust's language ergonomics initiative | Rust Blog
        from @rustlang
        Empowering everyone to build reliable and efficient software.
    • Embed this notice
      Chris Krycho (chriskrycho@mastodon.social)'s status on Sunday, 12-Jan-2025 04:55:50 JST Chris Krycho Chris Krycho
      in reply to
      • Aaron Turon ?
      • Ben Cohen

      @aturon’s (re)framing was the phrase “reasoning footprint”, which has not caught on as widely as I wish it had, because I think it gets at this nicely! @inthehands @airspeedswift

      In conversation about 4 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Monday, 13-Jan-2025 07:15:51 JST Paul Cantrell Paul Cantrell
      in reply to
      • Ben Cohen

      There’s a thoughtful new post on the above from @airspeedswift in the Swift Evolution forums:
      https://forums.swift.org/t/pitch-last-expression-as-return-value/76958/364

      In conversation about 4 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: global.discourse-cdn.com
        [Pitch] Last expression as return value
        Attention conservation notice: long post, sorry. I want to take a step back for a moment and talk about a more general principle that's behind this and many evolution proposals, which is the pursuit of an overarching goal of Swift as a low-ceremony language. As a way to illustrate this I want to use a very short snippet of Objective-C (which was recently posted by @Dimillian on Blue Sky). - (BOOL)hasSupplementaryViewAfter { NSInteger cellIndex = [self.elements indexOfObjectPassingTest:^BOOL(...

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.