Posts by Maniero • 444,682 points
6,921 posts
-
42
votes2
answers8108
viewsA: What are the differences between Dependency Injection and Control Inversion?
Ioc Ioc may not even be as created in common projects, but it is widely used in most applications. Ioc is also the Hollywood principle, where the producers tell the actors "don’t call us, we’ll call…
-
32
votes2
answers12489
views -
9
votes2
answers197
viewsA: Nomenclature or language in lambda
I don’t think there is a universally appropriate way. We don’t need to stick to silly formalisms just because it’s right. The important thing is that people communicate efficiently. It is common to…
-
1
votes2
answers1176
views -
27
votes3
answers8960
viewsA: When is it interesting to denormalize the database?
First let’s understand that denormalize is not the same thing as not normalizing. Denormalize is a conscious process with a clear goal. A well-standardised database is usually faster than a database…
-
15
votes4
answers1443
viewsQ: Should an enumeration be constant in the lifetime of the solution?
Modern languages often have a type of enumeration that is usually a range of related constants. Its members are usually constant. In most languages this is even guaranteed by the compiler. But…
-
3
votes3
answers2226
viewsA: Performance: string "concatenated" or all in the same line?
It has already been properly said that the best way is to use a single string in the case presented. It is quick and readable. But if there is a reason to do the sequential concatenation, it can be…
-
4
votes3
answers7464
views -
25
votes2
answers3305
viewsA: How to best treat exceptions in Java?
References I have talked a lot about it. Even though I am not specific about Java the essence holds for it. See in: Why should we avoid returning error codes? How to intercept exceptions when…
-
15
votes5
answers6769
viewsA: Should I use GUID or int as the primary key?
If your case is a small project, most likely not. Of course I can’t speak accurately, since "small" doesn’t define well what the project is. Normally in small projects utilize GUID is in violation…
-
1
votes2
answers513
views -
5
votes0
answers75
viewsQ: Why should we prefer composition over inheritance?
Since the popularization of object orientation in the 90’s I hear that composition should be preferred before creating hierarchy of types. But perhaps the most important concept of object…
-
100
votes4
answers4254
viewsQ: Why should we avoid returning error codes?
It is common to say that one should avoid returning error codes in a function when some operation fails. It is not hard to see that error codes are confusing (is it a valid value or an error?) and…
-
87
votes4
answers4254
viewsA: Why should we avoid returning error codes?
This is another of the myths that were created because people memorize sentences and do not understand the motivators. It is true that returning error codes is not usually a very good idea. But if…
-
24
votes3
answers104158
viewsA: How to solve a Notice: Undefined index?
What’s the form that calls the C:\wamp\www\mezzo-com\reservas.php? It needs to have a button being posted that sends information to the script PHP. Should have something like: <input…
-
5
votes2
answers592
viewsA: How to convert a Std::string to a Qstring?
First solution: Pessoa *p = new Pessoa("Ronald Araújo", "[email protected]", 23); QMessageBox msg; msg.setText(QString::fromStdString(p->getNome())); msg.exec(); Second solution: Change the…
-
18
votes1
answer1702
viewsQ: What’s the right way to call the C#versions?
There seems to be some confusion with the nomenclature of the versions of C# and the technologies that are related to it. Is there a C# 2005? Or a C# 3.5? How do C# versions relate to . Net, Visual…
-
21
votes1
answer1702
viewsA: What’s the right way to call the C#versions?
C# CLR .NET Framework .NET Core Visual Studio Launching 1.0 1.0 1.0 - .NET (7.0) January 2002 1.2 1.1 1.1 - .NET 2003 (7.1) April 2003 2.0 2.0 2.0 - 2005 (8.0) November 2005 3.0 - November 2006 3.0…
-
11
votes3
answers1026
viewsA: What problems can a global state entail?
Complementing the utluiz response. I’m not saying great news, just a different way than what was already said in the other answer and adding something. Confusion of design Global state can only…
-
60
votes8
answers16426
viewsQ: Why is using "SELECT * FROM table" bad?
It is often said to take all columns of a table through the command SELECT * FROM tabela is a bad practice. Any recommendation without explanation is not helpful. So... If it is bad practice, there…
-
58
votes2
answers18428
viewsA: What is MVP and MVVM?
Recapping what you probably already know: Model Contains the connection to the database or how to access the data has the necessary logic to process the data in the database or other source…
-
43
votes3
answers8167
viewsQ: When to use recursion and when to use loops?
A problem can be solved and get the same result used a loop or through recursive calls to a function. Whereas the programming language being used has both features, how to know when one is better…
-
81
votes3
answers33467
viewsA: What is the difference between a static and dynamic programming language?
I will speak here as people understand it. If you go to study type theory you will see that some things there are different from this. There is some confusion in various terms on this subject. In…
-
89
votes2
answers8108
viewsQ: What are the differences between Dependency Injection and Control Inversion?
Sometimes it feels like we’re talking about the same thing (of course, it’s not) when these concepts are being used. What’s the real difference between them? When using one or the other?
-
6
votes3
answers1618
viewsA: How to intercept exceptions when working with the Entity Framework?
I will give you an answer that does not directly answer what you want but will help you and others to other problems with exceptions. First we start by conceptualizing things correctly. But the…
-
6
votes3
answers905
viewsA: Problems with Double formatting
You probably have a "culture" problem. The . NET takes the information about the culture being used on the computer. It "reads the environment" and does operations according to the information…
-
22
votes2
answers1375
viewsQ: What is it and what are the advantages of Currying?
This is a very widespread concept in functional languages, but what it is exactly? Why is it advantageous? Bonus point: Is it possible to use it in non-functional languages? Or more generally, in…
-
33
votes3
answers1026
viewsQ: What problems can a global state entail?
What problems can a program face with the use of global states? Where can it be acceptable? That is, how to know if I am abusing the resource? What alternatives exist to avoid this? I’ve already…
-
19
votes1
answer1448
viewsA: How do you decide whether an application is in alpha, beta, RC or RTM?
Origin These nomenclatures began to be used after IBM classified its hardware as A, B or C according to the stage the product was at1. Later software began to have similar terminology but using…
-
48
votes2
answers21131
viewsA: What does branch, tag and trunk mean?
Trunk It is the main development trunk, following from the beginning of the project to the present. This is where the project should always be based. It is usually managed by a developer and…
-
94
votes5
answers12967
viewsA: Why is the use of GOTO considered bad?
Direct response The reason why people say to avoid the goto is readability. It would be to facilitate the understanding of the code, so the programmer does not get lost in what the code does. The…
-
41
votes2
answers3902
viewsQ: Tests, TDD, Unit Test, QA and similar. What is the difference between concepts about tests?
In the question of the goal 5 different tags for "testing" I noticed that I have some difficulty understanding all these terms about tests. Certainly tests have been very important throughout the…
-
33
votes7
answers9251
viewsA: In C#, what is the await keyword for?
What is Who await is a "command" for the code to be awaiting by the conclusion of a task and carry on normal execution allowing other executions to happen concomitantly, everyone already said. I’ll…
-
43
votes8
answers2113
viewsA: Is using customer validation enough?
I will consider that the AP speaks of the validations that could be made exclusively on the client side. There are validations that are inherently impossible to do without the help of the server.…
-
82
votes5
answers17889
viewsQ: Why choose C instead of C++ or C++ instead of C?
I think everyone with the least amount of knowledge knows when to choose C or C++ over other languages. There are clear cases where these languages are more suitable and others that do not make so…
-
26
votes4
answers5615
viewsA: What is the difference in the use of the Equals method for the ==operator?
According to Microsoft in text written by Jon Skeet: The method Equals is only a virtual method defined in System.Object, and may be superimposed by any classes that choose to do so. The == is an…
-
16
votes2
answers1436
viewsA: What it means '~' in front of the constructor of a C#class
This is a destructor. The syntax is inherited from C++. But the semantics are quite different. In practice destructors do not exist in language. To understand I will explain two other concepts.…
-
4
votes5
answers2480
viewsA: Check if day exists in month
I decided to respond to not enshrine a redundant form of code. I am also giving option to Overload for a string with the date. public bool EhDiaValido(int dia, int mes, int ano) { return dia >=…
-
75
votes3
answers4535
viewsQ: Why shouldn’t we use Singleton?
You finds on the internet the claim that Singletons are bad. Is this true? Why? Would the problem be generalized to any objects with single instance? Or to anything that has been global? If it is so…
-
30
votes7
answers14277
viewsA: What can C++ do that C# can’t?
Summary: Viable operating systems, drivers for existing operating systems or any operation requiring direct access to hardware. Manual memory management and optimization including enabling…
-
10
votes1
answer616
viewsA: Thread problem
I will give the best answer to a beginner and not exactly to solve the problem (that neither exists). Introducing First, your computer is not in trouble. Even if it were, it would not affect the…
-
7
votes4
answers2950
viewsA: Draw where the name cannot be drawn more than once
I decided to put another answer since someone may need a shuffle without changing the original enumeration. I took the opportunity to improve, after doing some tests, and saw that any enumeration…
-
7
votes4
answers2950
viewsA: Draw where the name cannot be drawn more than once
I have an alternative to implementing Bacco with some advantages: Allows the use of any list, including a array which is a list. It may be more suitable for your specific use. Random generation uses…
-
30
votes5
answers2194
viewsA: Exceptions consume a lot of processing. Truth or legend?
Yes, the second code will consume more processing. Exceptional situation But who cares anyway? If something exceptional has actually happened, something out of the normal program flow, this extra…
-
195
votes6
answers64346
viewsA: What is the difference of API, library and Framework?
To complement, help or confuse a little more :) and be slightly dissonant. Terms can be defined differently depending on the context. I went to look at the definition found on Wikipedia in English…
-
8
votes4
answers438
viewsA: "Clean" way to modify the "Visible" attribute of a Picturebox
The Response of the Gypsy Morrison Mendez is good and solves the problem. But one may have a problem where one cannot change the structure of the methods. Still you have a solution: private void…
-
47
votes2
answers13820
views -
62
votes3
answers24262
viewsA: What is the difference between Ienumerable, Iqueryable and List?
Resharper’s suggestion occurs because it’s usually better you deal with interfaces than concrete types, or otherwise analyzing a more generic type than a more specific one. The fact of generating a…
-
13
votes2
answers808
viewsA: What are the size limits of variables in Ruby?
String => theoretical limit of 231 - 1 (32 bits) or 263 - 1 (64 bits). I want to see someone manage to allocate a string this size Integer => In thesis Ruby can change the representation and…
-
11
votes2
answers9026
viewsA: Algorithm in C to convert Arabic number to Roman number
#include <stdio.h> int main () { for (int i = 1; i < 3000; i++) { int numero = i; char *romanos[] = {"I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"}; int arabicos[] =…