Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Why I love everything you hate about Java

If you’re one of those hipster programmers who loves Clojure, Ruby, Scala, Erlang, or whatever, you probably deeply loathe Java and all of its giant configuration files and bloated APIs of AbstractFactoryFactoryInterfaces. I used to hate all that stuff too. But you know what? After working for all these months on these huge pieces of Twitter infrastructure I’ve started to love the AbstractFactoryFactories.Let me explain why. Consider this little Scala program. It uses “futures”, which are a way to schedule computation to be done in parallel from the main flow of a pro...

7,105 0       JAVA COMPARISON MODULARITY API


  Java is not the new COBOL

If you Google “Java is the new COBOL” you’ll find a glut of articles proliferating this mantra. I don’t know its origins, however I’m inclined to think it’s mostly repeated (and believed) by the Ruby community. Ruby, from a developer’s perspective is a low-friction language. A developer can just sit down at a text editor and start banging out code without really thinking about such superflous things as types. Java on the other hand, well, you have to think a lot about types. Java is a statically typed language after all, and it makes the deve...

2,426 0       JAVA COMPARISON RUBY TYPE COBOL


  Ruby is beautiful (but I’m moving to Python)

The Ruby language is beautiful. And I think it deserves to break free from the Web. I think the future of Ruby is firmly stuck in Web development, though, so I’m going to invest in a new language for data analysis, at least for now. This is a look at the fantastic language I came to from Java and a look at a possible candidate. (Update: I’ve since written a followup.)Java to RubySix years ago, I added Ruby to my technical arsenal. I learned C++ and Java in high school, and I planned to use them for data analysis in college—mainly for research kung fu. But when I disco...

12,205 0       JAVA COMPARISON RUBY ADVANTAGE PYTHON RUBY VS PYTHON


  C vs Java Complete Comparison

Similarities:Java and C have same syntax operators.Difference—thinkingTwo paradigms:Java: Object oriented languageC: Structured languageDifferences: --SyntaxNo preprocessorJava does not include a preprocessor and does not define any analogs of the #define, #include, and #ifdef directives. Constant definitions are replaced with static final fields in Java. (See the java.lang.Math.PI field for an example.) Macro definitions are not available in Java, but advanced compiler technology and inlining has made them less useful. Java does not require an&nbs...

34,686 7       JAVA COMPARISON C DIFFERENCE SIMILARITIE


  Can private method be overridden?

The private methods are not inherited by subclasses and you cannot be overridden by subclasses. According to Java Language Specification (8.4.8.3 Requirements in Overriding and Hiding), "Note that a private method cannot be hidden or overridden in the technical sense of those terms. This means that a subclass can declare a method with the same signature as a private method in one of its superclasses, and there is no requirement that the return type or throws clause of such a method bear any relationship to those of the private method in the sup...

3,459 0       JAVA PRIVATE METHOD OVERRIDDING IMPOSSIB


  Java Polymorphism and Overriding Methods

Most Java developers will be familiar with polymorphism – we’ve all seen the example of the Dog and Cat classes inheriting from some abstract Animal class and having their say() methods produce different results. But it’s still worthwhile to look at a few simple examples to reinforce the concepts.First, we define a simple class with one instance method and one static method.public class A{ public String getName() { return "I am A"; } public static String getStaticName() { return "Statically A!"; }}Then we extend that clas...

2,743 0       JAVA POLYMORPHISM DEMO OVERRIDING DYNAMI


  Command Line Arguments

Our Hello program still isn’t very general. We can’t change the name we say hello to without editing and recompiling the source code. This may be fine for the programmers, but what if the secretaries want their computers to say Hello to them? (I know. This is a little far-fetched but bear with me. I’m making a point.)What we need is a way to change the name at runtime rather than at compile time. (Runtime is when we type java HelloRusty. Compile time is when we type javac HelloRusty.java). To do this we’ll make use ofcommand-line arguments. They ...

2,207 0       JAVA COMMAND LINE ARGUMENTS FIRST ELEMEN


  Java’s toLowerCase() has got a surprise for you!

Have you ever encountered a surprise while using toLowerCase()? This is a widely used method when it comes to strings and case conversion. There is a nice little thing you should be aware of. toLowerCase() respects internationalization (i18n). It performs the case conversion with respect to your Locale. When you call toLowerCase(), internally toLowerCase(Locale.getDefault()) is getting called. It is locale sensitive and you should not write a logic around it interpreting locale independently.import java.util.Locale; public class ToLocaleTest {  ...

2,725 0       JAVA TOLOWERCASER() LOCALE SPECIFIC STRA