Ruby - What is the use of load and require in ruby?

What is the use of load and require in ruby?

The ‘load’ and ‘require’ both are used for loading the available code into the current code. ‘load’ always reloads the code every time. Autoload is always sounds good and it is suggested to use ‘require’.

In the case where loading the code every time when changed or every time someone hits the URL, it is suggested to use ‘load’ which is reasonable.

What is the use of load and require in ruby?

Reuire() loads and processes the Ruby code from a separate file, including whatever classes, modules, methods, and constants are in that file into the current scope.
Load() performs the inclusion operation once, it reprocesses the code every time load is called.
Ruby - Explain the use of global variable $ in Ruby
If you declare one variable as global we can access any where, where as class variable visibility only in the class.......
Ruby - Difference between nil and false in ruby
False is a boolean datatype, Nil is not a data type........
20 Python Interview Questions and Answers - Freshers, Experienced
Python interview questions - What is Python? State some programming language features of Python, Explain how python is interpreted, What are the rules for local and global variables in Python?
Post your comment