Live data from Hacker News

Ask HN: Why not Java?

news.ycombinator.com

91–100 of 112 posts

Re: Ask HN: Why not Java?

#91
post #54

It's just that Java is very verbose, and actually I found it particularly horrible for data driven applications (by this I mean apps whose behavior is determined by data/config files, not "Big Data" - I have no experience with the latter). For complex data types you always need to create complex class hierarchies. In other languages you could just write webInfo = {url: "bla.bla", title: "bla die blub", links: ["link1…

link can be a single String? I can see here new "info = new WebInfo(title, url, new String[]{link1, link2,...});" that it can't. This is the kind of thing you get with a typed object. Also, instead of Strings for title, url, etc you could use tiny types. Yes, it is a lot more verbose, but it comes with a advantage (compile time erros over runtime erors). TinyType also documents what you should pass for the constructo…

If you enjoy that kind of programming, sure, go for it. It certainly is possible to program a crawler in Java. Personally I can't go back since I experienced more succinct languages.

Also beware of pseudo work: I suspect Java is partly popular because it makes you feel productive. You are constantly busy creating Tiny Types (as you call them), generating code in Eclipse (cool: one click and you have 50 lines of code in your class) and so on. It is all just pseudo work that accomplishes nothing, but maybe feeling productive is worth it.

Re: Ask HN: Why not Java?

#92
post #85
post #81

Earlier quoted context omitted.

Because it's DRY-Principle. It's doesn't matter trivial or not. If you distribute you 'trivial' constructions over whole application, you doesn't have any chance to have consistent, robust processing. If you collect/group things logically, you can easy find out where you (re)use constructions and what you can break, if you change it. It's not over-engineering, it's just how to deal with >300 People and >6 years proje…

It's just a list comprehension. Do you imply I should use a function instead? Why not use a very nice syntax feature every Python developer can understand? Because if you do, I'd advise you not to add integers with the "+" operator, but, instead, build a class with various add methods for different types of arguments or, better yet, build add methods into every class you define so that you can better search for them.…

I give up. You're like a little kid. Codesize or verbosity doesn't matter. Quality is a keyword and it resulting in sustainable pace. If you doesn't understand this, nobody can help you. Your arguments are like as "Why I should use TDD, if I can write code directly".

Re: Ask HN: Why not Java?

#93
post #25

Java is good enough for all types of projects. People hate Java because... they can't Java right. Personally, I very like Python and JavaScript and features like multiple inheritance or prototyping, higher-order functions and so on. But Java is better sufficient for projects which more complex as "Hello world", because type safe (robust, compile-time feedback), excelent IDE support and incredibly fast and allow fast…

There are plenty of reasons other than people being unable to "Java right", though I'm not saying that Java doesn't get plenty of hate out of ignorance.

A good example of when you can't use Java would be embedded projects or projects where you need to squeeze even more performance out of your code. Java is fast but it isn't the fastest.

Feel free to love your language of choice but I'd recommend not letting it get in the way of common sense.

Re: Ask HN: Why not Java?

#94
post #49

Earlier quoted context omitted.

I pointed one module out - Spring-Velocity integration. "Of course, now they want to be the 'glue layer' of everything, including Spring-Data for NoSQL (Neo4J and co.)." Why do you need this? It's just Java and you can... just use it. Without glue. "Speaking of which, your last statement is partly correct if only Spring == Spring Core. There's no MVC (in the sense of ASP.NET MVC or Rails MVC) in JEE yet (yet because…

You pointed one module, as an example that describes the whole Spring as one unified framework. Spring consists of multiple modules that you absolutely _don't_ have to use. This is where, I think, you misunderstood Spring. When it comes to the modules, i.e.: Spring Core, Spring Transaction, Spring-Data sub-modules, Spring eventually use the JDK and/or 3rd-party API (possibility, in the case of Neo4J etc). Yes, you ca…

I can pick other module... for example key-value. Wich benefits I have with key-value module? I don't need "integration module" for this job. Compare http://static.springsource.org/spring-data/data-keyvalue/doc...

and

https://github.com/xetorthio/jedis/blob/master/src/test/java...

I don't see any benefit or better programming experience or more features on top.

Other modules? You mentioned:

Spring Security/Acegi - Java EE do the job also. Seamless integrated with EJB and other technologies.

Spring Transaction - also.

I mean I see no reason to use Spring or any glue.

"ASP.NET MVC and Rails MVC": this is not Spring vs. Java EE question. I like Django and Wicket and it's much better as Java EE and, of course, Spring.

Map to function or to class - doesn't matter. It's same. Spring is same MVCM2. Why I should prefer write tons of xml crap, if I can use powerful workflow engine like Activiti, AristaFlow or jBPM or others? :)

Re: Ask HN: Why not Java?

#95
post #25

Java is good enough for all types of projects. People hate Java because... they can't Java right. Personally, I very like Python and JavaScript and features like multiple inheritance or prototyping, higher-order functions and so on. But Java is better sufficient for projects which more complex as "Hello world", because type safe (robust, compile-time feedback), excelent IDE support and incredibly fast and allow fast…

