Latest TIOBE index shows Java in decline

Jan

Who's the Boss?
Staff member
Joined
May 24, 2010
Messages
14,778
Reaction score
13,421
Location
The Rabbit Hole
Most popular programming languages — with a big tumble for Java

TIOBE has published its latest Programming Community Index, which ranks the most popular programming languages based on data from the Internet.

To compile the index, TIOBE uses search engines and online services such as Google, Bing, Yahoo, Wikipedia, Amazon, YouTube and Baidu.
 
import java.io.IOException; public class KeyPressExample { public static void main(String[] args) { System.out.println("Press 'S' key to spit on grave:"); try { int input = System.in.read(); char pressedKey = (char) input; if (pressedKey == 'S' || pressedKey == 's') { System.out.println("Good riddance!"); } } catch (IOException e) { e.printStackTrace(); } } }
 
Amazingly, my top 3 are the top 3. 25+ years later, still the same. The 90's called, and they've got a new compiler for me.

 
Microsoft took the opposite approach with C# after previously only offering it as part of its commercial software Visual Studio.

False. C# compiler was always available as part of .NET Framework a free download for Windows users.

What happened is that MS started investing into .NET for other platforms, including Linux, as well as open sourcing large parts of its developer ecosystem.
 
import java.io.IOException; public class KeyPressExample { public static void main(String[] args) { System.out.println("Press 'S' key to spit on grave:"); try { int input = System.in.read(); char pressedKey = (char) input; if (pressedKey == 'S' || pressedKey == 's') { System.out.println("Good riddance!"); } } catch (IOException e) { e.printStackTrace(); } } }
Geez what is that? You learn that in primary school? If you are using "main", then your messing around. Java wasn't made for hello world programming.

3%? Lol.
 
Geez what is that? You learn that in primary school? If you are using "main", then your messing around. Java wasn't made for hello world programming.

