D has support for nested functions: I love nested functions. It's good when you need a quick local function, and don't want to expose it to the rest of the code base. But, how do you systematically unit test nested functions?
How an Engineering Company Chose to Migrate to D
31–40 of 170 posts
Re: How an Engineering Company Chose to Migrate to D
#32While the article states that other languages were evaluated, it seems as though the project was motivated entirely by the author and the evaluation was just paying lip service to what was basically a foregone conclusion. Don't get me wrong, I like D from the small amount of playing I've done with it -- and maybe it is the best tool for their purposes -- but this doesn't strike me as an impartial evaluation. The need…
He mentioned an awful lot of code that would have to be refactored, and it could be that they are just too far down the rabbit hole to get themselves out.
Re: How an Engineering Company Chose to Migrate to D
#33Re: How an Engineering Company Chose to Migrate to D
#341)Expressiveness in the given problem domain. Some languages are really great in particular niches.
2)Availability of devs. The ability to hire and retain a really great team makes or breaks projects, and while a smart, motivated dev can learn any language, it's definitely a factor in their choice to work or not work with you. If you're in a niche language it will greatly affect the ability of people to use external resources (stackoverflow etc) if they hit blockers and some people will be reluctant to railroad their career into a tech that doesn't appear to be going to the mainstream. On the flipside, if you're lucky you may be able to get really passionate devotees of the language to work for you just to use the language where they might not have done it otherwise.
Re: How an Engineering Company Chose to Migrate to D
#35I'm curious what manual translation and rewriting would be necessary when moving to Free Pascal compared to their Pascal2D transpiler and compatibility library.
Re: How an Engineering Company Chose to Migrate to D
#36Earlier quoted context omitted.
Go also certainly supports this. Here's a playground example: https://play.golang.org/p/_BLguocGBRn
Does Go take a copy or a reference?
Re: How an Engineering Company Chose to Migrate to D
#37D has support for nested functions: I love nested functions. It's good when you need a quick local function, and don't want to expose it to the rest of the code base. But, how do you systematically unit test nested functions?
Why, with nested unittests, of course! Just put them in a nested type first:
void main()
{
static int nested(int x)
{
return x * 2;
}
struct Test
{
unittest
{
assert(nested(2) == 4);
}
}
}
Well, OK, that's more of a hack than a feature, and you obviously can't test non-static nested functions (as there'd be no way to give values to the outer function's frame variables). But you asked :)Re: How an Engineering Company Chose to Migrate to D
#38While the article states that other languages were evaluated, it seems as though the project was motivated entirely by the author and the evaluation was just paying lip service to what was basically a foregone conclusion. Don't get me wrong, I like D from the small amount of playing I've done with it -- and maybe it is the best tool for their purposes -- but this doesn't strike me as an impartial evaluation. The need…
Indeed they do. It's completely unclear why they don't satisfy the OP's requirement.
Re: How an Engineering Company Chose to Migrate to D
#39While the article states that other languages were evaluated, it seems as though the project was motivated entirely by the author and the evaluation was just paying lip service to what was basically a foregone conclusion. Don't get me wrong, I like D from the small amount of playing I've done with it -- and maybe it is the best tool for their purposes -- but this doesn't strike me as an impartial evaluation. The need…
Re: How an Engineering Company Chose to Migrate to D
#40While the article states that other languages were evaluated, it seems as though the project was motivated entirely by the author and the evaluation was just paying lip service to what was basically a foregone conclusion. Don't get me wrong, I like D from the small amount of playing I've done with it -- and maybe it is the best tool for their purposes -- but this doesn't strike me as an impartial evaluation. The need…
Now you understand how all of these "How we chose this language" writeups work.