What is considered a "gambiarra" or a poorly made code? [closed]

closed . This question is opinionated and is not accepting answers.

want to improve this question? update the question so it can be answered with facts and quotes when edit it .

Closed 3 years ago .

improve this question

For example, I create a code, and it works, but I'm not sure it's right for me to do the same that way. Is that a gambiarra? I have to make sure that the code is made of such a way for him to be considered a "good code"?

Author: Victor Stafusa, 2017-06-28

1 answers

Gambiarra is the term used for poor quality and poorly done code, and that does not always work(but sometimes it does, only in a way that should not be used).

Often, this is confusing code, tied up with a lot of stuff that has little or nothing to do with the purpose of the code, and brings unwanted problems and side effects. It can also be a fragile code that does not work in abnormal situations.

By example:

Workaround

Knowing what is or isn't gambiarra is something very subjective. An example of a gambiarra in the real world of programming would be instead of passing an x value as a parameter from function A to function B, saving the X in a file in function A and reading that file in function B. This is gambiarra because the file would be being used for the application to communicate with itself without saving data from one execution to another and side effects because it depends on the use of the disk, it is slower, etc. And it is also an inappropriate way to do it, because there is another much simpler and more direct solution and files were not designed for this purpose.

 8
Author: Victor Stafusa, 2017-06-28 17:47:14