Ok, so currently in my Java course on Udemy we are going more in-depth into scope and visibility, and I'm currently doing the challenge for it.

So I'm doing it and the challenge is to have every single name of a variable or method be called 'x' (just to better understand scope and vis, he mentions how this is not a good practice AT ALL) with the exceptions of the classes and scanner var (but there is an optional challenge to also make them named x).

Now that I progressed into it, I noticed something. This challenge is literally making me make my code so DRY and outside-the-box-thinking that, what if, this could be a practice?

Not the naming everything in your code the same var name, but doing that at the start and then renaming the variables after coding. Because right now, I feel as though I am using SO MUCH less code than if I had the liberty of naming my classes, methods, and variables different things, it's actually kinda cool.

I'll attach my code from the challenge to this after by it really amazed me how well my code looked compared to my previous challenges and even personal projects!

  • 0

    I really like this little 'practice' and I MAY implement it to my other projects. OBVIOUSLY, the code needs some rework such as renaming the classes, methods, and variables, in addition to just making it generally cleaner.
Add Comment