Is there a translation that means something similar as it does in English?
In my case I need that this was in the Informatic Sciences field, you can found the expression as:
- boilerplate code
- boilerplate project
Is there a translation that means something similar as it does in English?
In my case I need that this was in the Informatic Sciences field, you can found the expression as:
"boilerplate code" is standard, reusable code fragments that are used again and again in projects, and are not particularly meant to be refactored out.
An example:
perl
#!/usr/bin/perl
use warnings;
use strict;
to answer your question, looking at this use of "boilerplate code", I imagine google translate is probably right, and would suggest: código repetitivo
Another meaning the phrase is used to denote is when a well-known pattern
is followed in the working of a problem, such that the libraries in handling the project, or the project itself, generates such code as needed.
Here are a couple of examples:
html
html5boilerplate site which allows you to generate custom variants.
ruby or rails
uses it's own term scaffolding
and generates such code as needed in its MWC-based server-side designs.
Here I would suggest: Andamios —the only translation I can find on the wikipedia article for ruby's scaffolding was the french Échafaudage (programmation)
This is a tough one to translate. Some options, not perfect:
Maybe even
The term used in Spanish would be "código de cajón", which translates to something akin to "boxed code", "code in a box" or "prepackaged code".
Effectively, "código de cajón" would be prefabricated code ("código prefabricado") which is "taken out of its box" to be used as-is.
Two good analogies of what "código de cajón" would represent to Spanish speakers would be:
The phrase "de cajón" has the following connotations:
Which means that "de cajón" can also be applied to "boilerplate project" as "proyecto de cajón", indicating that it is a prefabricated project.
Since "boilerplate code" is defined as code (or sections of code) which has to be included in several places with little to no alteration, it can be seen how the analogy of "IKEA code" would work, since it would be code that needs little to no "assembly".
Additionally, "boilerplate code" has been previously translated as "código de cajón and also as "código prefabricado".
Finally, if you are looking to translate "code template" and "project template" you might want to consider to use "plantilla" for "template", resulting in "plantilla de código" and "plantilla de proyecto".
Please notice that "Repetitive code" ("código repetitivo") is slightly different from "Boilerplate code", to illustrate this let's take a look at this exchange during a code-review meeting:
- One more thing: What is this method, what purpose does it meet?
- That's just boilerplate code.
- Oh alright, it looks good.
Now let's replace "boilerplate code" with "repetitive code":
- One more thing: What is this method, what purpose does it meet?
- That's just repetitive code.
- Oh alright, it looks good.
The second exchange should strike you as odd, but if you can't put your finger on it, keep in mind the following:
In software development, "repetitive code" ("código repetitivo") is code that violates the DRY (don't repeat yourself) principle and, as such, it carries negative implications.
The first exchange is common during code reviews, code that looks out of place can be explained as "boilerplate code" which is used to setup or initialize third-party functionality.
The second exchange is uncommon because not only does the author of the code admits of violating the DRY principle, the reviewer does not bat an eye at such admission.
In other words: "boilerplate code" is code that must be repeated, while "repetitive code" (also known as "copy-paste code") is code that is unnecessarily repeated and is frowned upon.
With that in mind, you can see why translating "boilerplate code" as "código repetitivo" might be an unfortunate choice. If "código de cajón" does not convince you, you would be better off using one of the options presented by spiral, instead. Also, using "andamios", as proposed by roberto tomás would be a better choice than "código repetitivo".
Having said that, "reusable code" ("código reutilizable") has the opposite problem: It has a good connotation that perhaps does not apply to "boilerplate code".
While "boilerplate code" could be seen as "reusable code" (after all, it is code that you must repeat in different projects), developers have the goal of writing "reusable code" as opposed to writing "boilerplate code".
In short, "reusable code" is code you write in a library or a module in order to adhere to reusability principles, while "boilerplate code" would be the code you have to write to include such library (or module) and perform the call to the functionality provided by the "reusable code". From that perspective, "boilerplate code" is code that results from leveraging "reusable code".
One final note regarding the term "scaffolding": While "andamio" is acceptable, "scaffolding" is translated as "andamiaje". In education, the term "scaffolding" also exists, and its equivalent in Spanish is "andamiaje".