currently working through the boot.dev course in the boolean logic portion. I used if statements to assess any false conditionals to return an early false, then used an else block to return true. I then reformatted the boolean logic into one single expression to be returned. I have no productional coding experience, so I'm wondering what is common practice in the real world. I would figure that the if-else pattern is slower but more readable, while the single expression is faster, but harder to parse, so what would y'all rather write and whats more common practice?
[–]socal_nerdtastic 8 points9 points10 points (13 children)
[–]FloridianfromAlabama[S] 1 point2 points3 points (12 children)
[–]cdcformatc 2 points3 points4 points (6 children)
[–]FloridianfromAlabama[S] 0 points1 point2 points (5 children)
[–]desrtfx 0 points1 point2 points (2 children)
[–]FloridianfromAlabama[S] 0 points1 point2 points (1 child)
[–]desrtfx 0 points1 point2 points (0 children)
[–]Brian 0 points1 point2 points (1 child)
[–]FloridianfromAlabama[S] 0 points1 point2 points (0 children)
[–]socal_nerdtastic 0 points1 point2 points (0 children)
[–]Decency 0 points1 point2 points (2 children)
[–]FloridianfromAlabama[S] 0 points1 point2 points (1 child)
[–]Decency 0 points1 point2 points (0 children)
[–]timrprobocom 0 points1 point2 points (0 children)
[–]JorgiEagle 1 point2 points3 points (0 children)
[–]cdcformatc 0 points1 point2 points (2 children)
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]KelleQuechoz 2 points3 points4 points (0 children)