DEV Community

Discussion on: Why I'm phasing out ternary statements

riccardomessineo profile image
Riccardo Messineo

If your Junior, I would suggest you to focus on readability. Above all.
We live in "Giga" times where in 99% of contexts it doesn't matter if you use a byte more or less (or a digest cycle, or a MB in RAM, or whatever).
For sake of clarity, I'm not saying to waste resources, but in general give more importance to readability (fewer bugs, quicker refactoring, more code reusability, and so on...).

To satisfy your genuine curiosity... this sort of instructions are both written in "high level" code that somehow will be translated in "low level" code.
I think (not sure) that they'll be translated in the same low-level instructions and have the same performances.

mcgurkadam profile image
Adam McGurk Author

Yeah, the perf test I showed up top showed not much of a difference between the two!