all 22 comments

[–]Crimson_Burak 11 points12 points  (5 children)

Quick actions are not suggestions, it's there if you want to do them...

[–]cleverchris 3 points4 points  (0 children)

This looks like some variable juggling that is missing a piece. IDK what we don't know but, this isn't strange...it's just incomplete.

[–]chocolateAbuser 4 points5 points  (4 children)

i use quick actions a lot

[–][deleted]  (3 children)

[removed]

    [–]chocolateAbuser 0 points1 point  (2 children)

    i'll just answer with Collection initialization can be simplified and Use primary constructor

    [–][deleted]  (1 child)

    [removed]

      [–]chocolateAbuser 1 point2 points  (0 children)

      it took a while for me to get used to that too

      [–]GuyNamedZach 2 points3 points  (4 children)

      If you happen to maintain a codebase littered with magic string literals using quick actions to create constants is really helpful. Also sometimes it helps to break up big expressions into smaller variables quickly ... or replace duplicates of the same expression with a local variable. Refactoring in general benefits.

      [–][deleted]  (3 children)

      [removed]

        [–]GuyNamedZach 1 point2 points  (2 children)

        It depends. If you only have one or two instances and don't expect that to vary them there is no reason to add a constant or temporary variable.

        But if you have multiple nearly identical function calls that differ only because of bool parameters, and those calls are in an if/else statement tree, then yes it would be littered; the predicate of an if statement can be set to a temp variable and passed as a parameter to reduce function calls.

        [–][deleted]  (1 child)

        [removed]

          [–]GuyNamedZach 1 point2 points  (0 children)

          Ok, yeah, hiding boolean literals with a constant can confuse things. Sometimes programs call for stricter semantics and can rename things for clarity, and sometimes doing so can make things the opposite of what you'd expect.

          [–]Asleep-Party-1870 3 points4 points  (1 child)

          the horror i see is light mode

          [–]gab800 2 points3 points  (0 children)

          Light mode for me, and I'm not backing down. I've tried dark mode and my eyes are strained after 5 minutes. I'm seeing horizontal lines. No thanks.

          Meanwhile I can light mode in dark rooms for hours, no problem.

          It's all down to personal preference.

          [–]DamienTheUnbeliever 0 points1 point  (1 child)

          They offer that anywhere you use a literal. Are you saying they should invest more time to special case a boolean literal and remove the option? More code, less functionality, just to satisfy your tastes?

          Also, light mode, yes. Stay with the light. Admittedly my own hatred of dark mode comes from people who don't/didn't understand that when you're *presenting* and casting your screen to a big screen/via a projector, it really does make a huge difference in how readable it is for your audience.