Future-proofing your code

Say that we have extended the + function in Base as follows:

module MyModule
import Base.+
(+)(s::AbstractString, n::Number) = "$s$n"
end

It may seem to be a great addition today; however, there is no guarantee that the same function will not be implemented in a future version of Julia. It is conceivable (which is not to say that it's likely or unlikely) that the + function will be enhanced to work with strings in the future. 

In addition, these kinds of changes would be considered nonbreaking, meaning that the Julia dev team can add this feature with just a minor release. Unfortunately, your application now breaks for a nonbreaking Julia upgrade. That's not something that we normally expect.

If you want to future-proof your code, then do not be a pirate! 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.237.24