There are plenty of reasons other than people being unable to "Java right", though I'm not saying that Java doesn't get plenty of hate out of ignorance. A good example of when you can't use Java would be embedded projects or projects where you need to squeeze even more performance out of your code. Java is fast but it isn't the fastest. Feel free to love your language of choice but I'd recommend not letting it get in…

Java bytecode is very compact and used also in embedded systems. Java can be predictable.

Can you show some benchmarks compare java w/ jit and other languages?

I love another language, but Java is better choice.

Re: Ask HN: Why not Java?

#96
post #92
post #85

Earlier quoted context omitted.

It's just a list comprehension. Do you imply I should use a function instead? Why not use a very nice syntax feature every Python developer can understand? Because if you do, I'd advise you not to add integers with the "+" operator, but, instead, build a class with various add methods for different types of arguments or, better yet, build add methods into every class you define so that you can better search for them.…

I give up. You're like a little kid. Codesize or verbosity doesn't matter. Quality is a keyword and it resulting in sustainable pace. If you doesn't understand this, nobody can help you. Your arguments are like as "Why I should use TDD, if I can write code directly".

You call me a kid because you claim using a single line syntactic feature of a language isn't maintainable. It's like claiming for loops are unmaintainable and that we should wrap them inside methods.

It's not people hating Java: it's you afraid of looking at other tools.

Re: Ask HN: Why not Java?

#97
post #67
post #16

Earlier quoted context omitted.

Well, for starters the whole idea of programming in XML. That and gems such as http://static.springsource.org/spring/docs/2.5.x/api/org/spr... or http://static.springsource.org/spring/docs/2.5.x/api/org/spr... Of course I can't a priori prove that Spring is garbage, much like I can't a priori prove that it's better to be healthy and rich than to be poor and sick. It is a judgement call, but a judgement call that I be…

The word "SimpleBeanFactoryAwareAspectInstanceFactory" reflects everything I hate about Java and it's intended approach to OOP.

You doesn't use autocompletion? o_O But it's much much better as simple_bean and you have not clue what it do.

Re: Ask HN: Why not Java?

#98
post #97
post #67

Earlier quoted context omitted.

The word "SimpleBeanFactoryAwareAspectInstanceFactory" reflects everything I hate about Java and it's intended approach to OOP.

You doesn't use autocompletion? o_O But it's much much better as simple_bean and you have not clue what it do.

I've got an autocompletion feature up and running, but I'm usually not dependent from it. However, that wasn't my point. I wasn't complaining about long class names. That's just a bonus. I was complaining about the misuse/overuse of design patterns throughout the Java Standard Library as well as Swing.

See, design patterns are a thing that's nice to have but some of them are more like cheap hacks that have made it into an influential book rather than mandatory patterns. I'd go as far as claiming that some of these patterns are merely a way of hiding what's fundamentally broken about OOP in a language where it's the only paradigm and where it is strongly enforced - like Java.

Re: Ask HN: Why not Java?

#99

Earlier quoted context omitted.

Sure, I can elaborate. The idea is that as a programmer, you have to have an intimate understanding of what is going on in order to make the machine do your bidding quickly and correctly. But that mediocre Eclipse user I caricaturized does not have that understanding. He certainly knows how to get the job done for a certain set of tasks, but he does not know the details of how this is happening. Thus, he creates prog…

From what I see, knowledge comes from experience and study. An IDE doesn't magically separates you from the need to know how stuff works. What you describe is a unexperienced programmer, but those exist in any area, using or not a IDE. From what I understood you, your see a problem with code generated by a wizard or by an automated process and if that's your point I agree, but that's not how eclipse is used. Besides…

I agree that an IDE does not separate from the need to know how stuff works. But I certainly know a few programmers who do not dare to think beyond what their IDE allows them to do. They use built-in wizards and refactorings, but they do not seek solutions that are not easily expressible with those.

Hence, their code is factored just the way the IDE would, even if there are better alternatives available. This is the kind of mediocrity I am talking about. (And by the way, you could go much worse than Eclipse at that)

I actually had quite a few discussions where the main misunderstanding was that we used different tools and thus thought of different things as "easy" or "natural". In one case, one developer argued that it would be a good idea to create a whole bunch of classes to encapsulate a problem space. However, creating all these classes really would not have been necessary at all, he could have accomplished the same goal with a much simpler list of functions. Thus, we ended up with a HUGE file containing some several dozen classes that no-one but him could navigate, because it was factored just right for his programming editor but was all but unusable for anyone else.

One developer even told me that he did not know how to write a correct if statement in C because his editor had a template for that. What my argument boils down to is that this kind of behavior is bad, and I have seen it becoming a sad kind of sub-culture in Eclipse/Java land.

That said, I completely agree that if used correctly, there is nothing inherently wrong with Eclipse or Java per se.

Re: Ask HN: Why not Java?

#100
post #27

The best reason to use Java is the enormous ecosystem of libraries and resources. The best reason to AVOID using Java is the huge demand for Java programmers and the low supply. At my job we can barely find applicants with Java so we end up hiring .NET people and converting them.

Wow, that's almost entirely the opposite problem I've found in Bristol (UK). There seems to be a lot of people that have stuck with Java after graduating from university and a severe lack of any mid-to-senior level .NET developers.

Out of interest, how do these guys find the switch to Java from C#, assuming they're not VB.NET guys?

Post reply on HN