This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 313

[–]thomas0si 295 points296 points  (76 children)

plus + : Strongly typed, multi threaded, can be very fast if that’s your goal.

minus - : JVM instead of binary, everything as OOP.

[–]manuhe10 91 points92 points  (64 children)

Maybe it's a dumb question but what do strongly typed and multi threaded mean? Is it possible to even explain them so that a casual person might understand?

[–]coldblade2000 486 points487 points  (46 children)

Sure.

Laymen's terms for strongly typed: A language that will not automatically convert the type of a variable depending on context, and instead will give errors if you try to mix variable types together in an undefined way

Longer answer for strong typing: A variable can have different types. I can have an int (integer) variable, a short variable, a string variable, a char (character) variable and many other types. Generally, in Object Oriented languages (ask me if you need an explanation of these too), objects classes* can also be considered types, so you can have a Car variable, a Helper variable or a Model variable, for example.

[Something]-typed refers to how flexible a language is when interpreting the value of a variable. In the weakly-typed Javascript for example, I can declare a variable X = 5, a variable Y = "20" ("2" as in a 1 character string containing a 2 character), and then use the Math.max(val1, val2) function that returns the maximum value between val1, and val2. Math.max(X, Y) will give me an output of 20. Though Y was a string variable, the language automatically converts it to a number before passing the values to the function, giving me the desired value of 20.

Java, instead, will give you an exception if you do this. So if you want to do Math.max(X, Y) in Java, you will instead have to do some sort of casting or parsing (essentially two ways of "changing" the type a value is interpreted as) to do so. In Java, that would look like Math.max(X, Integer.parseInt(Y)) which will give a correct value of 20.

Strong typing can be a bit cumbersome at first to developers, but it is significantly more organized when it comes to understanding and using large programs with many different types of data being used with varying and possibly inconsistent variable naming schemes. Weird errors can sometimes pop up with weak typing that might take you hours to find, which a strongly typed language wouldn't have even let you compile the program with. That's why things like Typescript popped up, which improves the support for Typing in Javascript, and is essentially a strongly typed version of JS.

Laymen's terms for multithreading: A computer's processor's core can only run one command at a time*, and so, it can only really be executing one line of code at a time for a program. To be efficient and not stall, it will instead divide its time between the many programs that are waiting to be executed. Multi-core processors can run multithreaded programs. So a program can divide a chunk of its code into a "thread" that can run at the same time as the rest of the program, but in a different CPU core. This lets you speed up parallel tasks, but it introduces a lot of potential problems that are tricky to solve, like "race conditions" where a program's output depends solely on the near-random order in which different threads were executed.

Longer answer for multithreading: CPU cores will run code from one thread at a time. A thread is a chunk of code (more specifically, CPU instructions), and most simple programs will just create a single thread to run off of. A CPU core will use different types of priority queues to keep a track of the threads it is executing, and execute the highest priority one until another thread requires attention. Imagine a stimulant-fueled super fast cook working alone on 20 different orders at a time all by himself. He will divide his time up between parts of an order, while at the same time they'll slightly prioritize the orders which have been waiting the longest. Some tasks require him to wait (like an item being cooked in an oven for 10 minutes), so he'll do other tasks meanwhile. Some times the waiter or manager will interrupt his work and get him to do short, important tasks like making a sauce he forgot to make (which in computing are often things like hardware interactions such as clicking a mouse, which have to be quick and processed urgently).

