Include vs Require


#1

Other than the syntax, I don't understand the difference between include & require.

Can anyone elaborate?


#2

@jaydacoder,
Maybe a google search would put you on track...
== discussions / opinions ==
ruby include vs require site:stackoverflow.com


11. require vs. include
#3

Not a fan of stackoverflow. Really don't like the way it's laid out.

But isn't the point of these forums for support, to help one another, and build a database of discussions for other users.


#4

I am resurrecting this topic now. but :slightly_smiling:

If you are just plan to use module or module functionality then you just require file, or module, where if you need or plan to extend or overwrite module, class or whatever than you will use include. That is why you actually require 'gems' in your Rails projects instead include them.