Arc Forumnew | comments | leaders | submitlogin
2 points by aw 5776 days ago | link | parent

I've upgraded my code on every Arc release since arc0, and it's been easy.

This may sound overly simple compared to building a translator, using namespaces or modules, or writing in layered API's, but in practice this is what quickly results in working code for me: in my source code file, I merely arrange my definitions so that definitions that depend on other definitions always appear after the definitions that they depend on.

For example, if h uses g and g uses f, I write out the definitions with the lowest level code appearing in the file first: f, then g, and then h.

(On occasion I'll have mutually recursive functions; those I'll just put next to each other in the source code file. And when I have multiple source code files, I follow the same principle: I ensure that I can order the source code files so that later files depend on code in earlier files, but no earlier files depend on code in later ones).

Now it is simple to upgrade the code in my source code file to a new version of Arc: first I get f to work, then I get g to work, and then I get h to work.

Each step is quick: most often the function doesn't need a changes to work in the new version of Arc, and if a change is needed it's just a tweak.

No massive monolithic all-at-once conversion needed.

And there's no pressure. My code still works with the previous version of Arc that it is running on. So I can convert over to the new version at my leisure. When I'm ready.

Even if someone wrote a translator, I wouldn't use it myself. It would add an extra layer of complexity (if I have a bug, is it in the new version of Arc, or in my code, or in the translator?), and I wouldn't need it.