3%? Lol.
You are right!. I will write it in the way that the language creator intends for it to be written:
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class ObscureKeyPressExample { public static void main(String[] args) { KeyPressFactory keyPressFactory = new KeyPressFactory(); keyPressFactory.createKeyPressListener().startListening(); } } class KeyPressEvent { private char key; public KeyPressEvent(char key) { this.key = key; } public char getKey() { return key; } } interface KeyPressObserver { void handleKeyPressEvent(KeyPressEvent event); } class KeyPressBean { private KeyPressObserver observer; public void addObserver(KeyPressObserver observer) { this.observer = observer; } public void notifyObserver(char key) { observer.handleKeyPressEvent(new KeyPressEvent(key)); } } class KeyPressListener { private KeyPressBean keyPressBean = new KeyPressBean(); public void startListening() { keyPressBean.addObserver(event -> { char key = event.getKey(); if (key == 'S' || key == 's') { System.out.println("Good riddance!"); } }); Timer timer = new Timer(0, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // Simulate key press events, remove this in a real application keyPressBean.notifyObserver('S'); } }); timer.start(); } } class KeyPressFactory { public KeyPressListener createKeyPressListener() { return new KeyPressListener(); } }

Behold! The elegance, the cross platform compatibility, the readability. It is just too pure for brief mortals such as ourselves to ever really understand.
 
You are right!. I will write it in the way that the language creator intends for it to be written:
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class ObscureKeyPressExample { public static void main(String[] args) { KeyPressFactory keyPressFactory = new KeyPressFactory(); keyPressFactory.createKeyPressListener().startListening(); } } class KeyPressEvent { private char key; public KeyPressEvent(char key) { this.key = key; } public char getKey() { return key; } } interface KeyPressObserver { void handleKeyPressEvent(KeyPressEvent event); } class KeyPressBean { private KeyPressObserver observer; public void addObserver(KeyPressObserver observer) { this.observer = observer; } public void notifyObserver(char key) { observer.handleKeyPressEvent(new KeyPressEvent(key)); } } class KeyPressListener { private KeyPressBean keyPressBean = new KeyPressBean(); public void startListening() { keyPressBean.addObserver(event -> { char key = event.getKey(); if (key == 'S' || key == 's') { System.out.println("Good riddance!"); } }); Timer timer = new Timer(0, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // Simulate key press events, remove this in a real application keyPressBean.notifyObserver('S'); } }); timer.start(); } } class KeyPressFactory { public KeyPressListener createKeyPressListener() { return new KeyPressListener(); } }

Behold! The elegance, the cross platform compatibility, the readability. It is just too pure for brief mortals such as ourselves to ever really understand.
Amateur. Only one factory. I haven't seen any controller class. Where is the annotations? Where is your custom logging framework? Why are you not using reflection to facilitate dependency injection? Where are your reams and reams of meaningless unit tests? And you haven't seperated interface definitions from implementation for half your classes. You also missed the rest of the patterns from the Gang of Four.
 
Amateur. Only one factory. I haven't seen any controller class. Where is the annotations? Where is your custom logging framework? Why are you not using reflection to facilitate dependency injection? Where are your reams and reams of meaningless unit tests? And you haven't seperated interface definitions from implementation for half your classes. You also missed the rest of the patterns from the Gang of Four.
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import javax.swing.*; public class SuperObscureKeyPressExample { public static void main(String[] args) { try { // Use reflection to instantiate the controller and execute it Class<?> controllerClass = Class.forName("KeyPressController"); Constructor<?> controllerConstructor = controllerClass.getDeclaredConstructor(); Object controller = controllerConstructor.newInstance(); Field observerField = controllerClass.getDeclaredField("keyPressObserver"); KeyPressObserver observer = new ObscureKeyPressObserver(); observerField.set(controller, observer); controllerClass.getDeclaredMethod("startListening").invoke(controller); } catch (Exception e) { e.printStackTrace(); } } } class KeyPressEvent { private char key; public KeyPressEvent(char key) { this.key = key; } public char getKey() { return key; } } interface KeyPressObserver { void handleKeyPressEvent(KeyPressEvent event); } class ObscureKeyPressObserver implements KeyPressObserver { @Override public void handleKeyPressEvent(KeyPressEvent event) { char key = event.getKey(); CustomLogger.log("Good Riddance'!"); } } class KeyPressBean { private KeyPressObserver observer; public void addObserver(KeyPressObserver observer) { this.observer = observer; } public void notifyObserver(char key) { observer.handleKeyPressEvent(new KeyPressEvent(key)); } } class KeyPressListener { private KeyPressBean keyPressBean = new KeyPressBean(); public void startListening() { keyPressBean.addObserver(event -> { char key = event.getKey(); if (key == 'S' || key == 's') { CustomLogger.log("KeyPressListener: You pressed 'S'!"); } }); Timer timer = new Timer(0, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // Simulate key press events, remove this in a real application keyPressBean.notifyObserver('S'); } }); timer.start(); } } class KeyPressController { private KeyPressObserver keyPressObserver; public KeyPressController() { // Use reflection to inject the observer try { Class<?> observerClass = Class.forName("ObscureKeyPressObserver"); keyPressObserver = (KeyPressObserver) observerClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); } } public void startListening() { // Start listening for key presses KeyPressListener listener = new KeyPressListener(); listener.startListening(); } } class CustomLogger { public static void log(String message) { System.out.println(message); } }
 
You are right!. I will write it in the way that the language creator intends for it to be written:
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class ObscureKeyPressExample { public static void main(String[] args) { KeyPressFactory keyPressFactory = new KeyPressFactory(); keyPressFactory.createKeyPressListener().startListening(); } } class KeyPressEvent { private char key; public KeyPressEvent(char key) { this.key = key; } public char getKey() { return key; } } interface KeyPressObserver { void handleKeyPressEvent(KeyPressEvent event); } class KeyPressBean { private KeyPressObserver observer; public void addObserver(KeyPressObserver observer) { this.observer = observer; } public void notifyObserver(char key) { observer.handleKeyPressEvent(new KeyPressEvent(key)); } } class KeyPressListener { private KeyPressBean keyPressBean = new KeyPressBean(); public void startListening() { keyPressBean.addObserver(event -> { char key = event.getKey(); if (key == 'S' || key == 's') { System.out.println("Good riddance!"); } }); Timer timer = new Timer(0, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // Simulate key press events, remove this in a real application keyPressBean.notifyObserver('S'); } }); timer.start(); } } class KeyPressFactory { public KeyPressListener createKeyPressListener() { return new KeyPressListener(); } }

Behold! The elegance, the cross platform compatibility, the readability. It is just too pure for brief mortals such as ourselves to ever really understand.

You are as dense as the code that you write :)
Do you do hello world examples for a living?

import x.y.AbstractConsoleChatPlugin; public class ConsoleChat extends AbstractConsoleChatPlugin { public void onInput(String input){ if("exit".equalsIgnoreCase(input)){ consoleOut("Good bye"); } } public void onKeyPress(char key){ if(key == 'S') consoleOut("You pressed 'S'!"); } }

Your code is the kinda code that results in massive security holes in the end because you all gung-ho writing direct console string manipulation. And the fact that you write console type applications using Java shows no skill in selecting propper language for a solution. A bash script would have made much better sense.
 
Last edited:
You are as dense as the code that you write :)
Do you do hello world examples for a living?

import x.y.AbstractConsoleChatPlugin; public class ConsoleChat extends AbstractConsoleChatPlugin { public void onInput(String input){ if("exit".equalsIgnoreCase(input)){ consoleOut("Good bye"); } } public void onKeyPress(char key){ if(key == 'S') consoleOut("You pressed 'S'!"); } }

Your code is the kinda code that results in massive security holes in the end because you all gung-ho writing direct console string manipulation. And the fact that you write console type applications using Java shows no skill in selecting propper language for a solution. A bash script would have made much better sense.
But I thought Java is so secure?
 
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import javax.swing.*; public class SuperObscureKeyPressExample { public static void main(String[] args) { try { // Use reflection to instantiate the controller and execute it Class<?> controllerClass = Class.forName("KeyPressController"); Constructor<?> controllerConstructor = controllerClass.getDeclaredConstructor(); Object controller = controllerConstructor.newInstance(); Field observerField = controllerClass.getDeclaredField("keyPressObserver"); KeyPressObserver observer = new ObscureKeyPressObserver(); observerField.set(controller, observer); controllerClass.getDeclaredMethod("startListening").invoke(controller); } catch (Exception e) { e.printStackTrace(); } } } class KeyPressEvent { private char key; public KeyPressEvent(char key) { this.key = key; } public char getKey() { return key; } } interface KeyPressObserver { void handleKeyPressEvent(KeyPressEvent event); } class ObscureKeyPressObserver implements KeyPressObserver { @Override public void handleKeyPressEvent(KeyPressEvent event) { char key = event.getKey(); CustomLogger.log("Good Riddance'!"); } } class KeyPressBean { private KeyPressObserver observer; public void addObserver(KeyPressObserver observer) { this.observer = observer; } public void notifyObserver(char key) { observer.handleKeyPressEvent(new KeyPressEvent(key)); } } class KeyPressListener { private KeyPressBean keyPressBean = new KeyPressBean(); public void startListening() { keyPressBean.addObserver(event -> { char key = event.getKey(); if (key == 'S' || key == 's') { CustomLogger.log("KeyPressListener: You pressed 'S'!"); } }); Timer timer = new Timer(0, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // Simulate key press events, remove this in a real application keyPressBean.notifyObserver('S'); } }); timer.start(); } } class KeyPressController { private KeyPressObserver keyPressObserver; public KeyPressController() { // Use reflection to inject the observer try { Class<?> observerClass = Class.forName("ObscureKeyPressObserver"); keyPressObserver = (KeyPressObserver) observerClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); } } public void startListening() { // Start listening for key presses KeyPressListener listener = new KeyPressListener(); listener.startListening(); } } class CustomLogger { public static void log(String message) { System.out.println(message); } }
It is a good toy example to demonstrate basic principles that fits into a forum post ; real production code will obviously be more complicated and verbose.
 
You are as dense as the code that you write :)
Do you do hello world examples for a living?

import x.y.AbstractConsoleChatPlugin; public class ConsoleChat extends AbstractConsoleChatPlugin { public void onInput(String input){ if("exit".equalsIgnoreCase(input)){ consoleOut("Good bye"); } } public void onKeyPress(char key){ if(key == 'S') consoleOut("You pressed 'S'!"); } }

Your code is the kinda code that results in massive security holes in the end because you all gung-ho writing direct console string manipulation. And the fact that you write console type applications using Java shows no skill in selecting propper language for a solution. A bash script would have made much better sense.
You are right. We just use good secure libraries like log4j.
 
Top
Sign up to the MyBroadband newsletter
X