Quote:
|
Originally Posted by Adak
Bitwise, can you explain what the rationale was for making constants which could be changed?
|
I wish I could. I personally can't see any logic in this.
I like Ruby a lot but there are things about the language that drive me up the wall. Although it comes very close to being 'pure OOP' it has a number of very un-OOP features such as badly broken encapsulation (data hiding is not properly implemented). I am also unconvinced by the necessity to have half a dozen ways of doing the same thing (how many loop structures does anyone really need???)
The trouble is that you can 'get away with' a lot of nasty coding in Ruby. I see many Ruby programs in which people create huge classes with methods containing vast amounts of code. I keep thinking that anyone who really wants to write elegant and maintainable programs in Ruby would do well to learn Smalltalk first. A typical method in Smalltalk would contain between 1 and 10 lines of code. A method of 20 lines would be considered to be fairly long...
Ruby
can be a very neat and clear language. But it can equally be used to write extremely messy and ambiguous code. In my opinion, some features of the Ruby language (poor encapsulation, inconstant constants, too much syntax duplicating functionality, some ambiguous syntactical constructs) actually encourage poor coding style.
best wishes
Huw