Level-up your Java Debugging Skills with on-demand Debugging
mostlynerdless.de
mostlynerdless.de
Using "Run to cursor" is my favorite less known feature in debugging, it's really useful.
I have lost hope for DCEVM being upstreamed to allow structural changes to the class :-(
Also with 'Java on Truffle' on GraalVM you can use enhanced class reloading https://www.graalvm.org/latest/reference-manual/java-on-truf...
I think hot code reloading did not look that good in a very long time.
And I'll be straight: Graal scares me 'cause Oracle but I just checked and it looks to the casual observer that it's straight-up GPLv2 now so maybe my fears need revisiting: https://github.com/oracle/graal/blob/vm-23.1.0/LICENSE
For example, if an exception is being logged in some random location (but poorly) I can throw a breakpoint on the log message, pop up several stack frames, look at the inputs into those frames (what are all the local variables) and replay down to whatever level I want or what other breakpoint I want to hit.
The only catch is if your functions are mutating input data (or some shared state somewhere), then you could be looking at different executions from one stack to the next.
One more reason to prefer pure functions over side-effects.
[0] https://www.jetbrains.com/help/idea/using-breakpoints.html#s...
[1] https://www.jetbrains.com/help/idea/using-breakpoints.html#l...
I do not prefer IntelliJ (I want a Hilux as my car and NetBeans for IDE) but credit where credit is due.
- Pause button (onjcmd=y)
- Java Exception Breakpoints with caught/uncaught option (onthrow/onuncaught)
Disclaimer: I am the founder at unlogged.
Or, I guess put another way, since it's cited as GPLv3 to which address should one send a request for the source code?
will fix the link on the plugin page, thanks for noticing it.
Sure, it is not a problem as long as you are aware of it.
> but is anyone using Java for new projects these days?
I work with large financial companies, think banks, brokerage houses, payments, etc.
Pretty much every large company in finances runs on Java and most new projects are in Java.
Java is uniquely suitable for this. I spent a lot of time thinking why is this. I think it is a combination of Java being relatively poor, handicapped language suitable for mediocre programmers not able to do much more than copy/paste. I love Common Lisp or Clojure but I quickly found using any powerful language with a software development team at a large bank must lead to a disaster. With Java, that disaster if it happens is limited a bit because there is less abstractions you can shoot your foot with.
Huge amount of boilerplate code means all projects look pretty much the same and every developer finds himself/herself right at home in a new project. If you know one Spring REST API you know pretty much all of them. Which is hugely important if your developers are barely able to learn new things.
Aside of the above, Java gained popularity due to its virtual machine, garbage collection, object orientation and pretty good standard library and ease of adding more dependencies to the project. Right now it is self sustaining situation because the amount of dependencies that are available, amount of software written and the fact that all those financial institutions have to maintain Java teams means, that it is almost always cheaper to hire more Java devs than try to use other languages.
Some companies have a lot of tooling made for and internal frameworks built in Java. It would be a lot of effort to rewrite all of that in another language, and also a lot of effort to just forego all these goodies and implement them myself. In the end I'm getting paid to ship a product.
Sure, Java is not "cool", and new devs fresh out of university might prefer something else, but let's not forget that modern Java is nothing like the Java that a lot of people used a while back. Most of the criticism we heard ("boilerplate") is not really valid anymore.
If you don't know anything about a large company and have a meeting with someone in IT there, it's a safe bet that boning up on Spring Boot before the meeting will be beneficial.
Also, if a new system has to connect to a legacy system using SOAP there are about 2 languages with a complete and interoperable implementation: Java and .NET. There are lots of toy libraries for other languages but I've never found one fully supporting the entire WS-* standard set.
It's not trendy, but that alone is not enough to overcome the advantages of choosing the fleet standard in a company that already has a substantial investment in Java.
There are of course smaller Java frameworks that you can use if you have made an honest try and dont like Spring, but the eco system is hard to beat. Go also does not have any benefits that are of any real value to me. I have admittedly not tried Elixir, but it seems to me that the mature eco system around Java is better for someone like me who is not interested in spending time on less mature 3rd party dependencies. I like the concept behind Phoenix Liveview, so I will try it sometime.
Java as a language has improved a lot recently, and while there it could be better at handling nulls, it's not enough to make me choose Kotlin.
If you had told me I would have Java+Spring Boot as my first choice 10 years ago, I would have doubted you. Java at the time seemed to stagnate, but this has changed .
C# is a close second. It depends on what the customer knows.
TypeScript third. But first for frontend.
Kotlin could have been on the list. It is a nice language but not worth the hassle (tied to one ide, extra configuration, examples that doesn't work etc).
I want to learn Clojure, and I'd be interested to try modern PHP again.
Every other language I will only recommend if people already use them and know them.
I have used Javascript, Python, Perl and VB (and used to prefer them over Java) but as I get older anf Java gets better I wouldn't waste my time on any of them except Perl, and only because I haven't used it in the last 15 years.