3 ms·
Global scope is not a terrible invention and if you look carefully then you will notice that the Java version uses it as well. Or where is the import to get "S
by valenterry 5y ago
Global scope is not a terrible invention and if you look carefully then you will notice that the Java version uses it as well.
Or where is the import to get "System" into scope? It's imported globally everywhere (just like all everything from java.lang).
So the only question is: should "print" be burried under layers or not. I don't think the advantages of burrying are really worth it.
- kaba0 5y agoOP meant the public static void main part (that is you define what happens encapsulated in a class) Of course implicit imports are needed, like what else would you have without?
- valenterry 5y ago> that is you define what happens encapsulated in a class Apart from that it is really unintuitive to have something "static" within a class (which is commonly understand as a template), it is not encapsulated because it is static _and_ public. _And_ now you can search for this thing everywhere - and what happens if you find two of them? Yeah no, the idea of "public static void main" wasn't a great one, no matter how I look at it. It's much better to be explicit and ask the user to decide which file they want to use as the starting point. > Of course implicit imports are needed, like what else would you have without They are of course not needed. You could also just import everything manually. Okay, Java's import suck, but in a better language you could do "import prelude._" in the beginning of every file and otherwise you are left with keywords only. Not saying that's a great idea, but it certainly can work without implicit imports.