Whats the Ruby Difference Between the 3 “P’s” Print, Puts, and P

  • Puts
  • Print
  • P
  • PP

P

Comparing the previous methods, Print and Puts, there are some serious differences between those and P. P will print out a more “raw” object, it does this by using the inspect method to convert the object to a string.

Using P to print a large hash
Using PP to print a large hash

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store