Print vs Puts vs P vs putc
- Print:
- Doesn't move to the cursor to the new line.
- Same as
.print
in Java instead of.println
- Puts:
- Creates a new line and moves the cursor to the new line.
- Same as
.prinln
in Java.
- P:
- Displays the raw object.
- Even espace characters on a string is displayed.
- Helpful for debugging.
- putc
- Only prints 1 character at a time.
For more details: https://www.rubyguides.com/2018/10/puts-vs-print/