Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static typing? #84

Open
daw42 opened this issue Jul 12, 2015 · 3 comments
Open

Static typing? #84

daw42 opened this issue Jul 12, 2015 · 3 comments

Comments

@daw42
Copy link

daw42 commented Jul 12, 2015

I just found this project, very nice work! Have you considered using a more strict type system in the REPL? In the current version, data types for variables can change during the session, and variables can be created without being declared. For example:

java> int a = 3;
int a = 3
java> a = 42.0;
java.lang.Double a = 42.0
java> b = 15;
java.lang.Integer b = 15

I'd love to use this project for teaching Java, however, this "dynamic typing" makes it poorly suited for education. When teaching about data types, students need to understand that a variable's type does not change after it is declared, and that all variables must be declared.

Have you considered adding a mode that strictly follows Java rules for types/declarations?

@ioistired
Copy link

👍

@bmaca
Copy link

bmaca commented Dec 17, 2015

Agreed 👍

@asgs
Copy link

asgs commented Jan 25, 2017

I wouldn't necessarily agree with making stricter because that's how JShell (Java9+) works too. Of course, your point that beginners will construe this behavior as if Java does Dynamic typing is accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants