4 ms·
For core services like BIND I don't see any good reason to write them in more than one language (actually anything other than C/C++) and introduce cumbersome de
by przemoc 14y ago
For core services like BIND I don't see any good reason to write them in more than one language (actually anything other than C/C++) and introduce cumbersome dependencies because of that. I wouldn't complain if it was some another DIY name server toy created for whatever reason (how much time it would take..., I can do it!, etc.), but it's software that will become widely deployed in upcoming years (almost) without doubt.
How much more work these 17% done in Python would take to be (re)written in C++? Would it make the code that much worse in terms of quality and managability? Having coherent, one-language codebase, is a good feature on its own too, often improving above mentioned factors.
- mattmanser 14y agoYou can look at the source yourself. I don't understand either, randomly opening parts of both the Python and C++ and it's certainly not complicated and they write the Python in a C style anyway. I'm not a C++ coder and I only play with Python now and then, but can't say the code impressed me much. It's actually pretty hard to skim the code because it's massively over-commented and there are far too many tiny 2-line private functions that are called by exactly one other 2-line private function that is called by exactly one other 2-line function. Or Holographic code as John D. Cook called it[1]. And the copyright notice in every source file is extremely irritating. Far too high noise to code ratio for my tastes, so I got bored before I could really 'see' how the Python had helped. but I can't judge that well as I'm not sure if that's all just a bi-product of using C++ and being an open source project that comes out of committee. [1] http://www.johndcook.com/blog/2012/01/09/holographic-source-code/ http://www.johndcook.com/blog/2012/01/09/holographic-source-...
- eru 14y agoIn general, abstracting code out into functions can be useful, even when the new functions is only called once. That is because functions are a well understood abstraction. And having code separated into functions makes it easier for the reader to deduce the coupling points: two blocks of code after another can have all kinds of weird dependencies, e.g. the first blog might set some local variables that the second one relies on. But functions just have arguments and return-values.
- mattmanser 14y agoObviously. I've found in my experience working with other people's code and maintaining large code bases you find that overly nesting functions causes a lot of problems when you're trying to read or debug code. You often also see problems where the essentially dependant functions start to separate in the code as people accidentally add new functions between them. The article I linked is good, John describes it well. It's a nightmare to work with when you get triple or quadruple nesting of tiny functions, like in the code of this program. It's totally unnecessary.
- eru 14y agoI guess it also depends a bit on the language you are working in. Some languages have an easier time dealing with functions. In, say Haskell, having quadruple nesting of tiny functions isn't too much of a problem---and if you are pedantic, is the only way to create a function with four arguments.