Trop fort le mec. J’espère que je peux avoir une moitié de sa connaissance. I hope I could have 1/2 of his knowledge.
Very interesting reading. For anyone who love Java.
Writing Better Code: A Conversation With Sun Microsystems Technology Evangelist Brian Goetz

Wrong Intuitions About Performance Problems
We’re intimately familiar with the code that we write. The external services that we depend on, whether libraries or external agents, such as databases and web services, are out of sight and out of mind. So when we see a performance problem, we tend to think about places in our code that we can imagine being performance problems. But often, that’s not the source of the performance problem — it’s somewhere else in the application’s architecture.

“Write Dumb Code”
Often, the way to write fast code in Java applications is to write dumb code — code that is straightforward, clean, and follows the most obvious object-oriented principles. This has to do with the nature of dynamic compilers, which are big pattern-matching engines. Because compilers are written by humans who have schedules and time budgets, the compiler developers focus their efforts on the most common code patterns, because that’s where they get the most leverage. So if you write code using straightforward object-oriented principles, you’ll get better compiler optimization than if you write gnarly, hacked-up, bit-banging code that looks really clever but that the compiler can’t optimize effectively.

Moving From C to Java Programming
The Java language is not just a syntax: There’s a design philosophy that goes with managed languages. To get the benefit of Java programming, you have to understand that you are not just programming in C with a different syntax.

Advice for Beginners: Learn the Class Libraries
because they can make you more productive and make your programs smaller, more reliable, and easier to read and maintain.

Java SE 6 – JSR 223: Scripting Integration
You can call back and forth between JavaScript and Java applications and use the Java class libraries in JavaScript. JSR 223 offers a very nice integration between the Java environments and PHP, Ruby, JavaScript, or whatever your favorite scripting language is.

Because of the tight integration, developers are no longer forced into an either-or choice. They don’t have to choose between writing in the Java language or in, say, Python. By making it so easy to call back and forth between Java code and scripting code, you get the best of both worlds. You can develop most of an application in Java code and develop pieces in Python, which may enhance productivity because you can use the right tool at the right point.

It also opens the door to a new generation of extensible applications that allow us to ship applications that have extension points that call out to scripts. So instead of customizing applications by configuring some horrible XML configuration file, which is often underdocumented and hard to do, we’ll configure and customize applications by running scripts when needed. We’ll insert behavior into these applications as opposed to controlling whatever options the environment gives us.

Applications will be more extensible, easier to customize, and easier for developers to deliver, because we won’t have to anticipate everything that every customer might want to do with an application. We can simply provide them with an extension mechanism.

Advertisements