5 ms·
I maintain a large set of codebases right now, and the most easy to maintain is certainly the components written in a dynamic language (Lua). Its so darned ple
by fit2rule 13y ago
I maintain a large set of codebases right now, and the most easy to maintain is certainly the components written in a dynamic language (Lua). Its so darned pleasant to return to that module, after dire straits suffered in Java- and C#- realms, that I'm seriously considering just moving everything to Lua, from here onwards.
So I don't know if I have an answer to this question -but certainly it appears, to me, that the more dynamic the language is - the easier it is to maintain .. certainly the mere fact of lighter tooling means this is true?
- humanrebar 13y ago> I maintain a large set of codebases right now... Does that mean you have a large set of small-to-medium-size code bases? Because, though that's also a hard problem, it's different than maintaining one huge code base.
- fit2rule 13y agoThe Java codebase is 170k lines. C#, about the same. Lua, about 45k. I don't know if thats a lot of little codebases, but sometimes it feels seriously dystopic moving around the Java stuff.
- humanrebar 13y agoWell, huge is relative to many things. Thanks for the ballpark numbers though. Pain points change and intensify over different orders of magnitude.
- _random_ 13y agoSo how do you refactor a method signature to swap argument order in Lua? Please don't answer "manually".
- malyk 13y agoWhat's wrong with doing it manually, especially if you have good tests?
- kasey_junk 13y agoIt's error prone and time consuming. How do you promise that your tests cover every instance of calls to that method? How do you make sure that you are only changing the correct method (especially when it has a common name)?
- erichocean 13y agoIn 15 years of coding, I've need to do that exactly zero times. Is this really something people are doing?
- kasey_junk 13y agoIt's an extremely common refactoring in modern Java/C# IDE's. Swapping arguments isn't necessarily a big deal (but being able to do it safely and automatically means that there is also no cost). A bigger one is adding/deleting parameters or renaming methods.
- fit2rule 13y agoI don't understand why it would be necessary to refactor the argument order for methods that are extensively used. Can you provide a productive example for when this might be an appropriate action for a developer to take - I'm having difficulty understanding why on Earth this would be necessary, but I'd be happy to learn ..
- kasey_junk 13y ago"Necessary" might be a hard barrier to get over, but I can think of times when it might be nice. For instance in C# optional parameters must be at the end of the parameter list (that is all required parameters must come before any optional ones). So for our highly used method we realize that there is actually a reasonable default for the first parameter (maybe because we notice tons of usages of that value). In order to change this from a required to an optional field, we must move it to the back of the list. Without an automated and safe way to do this, I'm unlikely to make that refactoring, leaving us with a code base that is worse than it could be. Again, is it necessary? No, but if it is trivial my code will get better, if it isn't my code will stay worse.
- fit2rule 13y agoUmm .. I don't? Seriously, who needs to do this? Never had to do it in Lua. Same with Java, although I could see a case where it might be 'necessary', I still don't agree that its a good thing that the language promotes this activity. Needing to do this indicates worse problems with the developer than the fact of a codebase being too unwieldy.
- ygra 13y agoThe language just promotes that it's easy to parse so that tools can be written to automatically transform source code in certain ways. Eclipse has a lot more refactorings than just reorder method arguments. Lua should theoretically fall into the same bucket of languages, it's just that there probably are fewer tools for refactoring so far. Compare that to languages like C++ where despite its age and being used to widely there are still very few working refactoring tools. (All that being said, I usually used method argument reordering when removing or adding arguments to a method by changing what the method is doing and then noticing that a different order makes more sense when reading.)
- jnbiche 13y agoDo you have complete unit test coverage for that Lua code base? I'm starting to build a pretty large piece of software and am struggling with this question right now. I'd much rather work in Lua or Python, but I've seen and worked on so many large Python projects that are absolutely unmaintanable and poor-performing that I hesitate. However, those projects all share a gratuitous use of threads, which I think is a poor idea in any language, but particularly in Python.
- fit2rule 13y agoAlmost a complete unit-test set. Its something thats being worked on. But .. I really do think I have a future as a 100%-Lua user, across the full stack. From mobile/desktop client to backend, and persistence. I'm just not finding much energy to deal with all the cruft of the other languages, while Lua just gives me all I need, and leaves me alone. I don't know if I'm becoming myopic in my old age - possibly - but the more I think about where I can place that sticky little VM, the more I think I just don't care about much else but doing that, a lot...
- erichocean 13y agoPlus, LuaJIT is a seriously nice piece of engineering, and it's easy integration with C is just so damn nice. :)
- fit2rule 13y agoExactly! C for the systems-layer, Lua for everything else, LuaJIT for the customers! :)