Most voted "characteristic-language" questions
Use this tag in questions relating to the operation of some feature of a programming language (Feature language), such as its type system, supported constructs, etc. Do not use it if the focus of the question is simply its use in solving a distinct problem.
Learn more…402 questions
Sort by count of
-
12
votes2
answers675
viewsSum of Timespan in C#?
In the sum of two variables of the type Timespan with the language c# I was able to observe that it happens as if it were a mathematical operation of two simple numbers, example: TimeSpan t1 =…
-
12
votes2
answers3744
viewsHow does the "for" inline command work?
I made a question about a Python algorithm, but reply of user Anderson Carlos Woss he used a kind of for inline that I had never seen and that left me confused. Follow the code section corresponding…
-
12
votes4
answers4874
viewsIs there a programming language in Portuguese? If so, what are they applied to?
As we are used to, "all" programming languages (or almost all, I don’t know) follow the American standard, both in the English language (for, while, if, class, date) how much in date/time and…
-
12
votes2
answers360
viewsWhy are primitive types with floating points divided or multiplied by certain multiples of 10 displayed in scientific notation?
In this answer we can see that Java has a peculiarity when displaying the result in certain types of operations with primitive types that have floating point, such as division by multiples of 10,…
-
12
votes2
answers214
viewsWhat is the difference of var between Kotlin and Java?
With the release of Java 10, the possibility of using the var: var list = new ArrayList<String>(); I’ve seen the difference between val and varin Kotlin, but I would like to know more about…
-
12
votes2
answers188
viewsIs there a difference in performance between "new" and "clone" in PHP?
What is the advantage of using the clone instead of the new to create an object in PHP? I know that to use the clone it is necessary to pass an instantiated object. But because it is not necessary…
-
12
votes1
answer193
viewsWhat is the purpose of Object.is?
I realized that Javascript now has the Object.is and, according to the documentation: Object.is determines whether two values correspond to the same value. Some doubts have arisen about this: Why…
-
12
votes1
answer294
viewsMandatory language incorporating functional elements
Yesterday I was reading an answer about the differences between the paradigms functional and imperative, and I came across this statement: Functional Programming and Object-Oriented Programming.…
c# characteristic-language functional-programming paradigms imperative-programmingasked 6 years ago Pedro Gaspar 3,289 -
12
votes4
answers242
viewsWhat’s behind the "go"?
Day I came across a question from a user who wanted to print a string, but with time interval between each character, so I suggested that it use the following code: from time import sleep frase =…
-
12
votes1
answer1392
viewsWhy, in C, does a function need to be declared before it is used?
This question was asked on Facebook. Lé is a problem because there is no room for a good answer, there is no way to classify the answers as to their quality properly, much appreciated by the…
-
12
votes2
answers286
viewsWhy does the exchange of values via de-structuring not work if we do not use semicolons?
We know that the semicolon is optional in Javascript, even always prefer not to use it. If I want to exchange values between two variables, via unstructuring, I can do: let a = 11; let b = 22; [a,…
-
11
votes2
answers661
viewsWhy does the month numbering of the Date object start at zero?
For example: var data:Date = new Date(); trace(data.month); //Supondo que o mês seja Janeiro: 0 I would like some details, because I know that it is not only in Actionscript and Javascript that this…
-
11
votes3
answers318
viewsIs referring to an element via its id considered bad?
In Javascript, you can refer to any element that has a id (and in some cases a name) using simply an identifier with the same name - without the need to declare it: <div…
-
11
votes2
answers6730
viewsHow does the hash table implementation work?
The concept of hashes (or tables hash) is already embedded in various programming languages such as Javascript, Python, Ruby, etc., and is known to be much faster than, for example, chained lists.…
-
11
votes3
answers5893
viewsWhat is operator overload?
In some programming languages such as C++ it is possible to overload operators. What is and what serves?
-
11
votes1
answer469
viewsWhat is the purpose of empty parentheses in a lambda statement?
I created an example of a Lambda statement with no arguments, however, I have doubts regarding the omission of the empty parenthesis () in the statement. Take the example: class Program { public…
-
11
votes1
answer2240
viewsWhat is the purpose of the "assert()" function and when should we use it?
According to the PHP manual assert - Check whether a statement is FALSE Or assert() checks the informed assertion and takes appropriate action if its result is FALSE. And there’s this example of…
-
11
votes2
answers502
viewsWhat is the difference between "String(1)" and "new String(1)" in Javascript?
Why in Javascript it is possible to call String as a function and also instantiating? Take the example: var str1 = new String(1) var str2 = String(1) console.log("Valor é %s e o tipo é %s", str1,…
-
11
votes1
answer1523
viewsWhat is the purpose of the "use" command and what is its relation to anonymous functions?
I am doing some tests with a Restful API that I am creating using the Slim micro-framework, and in one of these routines that is responsible for executing a certain action caught my attention a…
-
11
votes3
answers2425
viewsWhy in Java is the size of an array an attribute and a String and a method?
In Java, the size of a array of any object can be obtained with length, which would be an attribute. But in the case of String is length(), a method. However, if you have a array of String, uses…
-
11
votes2
answers1673
viewsWhat is the purpose of : (two points) in PHP?
I have this question that is leaving me with a flea behind my ear. I don’t understand at all. What does the sign of : two points. Someone can explain me? Example: if ( have_posts() ) : while (…
-
11
votes1
answer961
viewsWhat makes Kotlin a language faster than Java?
I have read in some articles that Kotlin is faster than Java, but none of them exemplifies why. [...] As fast as Java". Kotlin - Evolve your Java Code (TDC-2016) Alex Magalhaes [...] Kotlin should…
-
11
votes1
answer118
viewsWhat is Typedarray? What are the advantages of using them compared to the traditional Array?
I was reading on MDN about Typedarray and saw that various classes derive from this. Classes derived from TypeArray: Int8array Uint8array Uint8clampedarray Int16array Uint16array Int32array…
-
11
votes2
answers487
viewsCan we create artificial intelligence in any language?
About Artificial Intelligence, would like to know superficially, thinking of starting the knowledge in this area: Can be created in any language? Basically, what would be the concept that a code is…
-
11
votes2
answers271
viewsWhat is a language builder?
In PHP, I have read and heard several times about Language Builders. The cases I’ve always heard of were in cases where it was said: "prefer to use X rather than Y, because Y is a function and X is…
-
11
votes2
answers327
viewsIn PHP, does an array’s internal pointer make up its value?
Let us consider the following array: $a = [1, 2, 3, 4, 5]; As we make $b = $a we create a copy of array, so much so that changes made to one of the arrays will not affect the other. However, I…
-
11
votes1
answer359
viewsWhat is type Juggling?
What is type Juggling? This concept is related only to dynamic typing languages like PHP and Javascript?
-
11
votes1
answer374
viewsDoes multiple assignment in Python use tuples?
In the question Inverting two variables without using a temporary an answer quotes a link that comments on the multiple assignment of variables in Python: Functioning of Multiple Assignment The…
-
11
votes3
answers189
viewsWhy do we not receive an error when we call an undeclared variable as a window property?
We initially have this: var a = 0; console.log(window.a === a); // true Okay, so here we prove that when we declare a variable in global scope, it becomes a property of the object window. Now, we…
-
11
votes1
answer118
viewsWhat are "bridge" methods in Java?
I recently had a problem with methods bridge, what occasional in an excellent answer by Victor Stafusa. But now I realize I don’t know why that method bridge have been created, nor what it means to…
-
11
votes1
answer408
viewsWhat is a virtual subclass in Python and what are its advantages?
In Python we can implement an abstract class from the module abc and one of the forms is the class inheriting from abc.ABC: from abc import ABC class AbstractClass(ABC): @abstractmethod def…
-
11
votes1
answer539
viewsWhat are the main advantages of using the Java 9+ modularization feature?
From Java 9 we have the possibility to modularize our application using the so-called Java Platform Module System Before Java 9, modularization was done purely through Jars, where we had several…
-
11
votes2
answers469
viewsWhat are the logical assignment operators ||=, &&= and ??= in Javascript?
I recently came across a code snippet like the one shown below: let alias = req.body.alias; alias = (alias ||= alias = 'generic'); I’ve never seen that operator before ||=, but after a brief search,…
javascript typescript characteristic-language operatorsasked 3 years, 11 months ago Cmte Cardeal 5,299 -
10
votes2
answers424
viewsWhat is the purpose of empty command blocks or which do not belong to any command?
A command block is composed of two or more commands between keys {...//Comandos}, I can use them for the following situations I already know: In a if: if(codicao){...//Comandos}. In a for:…
-
10
votes1
answer3149
viewsHow does Javascript import libraries?
In programming languages such as Java, C# and C, when we want to use some command or function we should include the library containing the commands we want or the classes if it is object oriented…
-
10
votes4
answers14893
viewsAdvantage and advantage between onClick and setOnClickListener
I have a certain situation where we see that it is possible to create in the XML file a property called onClick: onClick: XML: <Button android:layout_height="@dimen/edittext_min_height"…
-
10
votes1
answer152
viewsSealed class, with private constructor, versus Static class
When "studying" this class, I checked that it is sealed and has the private builder: public sealed class Interaction { /// <remarks> /// CA1053: Static holder types should not have public…
-
10
votes1
answer2503
viewsWhat are the main features of the Go language?
I started to hear a lot about Golang and is increasingly gaining ground among the most widely used programming languages. As far as I know, I think it’s a programming language. So, What are the main…
-
10
votes1
answer181
viewsWhat is the use of underline in numerical literals?
What is the use of underline (_) in the situations below: float pi = 3.14159_26535_89793_23846; long bytes = 00101001_00100110_01100001; int n = 1____________________1;…
-
10
votes4
answers236
viewsComparison syntax referring to the same variable
Let me give you an example in C#: namespace Compare { class Program { static void Main(string[] args) { string name = "Girl"; if(name == "Girl" || == "girl") //... } } } This form clearly contains…
-
10
votes1
answer257
viewsWhat are extended functions?
I’m writing an article on programming in Kotlin, I came across this name, which are extended functions?
android function terminology characteristic-language kotlinasked 7 years, 1 month ago Lucas Vieira 397 -
10
votes2
answers753
viewsWhat does the exclamation mark mean after a guy’s name?
I have seen a lot in Kotlin types marked with an exclamation mark at the end. Especially when I use Java’s API. Something like CharSequence! What does that mean?…
-
10
votes1
answer177
viewsWhat is Type Annotation?
I’m reading a book about Typescript and I came across something that caught my attention which is the Type Annotation. Take the example: function foo(): { a: number, b?: number } { if (this.a <=…
-
10
votes1
answer4230
viewsWhat is the difference between export and export default?
What is the difference between using the reserved word export and export default. For example: export class Helper { } export default class Helper { }…
-
10
votes2
answers210
viewsHow does an "if" work internally?
The if is widely used in programming, and he plays several important roles in a programmer’s everyday life. The code seems to magically run if an expression is passed in the if is true, otherwise…
-
10
votes3
answers603
viewsWhy is it allowed to delete elements from an array defined as const?
Assuming I have set an array to const: const array = [1,2,3] Why is it possible for one of these elements to be removed? This would not be a way to reassign the array? It’s possible I’ll make one:…
-
10
votes3
answers598
viewsWhat is the difference between keys and parentheses in an Arrow Function in Javascript?
What is the relevant difference between keys ({ }) and parentheses (( )) in a return of a function? const example = () => ( ... ); Versus: const example = () => { ... };…
javascript function characteristic-language syntax arrow-functionsasked 4 years, 9 months ago novic 35,673 -
10
votes2
answers224
viewsWhat is the underscore ( _ ) "inside" of a Javascript number?
I realized I can use underscores (_) between numeric literals in Javascript. For example: const testA = 1_000_000_000; console.log(testA); // => 1000000000 const testB = 1000000_0 + '_0_' + 1_0;…
-
9
votes2
answers185
viewsHow to make an IO "equivalence" in Java and C++?
I made the following code in C++: #include <iostream> template <typename type> class Foo { public: Foo(type FooTest) { std::cout << "Foo " << FooTest; } }; int main { new…
-
9
votes1
answer3671
viewsAre there any other low-level languages besides assembly?
Are there other low-level languages besides Assembly? LISP is not (I think) nor Fortran.. Low-level language would be language closer to binary, as well as Assembly, language that works directly…