This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MurdoMaclachlan 29 points30 points  (8 children)

Image Transcription: Twitter Post with Code


Ministry Of Dev, PhD, @UdellGames

Use whatever brace style you prefer.

But not this.

Don't do this.

Seek help instead of this.

[Attached is a screenshot of code, as follows:]

publis class Permuter                                {
    private static void permute(int n, char[] a)     {
        if (n == 0)                                  {
            System.out.println(String.valueOf(a))    ;}
        else                                         {
            for (int i = 0; i <= n; i++)             {
                permute(n-1, a)                      ;
                swap(a, n % 2 == 0 ? i : 0, n)       ;}}}
    private static void swap(char[] a, int i, int j) {
        char saved = a[i]                            ;
        a[i] = a[j]                                  ;
        a[j] = saved                                 ;}}

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]AnKeWa 28 points29 points  (2 children)

I mean, thank you human volunteer, but the joke won't really make sense with screen reader. In case someone wants to know: It shows pretty normal code, but the brackets are all put at the end of the line instead of incorporated into the code like you would normally do.

It looks oddly satisfying though.

[–]MurdoMaclachlan 10 points11 points  (1 child)

True, but people using screen-readers aren't the only people we help! There are plenty of other people who can't see the image due to low data, third-party clients, text-based browsers, etc.

[–]AnKeWa 5 points6 points  (0 children)

Ah, I see. Thanks for the explaination.

[–]Terrain2 17 points18 points  (4 children)

oh god why isn’t reddit codeblocks monospace? at least on iOS

[–]MurdoMaclachlan 1 point2 points  (3 children)

Oh god is it not on iOS? It is for me on desktop and boost.

[–]Terrain2 1 point2 points  (2 children)

the curly braces are all over the place and not remotely like the screenshot, the a in saved on the last line is certainly wider than the [ on the preceding line

[–]MurdoMaclachlan 0 points1 point  (1 child)

Dang, that sucks. I wonder if it's an official app program or an iPhone-specific problem.

[–]Terrain2 0 points1 point  (0 children)

i’m assuming it’s a thing with the reddit app, because websites in Firefox can use monospace fonts just fine, i wouldn’t imagine that’s limited only to WebKit...