-
-
Notifications
You must be signed in to change notification settings - Fork 36
Adds a cheatsheet for Java fixes issue #42 #45
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
Adds a cheatsheet for Java fixes issue #42 #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaves the repo in a broken state. Maybe you have some uncommitted changes?
- The closing tag of the index needs to be replaced. Maybe you accidentally deleted it?
- You need to change main.ptx to include the new appendix where it should go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better, but it needs a full checkover. Here are some issues I see immediately:
- Floor Division //: This operator does not exist in Java. Java uses regular / for division, and for integer division, you'd use / with integer operands or Math.floorDiv().
- Exponent **: This operator does not exist in Java. Java uses Math.pow() for exponentiation.
- Logical operators and, or, not: These are Python operators, not Java. Java uses &&, ||, and !.
There is a LOT here! Often, less is better than more. I recommend we only include things that are discussed in this text, which is supposed to be a simple transition. Do we really want bitwise operations, for example?
This is much improved! Let's make a few more changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments above.
Also, The code Iin the intStream.range(0, 10).map(i -> i * i).boxed().collect(Collectors.toList())
seems overly complex for a cheat sheet meant for Python-to-Java transition beginners because it is likely to create more confusion. A simpler example would be better. Please replace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
This adds Python and Java equivalent functions, operators, and one-liners to show how different operators are. This should help the students with Python knowledge.