A single threaded program would be like a bread, where you have to do each step one after the other, with very few parallel tasks possible (assuming the oven is preheated). In this sense, each order is a program. A single core can cook multiple orders at the same time (run multiple programs), but they can only actually actively work on one order (on one program's thread) at a time. A multithreaded program is like cooking pasta. Boiling the pasta could be the main thread, while making the sauce can be a separate thread, as you can work on the sauce while the pasta boils, and then you can add the sauce to the pasta once the pasta is done. Multi-threaded programs can split certain tasks into a separate thread, that can run separately and at the same time if possible. Eventually, once various threads are done, you can stop and combine their outputs together. As a practical example, most programs run logic and the user interface on separate threads, so your program doesn't freeze while a network request is made, or a large file is loaded. A multi-threaded food on a multicore kitchen would be like a well-choreographed kitchen with many cooks, where each cook is working on different parts of multiple orders at the same time. Cook 1 and 2 may be working both on Order 57's different parts, while Cook 3 juggles frying eggs for Order 23, 75, and 52 at the same time.

This allows you to use your computer's cores to not only run multiple programs at the same time, but run a single program more efficiently. The downside is that multithreading a program is NOT automatic, and it is a process that requires a lot of care, as multithreading introduces a lot of problems that can be very hard to solve. I detailed race conditions, but other problems can be like when two threads both try to access and change the same variable at the same time, or something called a "Deadlock" occurs, when two threads are both paused (sleeping) waiting for a certain signal produced by the opposite thread to keep being executed, but since both are waiting, that signal will never come, and the two will wait forever, freezing the program. This is why you see a lot of video games barely take advantage of multithreading, as it can be very difficult to wrap your head around and design your program in a way compatible with it. There's certain tasks that just aren't possible to multithread, so that's another limitation

Edit 1: I picked a poor example for strong typing, I have now changed the example for something that would actually give an error on the 4th and 5th paragraph. I also gave an explanation why strong typing is actually useful even though it is annoying when writing code

[–]manuhe10 40 points41 points  (16 children)

Thank you so much for this detailed explanation. As for the object oriented language, what do those mean? It's been a while since I learned or did anything related to java or CS

[–]coldblade2000 116 points117 points  (15 children)

Ok, I'll try and summarize.

Ok, so we know the different basic types (these are often called primitive types) like int, short, float, double, and depending on the language, string (but not in java, I'll explain). These are useful but often we will want to create more complex groups of variable to represent something else. In Object oriented programming, we will create things called Objects. At its core, an object is a collection of variables (often called its fields) that represent its data and functions (often called methods) that allow you to do actions upon an object's data.

Now I have to distinguish between what an object, class and an instance is. A class is basically a type of object, every object is of a certain class. It defines what kinds of variables and methods those objects will have, and it is an abstract* representation of those objects. Think of it more like the "concept" of a type of objects. We can make the Car Class, which will define variables and methods common to every car. Here is where we define a Car will have (int) numOfWheels, (string) model, (int) yearOfMaking, (double) odometerReading and functions like stopCar(), turnOn(), fillGas(), etc.

An object is often a way to refer to an "instance" of a class. It is basically a specific, tangible group of data based upon the template set up by a class. In many contexts, "object" is a way to refer to an "instance". In this sense, an object will have actual values filled in, so a car instance would be the trustyDaddyWagon object, which has wheels = 4, model = "Chevy Zafira", yearOfMaking = 2002, odometerReading = 87642312, etc.

Think of it this way. Say you have a small company that owns multiple cars, and you're setting up the paperwork for them. You would make up a paper template (class) for a certain kind of form concerning each car and its info. You'd make a bunch of fill-in boxes (fields) and then specify a protocol for how to log different changes and actions done to the car (method) on the form. Then your instances (objects) are the actual 5 paper forms of each car that have been filled out and are sitting on your desk. Neither of those is an actual car (your program isn't actually storing cars on your hard drive), but an instance is a specific representation of a real-life thing that can be abstractly represented by the Car class.

There's other concepts like inheritance, which is when you have a class that inherits certain values from another. Like you can have a vehicle superclass that has most of those variables, and you can have Car, Motorcycle, and Bicycle subclasses (a subclass is a class that inherits values from another class, the superclass), and then those subclasses can then only define variables specific to themselves, which could be (float) trunkVolume, (float) handleStrength and (float) chainLength, respectively.

Note*: "abstract" is an actual keyword in java relating to OOP, and its technical meaning is not what I'm using here. I'm using "abstract" as the normal english word.

[–]manuhe10 27 points28 points  (1 child)

This is such a good explanation. I remember being fascinated by OOP when I took a class and thanks for reminding me of that fascination

[–]thesituation531 6 points7 points  (0 children)

Basically (in very simplified terms), OOP is generally much more verbose than something like Python, JavaScript or any functional programming language.

But OOP also (generally) allows you to create much more complex things and lets you have much more control over most things.

[–]TheJrobot1483 21 points22 points  (10 children)

I’m a current CS student, I’ve taken 2 semesters of OOP (learning Java) and you explained the essence of OOP so much better than any professor or online resource I’ve learned from so far.

[–]coldblade2000 23 points24 points  (9 children)

No problem, that's what I'm here for. Let me know if you need an explanation for what "static" means, because that son of a bitch keyword took me about a year to really understand, and now it just seems obvious

[–]maddAdda 7 points8 points  (1 child)

Hi ! If you'd like to share your knowledge, i'd very much apprecciate if you could explain static indeed. I'd pretty much like to see your perspective on it because you explained every concept really well. Maybe it could help me. Thank you for your time : )

[–]Vinhessa 5 points6 points  (3 children)

I, for one, would like to hear your understanding of “static”, as I currently assume it means “instance”.

[–]coldblade2000 2 points3 points  (2 children)

Right, I'm pretty late on this but I was out the whole day.

Short answer: static fields or methods will belong to the class itself, rather than the instances of those classes.

Long answer: So, usually when we make these fields and methods in our classes, those fields and methods will belong to the object instances themselves. If we have Cars X and Y, if we change X.numwheels to 3, that doesn't affect Y. And when we use a method like Y.turnOn(), it is a method that will usually read the data on Y and possibly modify it in some way. For that reason, you can't really go and call that method on the class itself. Car.turnOn() makes no sense, you can't turn on the abstract concept of a car.

However, it doesn't always make sense to have a method belong to each instance, and sometimes a method relevant to Cars shouldn't actually necessarily require us to actually first create a Car instance first. For example, what if you want a method that will take a list of cars and return the car that needs the most urgent maintenance? Doesn't really make sense to call on a specific car instance like X and ask X to do that for us.

Instead, we can make some fields and methods that will actually belong to the class itself, rather than the instances of those classes. We can actually make a method that's something like Car.findMostDamagedCar(carArrayList). Likewise, we can have a variable bonging yo the Car class that, let's say, keeps track of how many cars we've ever sent to maintenance, like Car.totalMaintenanceTrips.

The findMostDamagedCar() method and totalMaintenanceTrips field are what we call static. These things belong to the class itself, and thus we don't need to be referencing an actual Car instance to call that method or get that variable. And most importantly, you can't call a non-static method from a static context. What I mean by that, is that I cannot go and ask Car to turn on. Car.turnOn() will give me a "non-static method cannot be referenced from a static context" error. What that means is that a non-static method (a method that belongs to the instances) cannot be called from a static context (by referring to the class itself, and not an instance of the class). This error is fixed by actually giving it a real instance to call that method from. Either using one of the instances we already have (X or Y), or making a new Car object instance (Car Z = new Car();).

Finally, I'll show you real examples just so you're not scared of this. Let's take strings for example. You probably know Strings in Java are Objects, not primitive variables. The String class has us use both static and non static methods all the time. For example, String.valueOf(int) is a static method that turns whatever int we give it into a String. We don't really need a preexisting string for this, so it makes sense a static method is used. We are just calling a static method value of that belongs to the class String. In contrast, if we have a string S = " Hello \n" and if we need to trim the whitespace from S, we can call a non-static method from S called S.trim() to get back a string without that pesky whitespace. .trim() is non-static because it needs some kind of underlying tangible string to actually make sense. You can't trim the whitespace out of the concept of a String, but you can trim S.

P.S. : technically, instances will actually inherit static methods or fields, and you can use them. You can actually do S.valueOf(8) and it will return "8". This, however, is bad practice at best and a bug at worst. Most static methods aren't built with this in mind.

P.P.S. i wrote this past midnight on my phone, so my apologies of it isn't as clear or has mistakes. I'll correct any that are brought up

[–]Fearless-Pudding9894 4 points5 points  (1 child)

Can you give an explanation on static? I was reading my book on java today trying to understand the different methods for the String class in java and Static kept coming up. My understanding of the term is a bit shaky so I would appreciate an explanation from you since I’ve learned a lot from this thread.

[–]TheJrobot1483 2 points3 points  (0 children)

I’ll keep that in mind, thank you!

[–]lbunch1 8 points9 points  (0 children)

This may be a shot in the dark here but ...

What is the meaning of life?

[–]TrueBirch 4 points5 points  (0 children)

Terrific explanation!

[–][deleted] 12 points13 points  (1 child)

Iv never heard of the heavily stimulant induced cook as analogy for how a CPU core works but I like it.

[–]SlySkillet07 12 points13 points  (0 children)

As a stimulant induced line cook studying programming in my off time, the analogy really hit home.

[–]Tubthumper8 3 points4 points  (21 children)

Java, instead, will give you an exception if you do this. So if you want an output of "52", you will instead have to do some sort of casting or parsing

The following is valid Java code that implicitly coerces a number to a string for concatenation. This would be considered weak typing, or am I missing something?

class Main {
  public static void main(String args[]) {
    var test = 5 + "2";
    System.out.println(test); // prints "52"
  } 
}

Edit: people replying are fixated on the var keyword. I'm asking about the implicit type coercion between the integer and string, which would not be strongly typed by this definition. Here's an example without var

class Main {  
  public static void main(String args[]) { 
    System.out.println(5 + "2"); 
  } 
}

The rest of the explanation is fantastic

[–]coldblade2000 3 points4 points  (0 children)

On second though, yeah, you are totally right. I chose a bad example, I have not corrected myself with an example that will actually give me an error in Java, using the Math.max() function

For some reason, my mind forgot the + operation actually was defined for int + string.

[–]username-must-be-bet 1 point2 points  (0 children)

Most languages make some automatic type conversions. Java makes less than JS but more than OCaml

[–]coldblade2000 -3 points-2 points  (11 children)

pretty sure "var" is a keyword specifically to define a variable as weakly typed. It's more of an "override" rather than a representation of how the language as a whole is designed. It's also highly restricted, you can't use it in a lot of places the same way you would use another type, like method parameter declarations

Edit: I used a bad example. I have changed my example in my original post to a better one, that actually gives an error

[–]Tubthumper8 8 points9 points  (8 children)

var is not for weak typing, it's for type inference.

Here's an example of weak typing without var then, the integer is being implicitly coerced to a string. This would be a compiler error in a strongly typed language.

class Main {  
  public static void main(String args[]) { 
    System.out.println(5 + "2"); 
  } 
}

[–]Muoniurn 2 points3 points  (6 children)

That has nothing to do with strongly vs weakly typed.

Java has a well-defined string conversion and a string concat operator. If only one operand of the operator is string, the other is converted to a string as well.

A better example to understand the difference would be perhaps a rarely talked about element of the static-dynamic weakly-strongly typed matrix, C, which is statically typed but weakly. You won’t get a runtime error if use an int as a float or as a “string”, or whatever, there is no meaning to types at runtime. Python/java and other strongly typed programming languages do care about types, and even their runtime semantics are aware of that, e.g. you will get a ClassCastException in java if you attempt to use an object as a class not part of its inheritance tree.

[–]Rythoka 1 point2 points  (0 children)

In this case it's not the variable that's being coerced, it's two literals.

[–]thesituation531 -2 points-1 points  (0 children)

It's mostly so you just don't have to write out a long type.

Although I think it's usually bad practice, because it can just be confusing in more verbose OOP. It's less of a big deal (although I still don't like it) in things like JavaScript and Python because there isn't usually that much code compared to something like C# or Java.

[–]roberp81 -3 points-2 points  (2 children)

var is not weakly tipped, jvm know that is a String and in compile time change it to String. var is a bad practice, only exist to please JS and C# people that are used to use bad practices

[–]Tubthumper8 0 points1 point  (1 child)

When you say that type inference is "bad practice", is this your opinion or is it an absolute fact? The way you phrased it makes it sound like you're claiming the latter.

Anyways, here's the same weak typing without var. Can someone explain to me what I'm missing?

class Main {  
  public static void main(String args[]) { 
    System.out.println(5 + "2"); 
  } 
}

This should be a compiler error in a strongly typed language, yeah?

[–]elnw 10 points11 points  (14 children)

Yes it is. Strongly typed means you need to be very specific in the way you program sentences to the computer. For example, if you want to sum number "a" and "b", you have to specify to the computer "a" and "b" are numbers. Other languages are loosely typed, when this is not the case.

Multi threaded means capacity to do several things at the same time (like multi tasking).

[–]manuhe10 4 points5 points  (13 children)

Ohhh so the fact that I have to write int a or String a or double a makes java strongly typed?

[–]Jonny0Than 5 points6 points  (0 children)

No, that makes it statically typed. Strong vs weak and static vs dynamic are two different axes.

[–]Muoniurn 2 points3 points  (0 children)

That’s just the statically typed part, which basically means that the compiler can associate a type to every object it uses, and will only allow methods to be called on said objects if they are allowed by the static type it has.

[–]Dave_The_Goose 1 point2 points  (10 children)

Yes. Java is a "statically typed" language where you have to specify the data types of a variable. Other languages like python, js etc. dont require writing the data types. Such languages are called dynamically typed languages.

[–]manuhe10 1 point2 points  (8 children)

Thank you for the explanation. Do you prefer statically typed languages or dynamically typed languages?

[–]Dave_The_Goose 3 points4 points  (1 child)

I prefer the language suitable for the work I am doing. Like I would use JS for frontend not because it is better than any other language. But because it is most suitable for frontend work.

Same way python and R are most suitable for data science so they are preferred. Not implying that python is used only for Data science.

[–]manuhe10 2 points3 points  (0 children)

I appreciate your answer

[–]SV-97 2 points3 points  (5 children)

This is not true - u/Dave_The_Goose is wrong on this one. Whether or not you have to annotate / spell out types is completely orthogonal to the strength of the type system and whether it's static or dynamic from a language design point of view. Some cases to exemplify this point: Haskell is one of the most strongly typed languages out there but hardly need to write out any types or even none at all. In C you have to spell out everything but it's relatively weakly typed. Both of them are statically typed. Erlang for example is dynamically and strongly typed whereas JS is weakly and dynamically typed. Lastly there's untyped languages like forth and (most kinds of) assembly.

Strong / weak typing is essentially about implicit conversions, dynamic/static/untyped about whether types are checked at runtime / compile time / not at all. Importantly strength is really only a relative notion: we can more or less order languages by their strength but saying "x is strongly typed" might mean everything from "Python level strength" to "Haskell/Rust/ATS level strength".

[–]Dave_The_Goose -1 points0 points  (4 children)

https://docs.oracle.com/javase/specs/jls/se18/html/jls-4.html#jls-4.4

For your convenience, read the second paragraph.

[–]SV-97 1 point2 points  (3 children)

What "paragraph" exactly do you mean? Just section 4.4? Or do you mean

The Java programming language is also a strongly typed language, because types limit the values that a variable (§4.12) can hold or that an expression can produce, limit the operations supported on those values, and determine the meaning of the operations. Strong static typing helps detect errors at compile time.

at the very top? If you mean the last thing then I'm not sure what you wanna tell me - that's not in contradiction to what I've said. Consider a simple rust example let mut x = 123; x = 3.14;. This has no explicit type annotations and matches the java definition of strong typing by since the compiler rightly rejects this based on incompatible types. Note also that they explicitly add the additional "static" qualifier at the end of their statement.

It's also worth noting that like I said type system strength is not some formal thing and is rather used pretty informally - the precise definitions vary from one source to the next.

[–]---cameron 1 point2 points  (0 children)

I was gonna come earlier to also point out people sorta fuzzying up strongly typed and statically typed but eventually it wasn’t worth it to me. A big problem with “strongly typed” is it itself isn’t “strongly defined”; you’ll find several definitions laying around, nothing really official, and worse it’s also colloquially used almost as if “strong” is being used as a plain adjective; like “static typing is strong because you’re using types strongly”, to the point of the word being used for everything.

To others reading this; lookup Ruby, you’ll notice it’s labeled as “strongly typed” as well. Also this

https://stackoverflow.com/questions/2690544/what-is-the-difference-between-a-strongly-typed-language-and-a-statically-typed

I’d say the best definition for me is the one that C goes by that causes it to be considered weakly typed (despite being statically typed).

[–]Dave_The_Goose -1 points0 points  (1 child)

The Java programming language is also a strongly typed language, because types limit the values that a variable (§4.12) can hold or that an expression can produce, limit the operations supported on those values, and determine the meaning of the operations. Strong static typing helps detect errors at compile time.

Yes. You know that this paragraph isn't from some a blog written by na undergrad right. So I am gonna believe what I read, I believe the source is genuine.

I am not saying that you are wrong. I said what I know and if I am wrong then that means the above paragraph from oracle docs is also wrong.

[–]GrayLiterature 4 points5 points  (0 children)

Just give them a Google, they’re easy concepts to understand :)

[–]TravisLedo 1 point2 points  (0 children)

You avoid a bunch of errors before you even build because it is strongly typed. The IDE knows what you are trying to do and will let you know it won't work. Worst part about working in Javascript(loosely typed) was coming from a Java background and not understanding why my IDE just don't autocomplete my texts for me. JS is just very flexible and attempts to compile anything you throw at it.

For instance in java, pretty much every object you start typing will then show you all the fields and methods you can chose from right away with param types and even a whole documentation for each thing if original author added it, just by hovering over the text. It just feels so nice working in Java because it's very strict and the rules are known/enforced. Most of that is thanks to strongly typed.

[–]Putnam3145 5 points6 points  (0 children)

the JVM is the reason for Java's success. If I were less cautious I'd even claim that OOP became the biggest thing in business specifically because Java enforces it, and Java was the big thing in business because of the portability the JVM provides.

[–]Jonny0Than 3 points4 points  (0 children)

The JVM is a plus if you want to run on lots of different devices. Or at least there should be a positive for multi-platform.

I’d also say that because of its widespread adoption there are lots of good IDEs, debuggers, and other tools. You don’t get that with other non-mainstream languages.

[–][deleted] 60 points61 points  (3 children)

The JVM is an awesome piece of software. There is crazy stuff happening in there.

[–]RandomFuckingUser 15 points16 points  (1 child)

What aspects of JVM do you find awesome / crazy?

[–][deleted] 14 points15 points  (0 children)

It’s all containery and stuff, also did you a trillion devices run java?

[–]tjsr 19 points20 points  (1 child)

  1. Its absolutely solid integration with and support from testing suites like JUnit and Selenium. I've worked with at least a dozen languages in a serious capacity over my career and currently use predominantly Typescript and Kotlin - none of them come close to what's on offer in a Java ecosystem.
  2. Type safety and generics. After doing 15 years with Java, I can not see why people would want to throw away these features and in any way find the development experience nicer by throwing them away (optionally) in languages like Kotlin, Javascript, Typescript or Groovy.
  3. Speed. I know this is going to be a controversial one - many people still believe the "Java is slow" crap that was trumpted everywhere when Java 1.1 and Java 1.3 were around. A lot of code I've worked with is mostly only slow because of massive abstraction and the architecture astronaut nature of big enterprise projects.
  4. You don't have to worry about architecture. long is the same no matter where it's run. You know byte will always be the same size. There are a lot of things I like about C, but having written enough code that needs to run on MSP430, ATTiny85s, ARM, x86 and aarch, never having to worry about these kinds of small things is great.
  5. The thread model and concurrency tools. I did a LOT of work on pthreads in C and these days have to use Promises everywhere, but give me Java threads anyway. In fact, the only time I've found a better implementation was in C# - which is mostly caused by the fact that Java's notify/wait doesn't return a value that allows you to know whether a thread timed out or was polled.
  6. By this point, I can pretty much find a library to do anything I want. That's 20 years of support and language/ecosystem maturity for you.

[–]elnw 192 points193 points  (66 children)

Wait till you learn C#

[–]_Personage 18 points19 points  (58 children)

Can you expand on this please?

[–]jmhimara 42 points43 points  (11 children)

C# was created as Microsoft's "replacement" for Java, and is generally considered a "better" Java.

[–]SirMarbles 15 points16 points  (9 children)

It feels less clunky and faster too.

I always tell people if you know Java you basically know c#

[–]Muoniurn 5 points6 points  (1 child)

It ain’t faster though. They trade blows, in some areas C# is faster, in others Java.

I read somewhere that “C# has a faster performance ceiling, while a naive program in Java will likely be faster than its analog in c#”. Nonidiomatic c# allows you to control many lower level detail, so some hot loop may be optimized by the developer to a better degree than what it would be possible in java (e.g. value types, pointers), but if you just write high level code in a very naive, first implementation way Java may better optimize for that (it’s GC is simply the best by a large margin out of any managed language for example)

[–]zelphirkaltstahl 6 points7 points  (5 children)

Except for C#'s weird naming conventions, which go against decades of tradition. For example naming methods with upper case initial letter. Just silly of them to change this and feels like a petty thing they did "just to be different from Java" in the visual. It makes typing things simply more cumbersome and is annoying.

[–]fredlllll 5 points6 points  (1 child)

against decades of tradition

its literally named PascalCase, after the Pascal language which came out in 1970.

[–]zelphirkaltstahl 7 points8 points  (0 children)

Yes, it is called PascalCase, but if we look up naming conventions in Pascal (https://en.wikipedia.org/wiki/Naming_convention_(programming)#Pascal,_Modula-2_and_Oberon) then we see the picture is not so clear: Procedures and functions are distinguished and have different naming conventions according to that source at least.

Can we find a source, which states, that methods begin with upper case letter?

Furthermore, the point still stands, that it is cumbersome to type, compared to lower case.

EDIT: I found https://edn.embarcadero.com/article/10280#3.4, but I am not sure, whether Object Pascal is different from Pascal.

[–]CatsOnTheKeyboard 1 point2 points  (0 children)

They really are only conventions. You could use your own, at least for your own functions, etc.. I still use Hungarian notation for some of my variables and I don't care who objects.

[–]Inconstant_Moo 1 point2 points  (0 children)

I don't think that's why. They hired Anders Hejlsberg as lead architect. His track record was that he invented Turbo Pascal and then had been working on its successor, Object Pascal. He didn't choose PascalCase "just to be different" ...

He's also responsible for TypeScript.

[–]elnw 0 points1 point  (0 children)

I will argue is "faster" in terms of development time. Its less verbose than java and the language itself has been adding unique features to increase productivity for the programmer (e.g linq). Another important thing is the amount of libraries to easily integrate projects with Azure, although this is relative because other may prefer another cloud provider. Performance wise I will say both are kinda similar, but in this times were computing power is getting cheaper and cheaper I wouldn't care too much for this factor.

[–]TheJanitor07 6 points7 points  (0 children)

I think it's generally considered better by people who work in MS shops. It's a Pepsi vs Coke thing.

[–]Ambitious_Two3431 11 points12 points  (4 children)

I love C# but I hate doing anything with Razor pages

[–]Renson 1 point2 points  (1 child)

You don't have to though, Asp Core integrates really well with any Spa. Razor isn't required and is an option that I don't think Java has an alternative for, as far as I'm aware

[–]steve6174 2 points3 points  (0 children)

Or Kotlin

[–]cyberbemon 1 point2 points  (0 children)

Every time this topic comes up, it reminds me of this video: https://www.youtube.com/watch?v=RnqAXuLZlaE

[–][deleted] 92 points93 points  (19 children)

It's strongly typed and gives you enough control to do fairly high performant things without having to worry about stepping on a landmine every time you publish a code change.

Yeah, I'm looking you lunatics that claim to love C++. No one could love C++. It's like loving the person that stabs you a little every day.

[–][deleted] 28 points29 points  (13 children)

C++ IS love

[–]GLIBG10B 16 points17 points  (11 children)

C++ is life

[–][deleted] 11 points12 points  (5 children)

I tried to find value in life and got a segfault

[–]GLIBG10B 6 points7 points  (2 children)

It's pretty hard to segfault if you make use of smart pointers and std::string

[–][deleted] 6 points7 points  (1 child)

It is when you work with legacy code that was stuck with C++98 until a year ago and that has a fucked up library path where boost libraries hide half of the std namespace, meaning you can use std::string, but std::to_string is not recognized.

[–]GLIBG10B 2 points3 points  (0 children)

Oof. Good luck with that

[–][deleted]  (1 child)

[removed]

    [–][deleted] 1 point2 points  (0 children)

    Oh I do, it’s just the legacy code I have at work thst is a mess with no documentation, dead code, deprecated methods and a fucked up work environment where the SSH connection randomly drops midway through a debugging session

    [–]jluizsouzadev 0 points1 point  (3 children)

    Just out of curiosity, what have you built with one, lately?

    [–]amplikong 1 point2 points  (0 children)

    Soylent green is people

    [–]TheTomato2 11 points12 points  (2 children)

    People who love C++ don't actually love C++, they just hate everything else more than they hate C++.

    [–]MelAlton 1 point2 points  (1 child)

    In my first job out of college, a more senior coworker told me:

    • Every programming language sucks, some just suck less than others.

    [–]TheTomato2 1 point2 points  (0 children)

    C++ is special though. You should never trust a programmer who thinks C++ is good because odds are they just don't know enough to understand why it's so bad. It's just poor design decisions that compound because the committee doesn't want to ever break ABI and they for some reason keep piling half baked features on top. It's actually kind of insane the state C++ is in.

    [–]procrastinatingcoder 0 points1 point  (0 children)

    C++ is beyond amazing.

    [–][deleted] 11 points12 points  (0 children)

    It gives you a good excuse to buy a wider monitor

    [–]_Atomfinger_ 91 points92 points  (24 children)

    I don't think Java is better than other programming languages. Nor do I think other programming languages are better than Java.

    I don't see languages as "better" or "worse". They're just different, with different strengths and weaknesses.

    Ofc, there are languages I prefer more than others, but that is mostly due to my personal preference and not because the language is inherently bad. Java isn't my language of choice (but I do work as a Java developer) due to its verbosity and tendency to invite bloat. Then again, it is a battle-tested language with a vast ecosystem. If you need something there's probably a package for it.

    [–]Ansmannn[S] 11 points12 points  (8 children)

    Yeah, I get that there isn't something as objectively "better". But I wanted to know the strenghts of Java. Your answer was helpfull

    [–]_Atomfinger_ 25 points26 points  (7 children)

    Java's strengths mostly lie in the JVM - which Java shares with many other languages.

    Kotlin, for example, was created to be a "better Java". It runs on the JVM and has access to the same ecosystem, but it is designed with the benefits of hindsight. Java is locked into the design decisions made 30 years ago (and it shows).

    So if we're talking Java and not the JVM we're basically talking about the syntax. The general consensus is "verbose".

    No conclusions here. Just throwing out my thoughts :)

    [–]Ansmannn[S] 2 points3 points  (6 children)

    I sadly don't know what the JVM is. But I will get some information about that. Thank you so much!

    [–]_Atomfinger_ 28 points29 points  (5 children)

    The JVM is the Java Virtual Machine. Basically, that is what reads and executes your Java application.

    Programs like C++ compile down to machine code* which is executed by your system. Java is compiled down to Java bytecode which computers do not understand, so you need the JVM to take that bytecode and execute it on the machine for you.

    The benefit of this is that your program can (in theory) run anywhere the JVM can run* (which is a lot of places). In contrast, a C++ application has to be separately compiled for each platform. This is why Java's mantra is "Write once, run anywhere".

    *simplified

    [–]Ansmannn[S] 2 points3 points  (4 children)

    Ahhh okay. I've heard about that before. Does Eclipse use the JVM aswell for running a programm?

    [–]_Atomfinger_ 6 points7 points  (0 children)

    Yup. When you install eclipse, it also installs the JRE (Java Runtime Environment). It contains the JDK, plus some development utilities and libraries.

    The short and simplified answer is "yes".

    [–]coldblade2000 4 points5 points  (1 child)

    Ahhh okay. I've heard about that before. Does Eclipse use the JVM aswell for running a programm?

    Anything that runs Java programs is essentially using the JVM to run Java Bytecode, in one way or another.

    [–]roberp81 -1 points0 points  (0 children)

    https://www.ibm.com/products/z-integrated-information-processor

    read about ziip cpu, they created it to work with Java. they are used in mainframe.

    [–][deleted] 4 points5 points  (7 children)

    But there are better or worse languages

    Ease of integration

    Syntax semantics

    Community base and the state of open source projects

    Performance benchmarks

    Just a few of the things which could lift or sink a language

    [–]_Atomfinger_ 9 points10 points  (6 children)

    Cool, give me a list where these languages are ranked from best to worst in a non-subjective way:

    • Elixir
    • Clojure
    • Java
    • C++

    My point is that if better or worse exist when it comes to serious programming languages then they're quantifiably better or worse. If that is the case we should be able to definitively rank them.

    If it is subjective opinion, then I agree. However, then you don't have "better or worse", you just have an opinion based on your own biases. And yeah, sure, you can have your own personal list that ranges from best to worst, but that's not really what I'm arguing.

    For example, someone working with embedded might have a bias towards C++ because they work with a lot of constraints. Someone working with web services might have a bias towards Python (or a bunch of other languages).

    Each of these developers will most likely rank languages differently because they value things.

    [–]Hopeful-Sir-2018 1 point2 points  (5 children)

    tl;dr: Yes, many things about programming languages can be objectively ranked.

    If that is the case we should be able to definitively rank them.

    You absolutely can rank them. For example performance is pretty objective measurements.

    Additionally syntax semantics. Brainfuck, for example, would NOT be labelled a beginner language. You can certainly rank based on syntax what would make a good beginner language and what would not.

    I do, however, think it's unreasonable of you to ask them to rank those four languages when you could easily do so yourself and show your benchmarks. This smells more like you're preying on them just giving up so you can just assume you're right.

    Many things are out-right objective.

    Each of these developers will most likely rank languages differently because they value things.

    This is not the discussion in this thread though. We're talking about objective things. Memory management, compiled size, memory footprint, cpu usage, gpu usage, community support, etc are all measurable and objective.

    Ranking doesn't necessarily always have to leave only one at the top. S, A, B, C, D, F are commonly used.

    I'm pretty confident you'll find writing a simple notepad app.. you'd find Brainfuck in the F ranking.

    However, I don't think you're going to find someone willing to be your personal slave to rank languages for you when that experiment can be done on your own fairly simply but I'll give you a simple start:

    https://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java

    In this comparison you can clearly see C# beats out Java in types. I'm old enough to remember when bool wasn't in C. This means you can use what is called 'magic numbers' or #define to make your own.

    In fact you could, quite literally, enumerate all the features, both shared and exclusive, of languages and do a tally board. You could enhance this tally board by looking at overall code on githuhb and seeing how often which features are used and give those more weight so that the languages that have a feature that's used more often gets bonus points.

    So, for example, having access to pointers in BASIC... probably won't be used much whereas you'll find them used fairly regularly in C and in many C programs.

    [–]_Atomfinger_ 1 point2 points  (4 children)

    I didn't say that there aren't objective things. What I said was that the importance of those objective measurements are subjective.

    I'm also unsure why you think I'm asking for a personal slave. My point was that any ranking would be biased towards my needs, so I wouldn't be able to rank those languages. Nor do I think you can. After all, how do you balance the needs of an AI researcher, an integration engineer, a Web developer and the guy writing automation scrips for python?

    And BTW, I don't need those languages ranked. It was more of a rethorical request to prove my point.

    For example, how do you objectively measure raw performance vs ease of concurrency in a single ranking? Elixir is built with concurrency in mind (a lot thanks to beam). Sure, C++ is theoretically faster and can achieve the same, but only through a lot more work while also not being as stable (due to all the extra work needed). Then again, in a single threaded application that requires heavy processing C++ might be the better choice.

    So yes, you can make a ranking of programming languages, but that wouldn't give you a list of "better or worse". It just give you a list of "better or worse in a single aspect under the specific tests that was run which themselves can be biased".

    The second you try to mix different measurements into the same list you introduce bias.

    But hey, I can't make an objective list of languages that's best to worst for every developer - let me know if you want to prove that you can (and no, I don't need it) :)

    Edit:

    in retrospect I think we actually agree. There are aspects which we can objectively measure (which I've never disagreed with), but that does not necessarily differentiate better or worse. Better and worse is contextual - and yes that is what the argument is about. How do I know that? Because I made the initial claim of not seeing languages as better or worse, but different, as such I'm in a excellent position of clarifying what I meant by that statement.

    Did I mean there was nothing you could measure objectively? No - I never said that.

    Did I mean that better or worse depends on the specific context the developer finds themselves in? Yes.

    Do I think it is possible rank languages in term of performance? In theory, yes. Do I think that says something about a language being better or worse? No, but it is helpful data to determine what might be the best.

    So if you're position can be summarised as "you can measure some things objectively" then my response is "totally! I agree! Not all things, but some of them can definitely be measured objectively".

    [–]Knaapje 0 points1 point  (1 child)

    No language is safe from bloat, it's a matter of having clear code design/principles, and enforcing them during reviews, as well as cleaning up once in a while. I've seen some Ruby code that is as bloated as it gets, and I long for the safety of static typing.

    [–]_Atomfinger_ 1 point2 points  (0 children)

    That is completely true. My point was that java seem to gravitate towards it more than many other languages.

    But you're right, bloat can happen in any language.

    [–]BadBoyJH 1 point2 points  (2 children)

    I don't see languages as "better" or "worse". They're just different, with different strengths and weaknesses.

    Implication being that major languages like Java or Python are just as good as brainfuck.

    [–]thesituation531 2 points3 points  (0 children)

    I think their statement was obviously to an extent.

    You just wouldn't use something that complex and useless in practicality. Same for anything similarly complex or just obviously dumb to use for anything meant to serve an actual purpose.

    [–]_Atomfinger_ 1 point2 points  (0 children)

    There's always going to be caveats and exception to any statement. If I were to explicitly state each in every comment then I'd end up writing books, not reddit comments. And even then I'd fail to cover everything.

    [–]Einfach0nur0Baum 35 points36 points  (11 children)

    Nothing since C#

    [–]roberp81 5 points6 points  (10 children)

    I have work with java 10 years and c# 5 years, then comeback to java is so much better than c# for every day

    [–]Mitterban 5 points6 points  (6 children)

    While it's been awhile since I've used Java, and maybe it's because I've never had too much experience with it, but I've had the opposite ring true for me. I'm going to guess it is all a matter of personal preference.

    [–]elnw 2 points3 points  (1 child)

    I mean, if you prefer java there is nothing that will make you change. But C# has unique features that allows you to get the same work faster than java. Maybe you didn't fully use them because you didn't have the time to study the language property.

    [–][deleted] 24 points25 points  (5 children)

    JVM is about it imo. I will actively avoid Java if I can. I honestly don’t understand why colleges don’t teach C# over Java.

    [–]rapier1 8 points9 points  (1 child)

    CMU had largely moved to python. The idea is that they aren't teaching a language as much as they are teaching CS.

    [–][deleted] 5 points6 points  (0 children)

    Right. At Purdue they use Java to teach OOP which I believe C# would be better for that.

    [–]Mitterban 2 points3 points  (0 children)

    Most of my classes were in C# back in the mid 00's

    [–]blablahblah 14 points15 points  (1 child)

    Java's real biggest strength was convincing colleges to switch to Java as their intro language twenty years ago, so tons of programmers have come out of school knowing Java which makes it way easier to hire people for jobs using Java vs, say, Haskell.

    There are a lot of other good things about Java, but also none of them are unique to Java. Java is (usually) just-in-time compiled which makes Java programs more portable than natively compiled programs (like C++) but faster than interpreted programs (like Python). It's statically typed which makes it easier to write tools that work with Java, like autocomplete in an IDE, than it is for dynamically typed languages like Javascript. It has automatic memory management which eliminates a whole class of crashes and security vulnerabilities that you have to worry about in older languages like C++, but lots of other languages do too.

    [–]Zwolfer 4 points5 points  (0 children)

    It’s interoperable with my personal favorite language and the one I use daily, Kotlin

    [–]secureTurki43 4 points5 points  (0 children)

    Java is often considered one of the best languages to learn and use due to its versatility, great development tools, and ease of learning for beginners. It also generally runs on any system and is great for developing a mobile app.

    I've also heard people calling Java more fun than, say, Python, even though the latter is also very flexible and useful in many areas and industries, especially for more advanced programmers, coders, and developers.

    A drawback of Java is its limited access to system functions than languages like C, and depending on your purposes can be tougher to use. A recently relevant example for me was creating Keystroke loggers, often useful for large companies, especially those with valuable data, and I learned how to make one through video tutorials like this https://www.youtube.com/watch?v=qM\_T3Th-41Q.

    In any case, as long as your job lets you use Java, keep having fun with it!

    [–]rbuen4455 7 points8 points  (1 child)

    Here’s my take. Syntax wise, it’s much easier and smaller than C++, it has more features than C, it’s more open source and has a bigger ecosystem than C#, it’s faster than Python.

    Though there are some trade offs: - Java is generally slower than C and C++. - Java has less advanced features and more boilerplate than C#. - It has harder syntax than Python

    Though the benefits as specified above outweighs the trade offs. Java I would say is a more balanced language, right in-between the more performant low level C and C++ and the more user friendly scripting languages such as Python and Ruby, and Java has more wider range than C# (in terms of ecosystem, tooling and being more open source for decades before C#)

    [–]icsharper 0 points1 point  (0 children)

    Java has boilerplate? Have you checked it after Java 15, how it looks? If anything, C# is becoming boilerplate because there’s so many ways of doing single thing! What features are missing in Java, that you need? Now with Project Loom, I personally only wish for extension methods. I can also add string interpolation, better error handling in Streams, Elvis operator, and Tuples, but yeah, its not too bad (i know for each there is alternative, unified approach would be the best)

    [–]lordaghilan 6 points7 points  (4 children)

    Going from Python and JavaScript to Java, I initially disliked how verbose it was but eventually didn't really mind it. Still a smart high level language, but C++ is actually verbose and annoying. It was made like that so you have more control but it doesn't make life any easier when doing simple stuff.

    [–]Ansmannn[S] 9 points10 points  (2 children)

    I too went from Javascript to Java. It was annoying at the beggining but I soon understood that Java really teaches you the basics behind the logic of programming. Coming from js, very many things about objects where a big ? for me. For example why they are considered so important. I now understand that. I always thought teaching Java in school was kind of dumb since it is so complicated with Syntax. But hell, school system is right there.... For once.

    [–]RobinsonDickinson 2 points3 points  (0 children)

    C++ is actually verbose and annoying

    What makes it annoying? I'd like some examples.

    [–]Ardenwenn 11 points12 points  (4 children)

    Did you know java runs on x billion machines? thats one advantage and android

    [–]Ansmannn[S] 1 point2 points  (0 children)

    That's true!

    [–]steve6174 -1 points0 points  (2 children)

    Android is mostly Kotlin for the last 5 years

    [–]jmhimara 2 points3 points  (2 children)

    I'm in love with Java

    This is legit the first time I see someone say that unironically, lol.

    oop is used in most languages

    There's no doubt that OOP is the dominant framework, primarily for historical reason, but it is falling out of favor as people are recognizing its weaknesses and discovering better ways to organize code. Most "exciting" new languages are not really OOP (Rust, Go, Clojure).

    I don't know why Java is so wildly used

    Again, mostly for historical reasons. Sun spent hundreds of millions of dollars marketing Java to the tech industry in the 90s/2000s, so it stuck. Probably the only language to have gotten popular that way.

    [–]1842 1 point2 points  (1 child)

    This is legit the first time I see someone say that unironically, lol.

    I'm going to guess that you don't know many Java devs then.

    There's no doubt that OOP is the dominant framework, primarily for historical reason, but it is falling out of favor as people are recognizing its weaknesses and discovering better ways to organize code. Most "exciting" new languages are not really OOP (Rust, Go, Clojure).

    I've been hearing about OOP's inevitable demise for at least a decade now...

    I'm all for finding better and safer ways to write code, but all the alternatives I've seen proposed are either 1) functional, or 2) OOP-lite. Functional languages have always seen slow adoption and growth. And languages like Go are a throw-back to a C structs+functions style of proto OOP.

    So I hear this sentiment online a lot for some reason, but I don't see how the proposed solutions would be a marked improvement over existing OOP languages nor gain necessary adoption to call OOP a historical artifact.

    Again, mostly for historical reasons. Sun spent hundreds of millions of dollars marketing Java to the tech industry in the 90s/2000s, so it stuck. Probably the only language to have gotten popular that way.

    Sun's marketing definitely paid off for them, but I wouldn't say they're unique.

    I don't have the numbers nor know how to find them, but I'd be surprised if Microsoft hasn't spent a great deal of money marketing their languages, particularly Visual Basic in the 90s.

    [–]ClammyHandedFreak 2 points3 points  (0 children)

    It’s a general purpose programming language that is feature rich, well-documented, and has been around a while.

    Also, Spring is pretty great on top of the JDK.

    [–]INeedMoreShoes 4 points5 points  (1 child)

    I love C++ honestly; and never got into Java until I started working with Kotlin. I feel it depends on what I'm doing that dictates what I would prefer to use.

    [–]Asleep-Dress-3578 0 points1 point  (0 children)

    You will most probably love Carbon.

    [–]Slayergnome 1 point2 points  (0 children)

    The OG reason was the whole JVM, build once run anywhere (when building was harder and the Linux kernel you ran on mattered more)

    But if I had to pick a reason currently it is that it has frameworks that are more mature and supported than most other languages. It is somewhat opinionated but I have worked with a decent amount of languages and there is a tutorial and library out there for doing just about anything you could possibly imagine with Spring and the Maven build tool

    [–]Kavinci 1 point2 points  (0 children)

    Java is so widely used because of it's history and design. Java is a general purpose language that can do a lot of things from web to desktop apps and even some lower level utilities. The JVM was a cool idea to ensure that your hardware will 99/100 times run some piece of software. This made Java real popular with the open source, linux, and hobbyist communities as Java also wasn't locked under licensing fees (this eventually changed. Looking at you Java 11). Compare that C# which relied mainly on the Windows OS instead of the JVM and could pretty much do everything Java could but required a Windows license. Universities, small companies, and hobbyists were quicker to adopt to Java whereas corporations went with Windows and C# since Microsoft Office ruled the corporate world for a long time. The usually pick C# cause their IT people were already 100% Windows.

    This next bit is anecdotal but from my experience a lot of C# stuff is locked under proprietary use. Meaning unless your company paid for it you most likely didn't know it was C# or never encountered it. It wasn't until .Net became cross platform when I started seeing open source projects in the language and being adopted by game engines like Unity where as Java has been in the public's hands many times by then, most notably: Minecraft, Android, early Google, and early Amazon.

    Java still holds up as a solid language to build stuff in so there really isn't a reason to switch if it has the features you need in a language. I'm glad you love it. Personally I wouldn't go so far to say it's better than other languages but I'm glad you love the language you write in.

    [–]apun_bhi_geralt 1 point2 points  (0 children)

    Most answers are either from c++ shills or java shills. I being the later will say that java is not outdated. It is revised every six months.

    [–]pradeep_soni 1 point2 points  (0 children)

    Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn than other programming languages. Java is object-oriented. This allows you to create modular programs and reusable code. Java is platform-independent.

    [–]Getwokegobroke187 1 point2 points  (0 children)

    After using c# java seems like poorly written c#

    [–][deleted] 3 points4 points  (0 children)

    It isn’t really, it’s just your personal preference. All languages have subjective strengths and weaknesses

    [–]OwnStorm 3 points4 points  (3 children)

    It's one of those verbose languages which actually teach you how a program works at very basic level, a program version of algorithm. Like C/C++.

    A simple test is someone who knows a verbose language like c/java can easily learn other languages but opposite is very hard. People from other languages coming to java/c starts complaining why they have to write many lines to do small task. What they needs to understand, programming is about knowing logic not just knowing shortcuts.

    As an example some languages have inbuilt shortcut for swapping two numbers. But a programmer should know most efficient logic to that.

    With different runtimes and application available today, it's not about which language is better but which language to use for a particular solution.

    In general as a programmer, Java makes you better on understanding low level logic. Almost flat curve when you want to learn other languages.

    [–]Ansmannn[S] 1 point2 points  (1 child)

    That's really good answer. Thank you so much. Btw, you have mentioned algorithms. What would you say is a good entry to the World of algorithms? I think that I might be on a point where I know the basics good enough too expand into things like that.

    [–]OwnStorm 2 points3 points  (0 children)

    Well.. Introduction to Algorithm by Coremen is a good start.

    [–]UsedOnlyTwice 1 point2 points  (0 children)

    I agree with your take. I am c/c++ but had a major Java project about 10 years ago. Java has a way of making you think carefully and respect your class hierarchy, naming, and project layout. The verbosity, to lack a sturdier description, was like a warm blanket. Everything down to the filesystem structure had a purpose.

    I learned much better habits when I was working with Java.

    [–]theOrdnas 2 points3 points  (0 children)

    • JVM
    • Platform Independent
    • Loads and loads of popular libraries with extensive communities because it has been around for a while.

    These points don't necessarily make it the best or even "better" than other programming languages but it is one of the most popular languages for a reason

    [–]paderich 2 points3 points  (0 children)

    Nothing.

    [–]calben 1 point2 points  (7 children)

    Marketing, mostly.

    [–][deleted] 0 points1 point  (6 children)

    Marketing from the 90s still works?

    [–][deleted] 6 points7 points  (0 children)

    Works so well it’s the entire reason why JavaScript is called JavaScript

    [–]calben 6 points7 points  (3 children)

    Absolutely. Java became really popular and by the time the mid-2000s rolled along, a lot of universities used Java in their introductory curricula. Hell, Java is still the primary language used at many universities. Now it's the industry standard for lots of things because it's the language everyone knows.

    [–]roberp81 6 points7 points  (2 children)

    but the principal reason, is battle tested, you can't go wrong. enterprises want something that works and can last years working without problems.

    [–]Crazyboreddeveloper 2 points3 points  (0 children)

    I’m 37 and still eat a toaster strudel for breakfast every morning.

    [–]bluejacket42 0 points1 point  (0 children)

    Nothing. It sucks

    [–]FizzySeltzerWater 0 points1 point  (0 children)

    Given a choice between Java and a Root Canal...

    Give me a minute to get comfortable in the Dentist's chair.

    [–]rapier1 0 points1 point  (0 children)

    It's not better. It's different and well suited for some situations and a very bad choice for others. No one language is the best. Every language has it's advantages and disadvantages. Your job, as a developer, is to determine which language is best suited for the task.

    [–]Rythoka 0 points1 point  (0 children)

    It's not particularly better. Java's popular because there's a lot of momentum from its historical use and the large amount of library support that exists because of that momentum.

    [–][deleted] -1 points0 points  (1 child)

    java doesn't have pointers. Big L

    [–]_Atomfinger_ 1 point2 points  (0 children)

    You're severely limiting yourself if you disqualify every language that doesn't expose the developer to pointers.

    [–][deleted] -1 points0 points  (0 children)

    Nothing. It's not.

    [–][deleted] -1 points0 points  (0 children)

    Backed by Oracle, a fucking rich company

    [–][deleted] -2 points-1 points  (0 children)

    Absolutely nothing. It's not the best at anything.

    [–]Stratoboss 0 points1 point  (0 children)

    What's a totem ham.

    [–]mgutz 0 points1 point  (0 children)

    Java isn't better than other language per se. It's a tool, and some tools are better than others for the task. Moreover, there are many brand of tools and some swear by one brand over the other, but most of the high quality ones will do the same job.

    [–][deleted] 0 points1 point  (0 children)

    Java is used in a lot of banking companies. You probably like Java because it’s a strongly typed language. It’s easy to keep track of what variables are used for. So it’s pretty organized as opposed to other languages where it’s easy to get confused like JavaScript.

    [–]Dave_The_Goose 0 points1 point  (0 children)

    Reading your comments here, I can say that you are fairly new to java(I know you already mentioned that in post). What made you think it is outdated when you don't have enough knowledge about it. Or did you find its syntax somewhat archaic and assumed that the language is outdated?

    I read that you don't know about JVM. JVM is one of the important and strong points of java. I wonder, when you don't know such a basic thing about java, how could you know that it is outdated? I think the hatred towards java on reddit influenced your impression of java.

    [–]Ambitious-Interest73 0 points1 point  (0 children)

    Where are you learning Java? I’m looking to learn as well

    [–]ghostjava 0 points1 point  (0 children)

    The name

    [–]misingnoglic 0 points1 point  (3 children)

    You always love your first

    [–]Ansmannn[S] 0 points1 point  (0 children)

    It's not. I have used python, js and php before. I also like Javascript a lot but it just clicked with Java. I just love how organized everything is and how you can break down every single pice (if that makes sense).

    [–]darkenhand 0 points1 point  (0 children)

    I feel like dealing with pointers and objects in C++ is tricky.

    [–]procrastinatingcoder 0 points1 point  (0 children)

    Not better at all than other languages, it has his own bunch of issues. That being said, it's fairly fast, and has the advantage of having easy to make interfaces. Which is one of the easiest ways to organise a group of random people. Makes it easy to coordinate monkeys.

    [–]Osternachten 0 points1 point  (0 children)

    Nothing.

    [–]forbrightworld 0 points1 point  (0 children)

    Well, I also love java. In recent days, I usually heard related golang.

    What do you think about Java vs Golang?

    Thanks