Forum: Ruby Which is the preferred way?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7070c0ca59124b4d96dd27ea52ad359e?d=identicon&s=25 Jeffrey Bowen (Guest)
on 2007-08-02 21:04
(Received via mailing list)
I see that “p” is the same as “puts”.  Which would
most programs use in a program?

Jeff
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (regularfry)
on 2007-08-02 21:15
(Received via mailing list)
Jeffrey Bowen wrote:
> I see that “p” is the same as “puts”.  Which would
> most programs use in a program?
It's not the same - p foo is equivalent to puts foo.inspect.  They're
used for different things; p is for debugging output, puts for general
text display.
This topic is locked and can not be replied to.