Most voted questions
150,413 questions
Sort by count of
-
82
votes7
answers21276
viewsBest kind of data to work with money?
I am developing a project for commercial automation, using PAF-ECF and everything else. Would Aual be the best type of data to work with SQL Server and C# for money issues? Mainly in relation to…
-
81
votes4
answers4098
viewsWhat is pythonic code?
In Python programming it is common to hear the term pythonic (or pythonic), see: Sopt: "Understanding the pythonic way of dealing with properties" Sopt: "Pass pythonic form parameters" Wikipedia:…
-
81
votes5
answers3667
viewsIs there any downside to always capturing Exception and not something more specific?
When I write code in Java and try to treat exceptions I usually simply use the superclass Exception, not linking to the specific class and it usually works. There is some inconvenience in doing…
-
79
votes4
answers38157
viewsWhat is XGH (Extreme Go Horse)?
I see some people in the middle of programming referring to this term whenever a code appears with a strange solution or medium "entwined". By doing a quick Google search, I’ve come to the…
terminologyasked 8 years ago Wallace Maxters 102,340 -
79
votes4
answers6695
viewsIs it possible to make a tooltip with pure CSS?
Is it possible to make a tooltip with pure CSS? That is, without jQuery, without Javascript, but only with CSS. For example, I want to do this based on the following element: <a href="#"…
-
79
votes2
answers11641
viewsWhat is Reflection. Why is it useful?
It is recommended to use in projects? How to use? In what situations Reflection can be used?
-
79
votes8
answers16873
viewsHow to invert a string in Javascript?
How to invert a string in Javascript? For example: Entree: "something here" Exit: "iuqa asioc amugla"
-
78
votes6
answers24661
viewsWhat is the difference between declaring variables using Let and var?
Since the word was introduced let in the Ecmascript I have only heard about it, so far I have not seen any practical example and to be honest I do not know very well what is a variable let and how…
-
78
votes2
answers35446
viewsWhat is the complexity of an algorithm?
What is the complexity of an algorithm? And what are the ways to measure it? (Big O, Big Theta...)
-
78
votes12
answers208289
viewsHow to format date in Javascript?
I want to play the current date on one input, but in the "Brazilian" dd/mm/yyyy. My code: var data = new Date(); dataFormatada = ????? $("#Data").val(dataFormatada);…
-
76
votes3
answers5608
viewsWhat does "immutable" really mean?
In that question I did about value types and reference types in C#, it was quoted in the accepted answer that instances of structs must be immutable objects. Reading on wikipedia confirmed that an…
-
76
votes6
answers20131
viewsDifference between single and double quotes in PHP
What is the difference between single and double quotes in PHP? Yesterday I was working with a string from a google json I used explode('\n', .. to separate a string. When I used the explode in "Mon…
-
75
votes4
answers10585
viewsWhat is database normalization?
I was talking to some programmer friends when I heard the term "database normalization". Although I’ve heard that term a few times before, I couldn’t understand what it was about. Some doubts have…
-
75
votes1
answer32104
viewsWhat is the difference between URL and URI?
What is URL? What is URI? Are they synonymous? In general people almost always use URL, are they the same thing? Is there anything else related?
-
75
votes3
answers4535
viewsWhy 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…
-
74
votes5
answers2194
viewsExceptions consume a lot of processing. Truth or legend?
I’ve seen shows like this : if(!clienteExiste(1)) { return "Cliente não existe."; } and others like that if(!clienteExiste(1)) { throw new Exception("Cliente não existe."); } The second code will…
-
74
votes8
answers5453
viewsWhy in some if’s situations are considered bad?
I read in some places that it is not recommended the exaggerated use of if, because it makes your code difficult to read and maintain, so it’s not a good practice. What would be the overuse of if in…
-
73
votes18
answers139957
viewsWhat is the best way to center an element vertically and horizontally?
What’s the best way (by "better" I mean: with the greatest possible compatibility between browsers and the simplest possible) to position an element in the center of the page, vertically and…
-
71
votes6
answers56799
viewsWhat is Nullpointerexception and what are its main causes?
What are the exceptions NullPointerException? What are its main causes? What methods/practices can be used to prevent?
-
71
votes4
answers25411
viewsWhat is addiction injection?
I have heard a lot about addiction injection. The question is: How, when and what to use?
-
71
votes2
answers4053
viewsIs it wrong to use class inheritance to group common behaviors and attributes?
What they teach us about Inheritance The overwhelming majority* of materials dealing with Class Inheritance exemplify it as a mere mechanism for grouping common attributes or actions. At most, as a…
-
71
votes8
answers49747
viewsHow do I remove accents in a string?
I have a string áéíóú That I want to convert to aeiou How do I remove accents? Need to save to database as a URL.
-
70
votes3
answers204336
viewsWhat is the difference between asynchronous and synchronous communication?
I’ve heard a lot about asynchronous and synchronous communication, but I don’t know what they really are. Could someone explain to me what the difference and how each one works? When and what should…
-
70
votes1
answer4219
viewsWhat are the advantages of using the right HTTP methods?
I have seen many people defending the use of HTTP methods correctly, that is, respecting the semantics of the methods defined in the specification when making a request. GET should only be used to…
httpasked 9 years, 9 months ago bfavaretto 64,705 -
70
votes5
answers17559
viewsMysqli vs PDO - which is the most recommended one to use?
With the mysql_* entering the state deprecated, the PHP documentation recommends using PDO and Mysqli. What do you recommend for use? PDO seems to be best suited for working with object oriented…
-
69
votes3
answers21607
viewsWhat are the concepts of cohesion and coupling?
What are the characteristics of a code with cohesion or coupling? To what extent can this generate future problems?
-
69
votes8
answers13920
viewsIs <br> or <br/> or <br />right?
I see each one using a way, I even vary the shape in a few moments and all work, but what is the right one? It depends on HTML version or the browser?
-
69
votes3
answers4929
viewsWhat is the point of using double negation in Javascript?
Recently, while studying some Javascript codes, I came across the following code: return !!navigator.userAgent.match(/iPad/i); I know that: !true == false !false == true And consequently: !!true ==…
javascriptasked 10 years, 3 months ago Lucas Lima 6,714 -
68
votes2
answers16758
views -
68
votes1
answer19312
views -
68
votes3
answers19793
viewsFunctional Programming and Object-Oriented Programming. What are they and what are their main differences?
What are and what are the main differences between Functional Programming and Object-Oriented Programming?
-
68
votes8
answers67841
viewsHow to export an HTML/PHP page to PDF
How to export an HTML page to a PDF file? Having a standard document where you can change variables within that template and then export that page to a PDF file in A4 format, without spoiling the…
-
67
votes3
answers10868
viewsWhat is a racing condition?
What is this such of race condition that can cause problems in applications? How to avoid it?
-
67
votes1
answer722
viewsWhy (!+[]+[]+![]). length returns 9 in Javascript?
I just read that article and in it there is this expression: (!+[]+[]+![]).length Evaluating this in the interpreter: > (!+[]+[]+![]).length 9 Good, why?…
javascriptasked 10 years, 2 months ago Lucas Virgili 3,092 -
67
votes3
answers5939
viewsWhat are the techniques for making scroll-based animations?
I’m interested in creating websites with scroll-driven animation (ex.: Kano), where content is animated and replaced as the page is scrolled. What are the techniques to facilitate such programming?…
-
67
votes2
answers18428
viewsWhat is MVP and MVVM?
It is very common to talk about the MVC (Model-View-Controller) standard. But the acronyms MVP (Model-View-Presenter) and MVVM (Model-View-View-Model) are very poorly cited. What they are and what…
-
66
votes2
answers38176
viewsHow do hexadecimal numbers work?
I have seen that software libraries written in C, in general, use hexadecimal numbers. And Assembly programmers also need to be ninjas with this numerical system. It is not anywhere that one finds a…
-
66
votes7
answers11287
viewsIs it wrong to write byte of images into the database?
When should I make this recording directly at the bank? What situations? I know I can record in the bank the image path.
-
66
votes3
answers2309
viewsIs it right to prefer composition to inheritance?
I’ve read several articles and books of Designer Patterns the expression Prefira composição em vez de herança. I believe it is a rather controversial subject due to the views discussed. In my view,…
-
66
votes7
answers12436
viewsUse semicolon or not at the end of the lines in Javascript?
I have read some comments on the web about whether or not to use the ; at the end of the lines when writing Javascript. Some say yes, others say no need, but none can explain well the reasons for…
-
66
votes5
answers24456
viewsAJAX request with pure Javascript (no Apis)
Usually, when we need to resort to requisitions AJAX using Javascript, we have handy Apis that help us with this (e.g.: jQuery). However, what would be the safest and cross-browser to make these…
-
66
votes6
answers27772
viewsWhen, why and how to use the "use Strict" directive in Javascript?
I had never seen before the use of this directive, but almost all the most mature jQuery plugins use it. I would like to know when and how to use it and what its purpose is.
-
65
votes6
answers66144
viewsType of the CPF or CNPJ field in the VARCHAR or INT database?
What type of CPF or CNPJ field in the database VARCHAR or INT? I’ve seen some posts suggesting using INT to optimize performance in the event of JOINand filters. If you have 0 the left is only…
-
65
votes3
answers5311
viewsWhen to use var in C#?
In C#, local variables in the scope of a method can be declared with implicit type using var, and type is solved at compile time: var i = 10; // implicitly typed int i = 10; // explicitly typed…
-
64
votes1
answer5474
viewsProgramming facing the interface and not the implementation, why?
What are the main reasons (in practice) that lead developers to apply the practice of developing for interface and not for implementation?
-
64
votes3
answers1321
viewsWhy is it not recommended to use "_" (underscore) in HTML/CSS?
I’ve seen people recommend never using _ (underscore) in HTML and CSS. Instead, we should give preference to -. Example: // Errado <div id="minha_div" class="minha_classe"></div> //…
-
64
votes4
answers26848
viewsWhat’s the difference between DAO and Repository?
What’s the difference between DAO and Repository? Both are very similar, but in which case it is better to use one or the other? I would like code examples.…
-
64
votes11
answers8299
viewsShould I write my program in English or Portuguese?
When I am writing programs, I usually write the names of variables in English (for example, fields, class_name, rec_number), for a number of reasons: Names in English don’t have accents, so there’s…
-
63
votes3
answers1056
viewsWhat is "with" for in Javascript?
What is the purpose of the with in Javascript? It works only to get the object values as if it were a variable, or it is also possible to set or change properties through it? Example: var obj =…
-
63
votes3
answers24262
viewsWhat is the difference between Ienumerable, Iqueryable and List?
What’s the difference between Ienumerable, Iqueryable and List no . NET? When it’s best to use one or the other? Why does Resharper suggest that I modify the return of that function, for example,…