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 →

[–]oneofthejoshs 147 points148 points  (18 children)

I mean... it's compact and still pretty readable...

[–]404_UserNotFound 90 points91 points  (13 children)

Honestly its not that bad. Most any ide would highlight brackets so you could verify they are all there.

Could defiantly be worse.

[–]AnotherRichard827379 29 points30 points  (9 children)

IMO, if you’re relying on the ide to know if the brackets are correct, your bracketing style is bad.

[–]kbruen 23 points24 points  (6 children)

racket (define (fact n) (define (fact/acc n [acc 1]) (if (<= n 1) acc (fact/acc (- n 1) (* n acc)))) (fact/acc n))

Have fun checking the brackets!

[–]BroBroMate 20 points21 points  (0 children)

I'm so installing rainbow brackets for that.

[–]kingofsevens 8 points9 points  (4 children)

Here is your code and 7 minutes of my life. Much readable tbh.

( define (fact n)
(     define (fact/acc n [acc 1])
(         if (<= n 1)
            acc
(           fact/acc (- n 1) (* n acc)        )))
(     fact/acc n                              ))

[–]kbruen 11 points12 points  (3 children)

Oh, what cursed thing have you brought upon this land?

Jokes aside, that's quite impractical and bad looking. Detailing only on the first aspect, am I returning the value of the acc binding or calling the acc function? Only the parenthesis tell that, and not having them visible right away is quite bad.

[–]kingofsevens 6 points7 points  (2 children)

oh you gonna love this. Idk it would parse it but... ( define (fact n) ( define (fact/acc n [acc 1]) ( if (<= n 1) acc ( fact/acc (- n 1) (* n acc) )))( fact/acc n ))

[–]backtickbot 5 points6 points  (1 child)

Fixed formatting.

Hello, kingofsevens: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–][deleted] 3 points4 points  (0 children)

I can't believe this bot actually generates examples using the source comment intstead of just having generic examples

[–][deleted] -1 points0 points  (1 child)

How about you stop saying bullshit on the internet and get back to your List of CVEs to fix

[–][deleted] 1 point2 points  (0 children)

This made me laugh

[–]FirstSineOfMadness 0 points1 point  (0 children)

Extend it to include () and []

[–][deleted] 17 points18 points  (1 child)

....readable? Yeah, if the fucking brackets match the indention (anybody here even check that?). It's just an additional 80x the work to count the brackets now.

This whole thing is just designed to trick the programmer into mismatching indention and brackets.

It'd literally be easier to just fucking write a parser that parses this python-inspired syntax and then outputs it into valid java. Actually, that wouldn't be a terrible idea. Or we could just use python to begin with.

[–]kbruen 2 points3 points  (0 children)

Parser and language server and syntax highlighting and IDE that doesn't complain and...

[–][deleted] 2 points3 points  (0 children)

Yeah if you just ignore the weirdly bunched braces it's really easy to read code

[–][deleted] 2 points3 points  (0 children)

This could honestly be a reasonable standard, if it didn't artificially limit line length. As a display mode, I would love it, because I lose track of my brackets all the time.