paint-brush
Four reasons to use nudge4jby@yolpogists
971 reads
971 reads

Four reasons to use nudge4j

by yolposFebruary 22nd, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://lorenzoongithub.github.io/nudge4j/" target="_blank">nudge4j</a> is a piece of java code to let you hack your JVM from the browser.

Company Mentioned

Mention Thumbnail
featured image - Four reasons to use nudge4j
yolpos HackerNoon profile picture

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.