Hacker News new | ask | show | jobs
by yeputons 1678 days ago
I don't see much difference between `System.out.println` and `print`. Both should be spelled exactly as they are. You cannot say `write`, `say` or `Print` in Python despite it being somewhat synonym to `print` in English.

They are parts of syntax, and any language will have some syntax to learn, and there are always syntactic quirks.

Granted, Python has lighter syntax than Java, but I don't think Java is too verbose for beginner's purposes.

2 comments

what's System

what's out

why is there a period, what does that mean

what's ln

what's pubic

what's static

what's void

what's main

what's String[]

what's args

Java is as verbose as it gets with lots of unnecessary information at a beginner level

Why parenthesis? Why is the string quoted? Why I cannot write `print("a") print("b")` on the same line? Why `print`, if it shows on a screen, not a printer? What is `.py`? What is file? Why `write` on a file does something different than `print`?

I agree that Java shows you more syntax which is intimidating. But the answer to all these questions for all languages is: "it's a special syntax, you should write it exactly as it is. We will learn more details later in the course". There is literally no need to dive in. You wouldn't dive to variadic functions, builtins and CPython implementation details when asked about the name `print` or how it can take multiple arguments, would you?

You get some kind of syntax questions no matter what programming language you teach, even Python. Granted, there may be less with Python in the beginning, but in lots of scenarios the difference is negligible.

I think AP's point here wasn't that command, it's all of the class structure required to get to the coding. You either have to introduce that as "don't worry about that, it'll come later" or introduce OOP basics on the way to simply stating hello world.
Yes, and I would say "don't worry about that, it'll come later, it's boilerplate". Same as I would do with `import` in Python, actually.