Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@carboneum allow me to correct that
Why the fuck doesn't Java complain about that properly at runtime?! -
@RememberMe ? Why would it? it's a string.
Why doesn't Python complain about a typo in
msg = "Some message with application-specific syntax and a typo";
at runtime?
Should the PY compiler know that the string in that service representing a particular error message, shall not contain more than 6 words? -
@netikras yes but instead of a random index OOB exception it could at least tell you where stuff is breaking, print out the starting parse loc maybe, or something
-
I don't know about Java but string interpolation in other languages is a special syntax within a string literal and will produce a syntax error if done wrong.
Or maybe it will just fall back to a normal string literal. I really need to test it...
But I suppose that's what Java does. -
@Lensflare interpolation (at least in java) is not a java'as feature - it's managed by templating frameworks. The framework takes a string literal, interpolates it and returns a complete message. So unless an IDE is aware of that framework you're using and has a plugin for it to validate interpolation keys inside the string literals, you're working with just plain strings :)
Related Rants
-
linuxxx8Especially painful being a cybersecurity engineer; Did something wrong with an if-statement. Caused authent...
-
dder4Trying to exit a bash script with 'halt' on a friday afternoon ran w/ root on a internal prod-vm which I d...
-
RememberMe6When working with hardware some mistakes can be literally painful. Thankfully this was all during undergrad an...
Took me 6+ full days.
The feature does not work. Repro is unknown, so only prod is experiencing the issue.. Which rules out the debugger option. Sometimes there's an entry seen in logs: "java.lang.StringIndexOutOfBoundsException". Nothing more - just that. No stack, no class, no nothing. Is it my code that's buggy? Is it some config? Integration? Unexpected response...? A bug in a lib? Is dimm faulty ir maybe server's shared libs are off?
Turns out I used a closing parentheses instead a closing curly bracket in an error message that's supposed to be interpolated...
String message = "{some-business-rule-related-error-message-key)";
took me 6+ full days... But I found it. Took the rest of that Friday off to walk in a park and enjoy my life :)
rant
wk219