Sometimes I write some code with more brackets than I like.
if(!(new Day((((new Date()) / millisecondsPerDay) % 75)) instanceof oldDay))) {
It’s hard to keep track of how many brackets I need to put, especially when I don’t use the IDE, which immediately tells me when something is wrong. In fact, I'm sure the above example does not match the brackets correctly. I was tied to death errors with brackets more than I would admit.
I was wondering if there is a way around this. What methods can I use to avoid wrapping things with so many parentheses?
Are there any languages with a mechanism that prevents the need for so many parentheses? For example, I thought about adding special characters that can help automatic closed parentheses, and automatically open them. ( < and > in the following example)
if(!(new Day<new Date()) / millisecondsPerDay) % 75> instanceof oldDay>
source share