News for hackers. Stuff that matters.
Re:PostgresJs: The Fastest full featured PostgreSQL client f... by sgarland on Saturday October 14, 2023 @11:22AM (#37881185)
It’s the giant nested ternaries that kill me. In nearly all circumstances I can think of (Terraform being a notable exception), ternaries could be replaced with an if/else if block and be far more readable.

In my head I’m having to cast these to an if to figure it out anyway - why not just write it like that to begin with?

Re:PostgresJs: The Fastest full featured PostgreSQL client f... by porsager on Saturday October 14, 2023 @11:30AM (#37881261)
It's all about familiarity. To me ternaries gives me less ways in which the code can behave, so it takes less time to write, and less time to read. The obvious reason is that it's an expression and not a statement. So, the reason for me not writing it like this to begin with, is because I prefer ternaries over ifs. So much that i sometimes rewrite other code from ifs to ternaries to better grasp it. But that's me.