Looking at them all, I don't hate whitesmiths. Keeps all the associated block on one line which makes it a bit easier to parse
196
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
Allman or even horstmann I could still deal with, the rest would be difficult.
Though none are as bad as whoever came up with right aligning all the brackets to make any code look like python until you spot the deranged line of brackets on the right…
I cannot for the life of me find it now but the dude put it on GitHub
Why would a development environment show you code in a different style from what you like? It's a simple conversion.
Why would your IDE show you code in a language other than you prefer? It's just a conversion.
Even my web browser shows any text in languages I can read, but for some reason it doesn't let me edit a document through the translation.
I use Allman for control statements and K&R for declarations
That's why Python has a superior syntax. There is usually one obvious way to do it, and that's the right way.
If prefer two spaces per indention instead of tabs, but otherwise I agree with the choice of style.
Tabs has no place in code, just recently I started a project with four space indentation, that quickly got changed to two.
Change your tab width, but tabs are literally made for indentation.
The reason I loathe tabs is that over time a codebase with tabs becomes mixed tabs and spaces and unless your editor shows tabs you can't see them.
In the end you have to choose either spaces or tabs, and enforce it with some lint tool.
That last line is the solution though, choose a linter, enforce all style arguments, so they are just the way the code is. No arguments.
Every single project I work on is setup with prettier. With Java there is a maven plugin that runs it on compile. And with ts projects it is part of the built pipeline.
I wish I could use prettier for Abap, reminds me how much I like having an opinionated formatter. I don’t like wasting time formatting code manually.
Abap has one formatter that is not very opinionated, and lets way more to much wierd spacing through, especially for a language that is as verbose as abap.
I love compromises, so I use 3 spaces for indentation.
Some people just want to see the world burn 😁
It's warm and bright when everything burns.
Finally, someone understands that Allman is not that great, and that Kernighan & Ritchie is the way to go. Also, Haskell, my guy, you good? Lisp, are you ok? Do I need to call your parents?
Allman all the way baybeeee
Meh, it's what you get when you write a language in a different language's "style".
I've written Haskell quite a bit, and I don't fully understand why this is called Haskell style. Haskell code looks nothing like this, the syntax is completely different. For Haskell's syntax I think it works fine, because I never noticed something weird. But this code in "Haskell style" looks absolutely insane
It's sometimes called comma-leading style where you move all the special characters to the front of the line and it is exceedingly common in Haskell, possibly due to how Haskell treats significant whitespace. You've surely seen list definitions that look like this:
someList =
[ 1
, 2
, 3
]
or a data definition like this:
data Color
= Red
| Green
| Blue
| RGB Int Int Int
deriving (Show, Eq)
or a list of module exports like this:
module Foo
{ bar
, baz
, quux
}
Or in a long function type declaration where the arrows are moved to the start of the line, or a record definition, etc. etc.
Do I need to call your parens*
You should see how a Lisper writes in their native language
They are super extra not okay
People code like that????
People indent braces more than the line before and less than the line after?
Words cannot express my displeasure
idk, Allman is very readable. Easy to scan vertically to find the matching open brace. Not quite as vertically-space efficient as the best way, but it's not offensive.
In my first ever programming class textbook was using Allman. Probably for this reason, it is easy for a beginner to match braces. It is a lot loss common industry to my knowledge.
this is only true if you don’t indent properly
I literally don't understand. I've read your comment several times and I don't know what you're talking about. Sorry!
Did you think I was saying that made Allman better than the best way? Because it's easy to scan vertically the best way, too. It's just also easy with Allman, so it's not offensive.
Plus one for Allman gang
I might argue that rhe syntax of God's language is the one true syntax.
I am tired and unmotivated so I probably won't though.
Haskell, baby, what is you doing??
I might have to give this a try 😹
That's not Lisp...
(while (== x y)
(func1)
(func2)
)
What kind of monster writes lisp with the closing bracket on its own line.
Tell me you're a Java developer without telling me you're a Java developer.