Re:Generating a Java program with 90% less code
by treve on Wednesday December 04, 2019 @12:30PM
(#21704412)
Edge cases exist. I'd assume that Java and c# will also have edge-cases when things like reflection come into play.
[ Parent
| on HN ]
Re:Generating a Java program with 90% less code
by Filligree on Wednesday December 04, 2019 @12:45PM
(#21704649)
Certainly, but reflection is almost never used. I don't think I've touched a single real-life codebase where it would get in the way in this manner.
The same can't be said for languages like JS.
Re:Generating a Java program with 90% less code
by smhinsey on Wednesday December 04, 2019 @01:32PM
(#21705315)
Even reflection is going to vary based on your IDE. If you use ReSharper or Rider, a safe rename refactoring will locate and optionally update string references as well. I don't know if VS itself has adopted this feature.
Re:Generating a Java program with 90% less code
by Filligree on Friday December 06, 2019 @11:23AM
(#21723206)
IDEA does the same thing. It's amazingly useful, even if you don't use reflection -- variable names end up in comments and documentation as well, all of which it will offer to change.
Re:Generating a Java program with 90% less code
by ken on Thursday December 05, 2019 @10:00AM
(#21712784)
I’ve never touched a “real life” code base in a static language (including C#) where this wouldn’t be an issue. C# is not a sufficiently high level language that I can avoid duplication without the use of reflection.
Re:Generating a Java program with 90% less code
by dehrmann on Friday December 06, 2019 @12:18AM
(#21719453)
People try to avoid reflection like the plague, most use cases don't depend on a hard-coded method/class name, and the ones that do can sometimes be detected by tools. It's pretty rare to run into this, and the one of two times I did something horrible like this, I wrote a test for it and made if fail loudly because what I was doing was brittle (by Java standards) and unexpected.