Four reasons to use nudge4j

yolpos
HackerNoon.com
3 min readMar 5, 2017

--

nudge4j is a piece of java code to let you hack your JVM from the browser.

There are many valid reasons to use it during development, and one, for sure, it’s because it’s fun.

But there are others.

Reason №1 — A teacher’s tool

Use nudge4j as an expression evaluator to explain your son / daughter / friend / colleague how a given class works.

Reason №2 — Demo your Java library.

Say you have written a Java library or API. Then write a snippet of code in nudge4j to see it in action. Better than that, invite your colleague at your desk and ask him or her to suggest changes and try things out, on the fly. No need to recompile any demo code, simply play from the browser.

Reason №3 — Smoke test (a.k.a one more sanity check).

Aside from your existing unit tests, regression tests, integration tests, … you can keep a snippet of nudge4j code to exercise some of the key functionality, maybe before pushing for the final release.

If it works, great. If it fails, you can hack your way because you are already in the JVM.

Reason №4 — It’s even more powerful than you thought

If you read 1, 2 and 3 you know that nudge4j can interact with any java object through its public API. But what if you want to get deeper than that ? What if you want to access private fields of an object ? It turns out that with a bit of ‘reflection’ you can easily get there. Sometimes you might not need to turn to a debugger after all.

Conclusions

Here we go, I gave you four reasons to use nudge4j that I thought of on a tube journey that ended up being longer than usual. Let me know if you can think of more.

Thanks for reading this.

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!

--

--