Programmers like to take a longer break far away from their daily lives. They can write a code in the comfortable conditions, for example at the sea coast. Changing a location acts as a refresher. It gives them vitality they need to finish writing the code. The location they choose for the vacation are different and depends on the programmer’s personality. While some of them prefer the sea, others choose rocky mountains. Then there are those who prefer crouded cities. Anyway, when you are a ruby developer, it doesn’t matter where you are, you will need the following smart tips for your work:
1. Operator converts any value on type boolean.
foo = Object.new
2. If you pass a block to File.open method, after that you don’t have to concern about the closing the file. The record is as follows:
file = File.open(“file.txt”, “w”)
is equivalent to:
File.open(“file.txt”, “w”) do |file|
3.Checking quickly the file. rb in terms of syntax without executing it:
ruby -c file.rb
Additional information (for example about assigned but not used variables);
ruby -wc file.rb
Your coding vacation will be really awesome! Warm and sunny August brings all good for #SummerSoftware!