Do you ever 'need to go deeper?'

Of course, obligitory inception bwaa: BWWWWOMMMMMMMMMM!!!

With that out of the way, I need to ask:
Do you ever feel like java limits you? Do you ever need to go even lower level? Can you think of any times where someone needs to go deeper? I was wondering, since I read up on native methods, and thought about why you would need to go deeper. I mean, LWJGL has to go deeper (using OGL on the graphics card), right? Lastly, how would you ‘go deeper.’

GLOSSARY
‘need to go deeper’ - Inception reference. Here, it would mean going lower level, but still using java.

Just curious :slight_smile:

-wes

Assembly.

And no, I never feel the need.

There are also languages that don’t do as much for you as java, but are arguably a little more customizable. C comes to mind. I will say however that I started learning programming in C++ and rapidly switched to java as I find it easier to use… Though I admit, they’re really the only two languages I’ve touched.

I think Java can do much more than you’ve seen, its quite a capable language.

When I try to go deeper I get StackOverflowErrors.

Strange.

I usually get IndexOutOfBound exceptions…

Weird I get QuitOverUsingMemoryYouFool errors. Strange… :wink:

Go deeper. Use LWJGL.

Yeah, you don’t really have to work hard to go deeper in Java. We have all the power of C by just using a few wrappers. Going any deeper than C ends in assembly… so yeah. Java works and is good enough for me.

On the contrary, I sometimes feel, I am too deep and the things I do could have been abstracted a bit more.

In the past I wa using C++ and coded low level routines like graphics and texture mapping/shading myself. But nowadays hardware got so fast,the Hotpsot compiler got better, and there are good libraries available, so that Java has become quite sufficient for my needs.

I have a few legacy projects in C and C++ but I really don’t like that anymore.

Hello

No. Actually, that’s the opposite. Java is like my mother tongue in computer programming, other languages limit me even in term of readability, ecosystem and performance (for example Ada, C, C++, Ocaml, Esterel).

I need to go lower level only when implementing or fixing some features in JogAmp (JOGL, JOAL, JOCL, …) in its C code.

I’d like stack allocated instances and something similar to C struct arrays (without the overhead of MappedObject). Stack allocated instances allows you to write much nicer vector math code without creating a mountain of garbage. C-like struct arrays would allow you to get much better memory locality and is also useful for uploading vertex data to OpenGL. Those are the only two features I’m missing at the moment…

Native code is mostly needed to interface with native APIs or when you need to be closer to the metal for speed. You could see libgdx for an example. Eg, it uses native code for the Box2D wrapper. The native code is inline with Java code using a tool called gdx-jnigen, which is pretty damned neat. See JGLFW for more gdx-jnigen code. Another example is Matrix4 which uses native code for speed. This is mostly not an issue on the desktop though, where it is unlikely you’d need native code for speed unless doing something pretty specialized. Using gdx-jnigen is a waaaay nicer approach to writing native code. Not only is it inline with the relevant Java code, but the multi-platform build for is handled for you. Building is just running a Java main method and you’re done.

Different kind of answer: I’ve never had to do it (except for using libraries such as LWJGL for reasons already stated), but if I had to “go deeper” because after thinking long and hard about it I reason that it is the best way to go, I would do it.

Ever tried out functional programming? :wink:

No I would not. Java just runs. All the ‘deeper’ stuff is just a deployment nightmare.

Actually yes, I’ve used Haskell, took a bit of getting used to, to get the mindset right. In the end I decided that the imperative programming suits my thought patterns better. I might try again, just for beer&brezels.

Yes. It’s about changing the way you think. Learning functional programming is like learning programming from scratch again, it’s completely different. But now that I learned haskell I’ve found many problems to be solved in a more elegant way than in imperative programming :slight_smile:

Last time I remember I had to go “deeper” was when I was trying to find out the display rotation angle. My search eventually lead me to conclude that it was a bit of info that had been left out of the Java implementation, and could be reached by JNI… Which lead to C++, platform dependent code, learning the Windows / Linux way of finding that information, etc…

But it was a very specific case, and hardly critical.

My opinion on the matter is that if the tool/API/language you’re using makes you need to go “deeper” very often, then it’s probably not what you need to be using.

Yes, assembly.
I’ve messed with it, done some stuff with gdb and a C program to get a feel for the processor calls, and just confused myself. It’s interesting stuff and I really want to learn it, so yes I do want to go deeper (but I don’t feel like Java limits me), but I simply don’t have the time with all the activities in my life :confused: