Import static and performance

Started by Enk, July 31, 2009, 10:19:24

Previous topic - Next topic

Enk

Hi

This may seem like an odd question, but are there any performance issues regarding importing the LWJGL-classes static?

I've seen a lot of tutorials/example-code but haven't seen any using import static.

I've used it in my application and find it much easier to just write glBegin(GL_QUADS) instead of GL11.glBegin(GL11.GL_QUADS). Especially since I'm used to OpenGL in C++.


So are there any extreme negative consequences of this, or are people just unaware of the possibility to import static?

spasi

Static import is just syntactic sugar, writing a static-imported glBegin(GL_QUADS) is exactly the same as writing GL11.glBegin(GL11.GL_QUADS).

Enk

Ok, strange that more people aren't sugar-hungry then ;)

Fool Running

Probably most of the tutorials/examples were written either before java 1.5 (or 5 :P) came out or they were written so that someone with 1.4 could still use it without any trouble.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D