Hacker News new | past | comments | ask | show | jobs | submit login

>Is Java clean and beautiful? Sure, it's easy to read and just about anyone who has read any other language can figure out what's going on.

Easy to read? What? Let me do a simple comparison. Let's say there's a site, ycombinator.com, that wants to ban anyone who posts "First post!" on a story. Here is what the python code would look like:

  if "first post!" in comment.text.lower():
      comment.user.ban()
Here's what the Java code would look like:

  public static void class PostPunisher extends PostHandler raises Exception {
    public void PostPostHook(Comment comment) {
      if (comment.text.to_string().to_lowercase().contains_substring("first post!")) {
        comment.User.Banner.execute();
      }
    }
  }
Well, I left off a few factory factories there, but you get the picture.



You're being obtuse just to be obtuse. This is exactly the type of nonconstructive feedback that does no one any good.

There is no difference in your python code than the Java code that someone would write:

  if(comment.getText().toLowerCase().contains("first post!"))
  {
    comment.getUser().ban();
  }
Java doesn't require a class, it doesn't require a method, it doesn't require a factory. There is literally zero difference between the python example and my Java example except the syntax between the languages.

You just felt the need to unnecessarily obfuscate the code to suit your argument.


Do you disagree that Java typically requires the additional boilerplate I showed?


I believe my last post clearly showed that I disagree.

There is no 'boilerplate' required with Java. Anyone can obfuscate Java, or any language, and make code that is overly and unnecessarily complicated. Some do it because they don't know better. Some, like yourself, just do it to be an ass.


I wasn't doing it to be an ass. Even if you are allowed to manipulate the class function you're dealing with (and so spare new classes), most java code does look like the example I gave: lots of verbiage, having to create special classes (including [verb]-er classes). Very, very unpleasant to read, and not big on beauty either.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: