3

I'm trying to port that Python project (https://github.com/rg3/youtube-dl/) to Java without even knowing how to print "Hello world". That's going to take a long long time

Comments
  • 2
    Interesting.
    Well, if you're mostly a Python person, you may have already been amazed at how verbose and explicit Java is.

    // Java:

    public class HelloWorld
    {
    public static void main(string[] args)
    {
    System.out.println("Hello, World!");
    }
    }

    // Minimal minified Java version:
    // (All on one line)

    public class H{public static void main(string[] args){System.out.println("Hello, World!");}}

    Does the same as:

    # Python 2.x:

    print "Hello World"

    # Python 3.x:

    print("Hello, World!")

    ...yeah. 😂
  • 1
    @corscheid Oops, I think I made a mistake in writing: I know Java, but I don't know Python!
  • 2
    @Gianlu oh then you'll be amazed at how easy it's going to be. Unless you try to over think it and translate literally how the Java is written.

    Also, when creating objects, self is gonna be fun. XD

    class MyClass:
    def __init__(self):
    # this is a constructor, lol
    # ...
    def method(self, arg1, arg2):
    # weird huh
    # ...
  • 2
    OP please try to write pythonic code and not literally translated from Java bullshit.
  • 1
    Love that word. Pythonic.

    Yeah every language has its idioms :)
  • 0
    All C-style languages are explicit. I wouldn't call it verbose, everything has a purpose.
Add Comment