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
-
9
votes1
answer695
viewsWhat is a Prototyping Language?
Reading an article on the Internet, I came across the following excerpt: Python, for its more generalist proposal, is a great choice as language for prototyping of systems built in, say, more…
-
9
votes3
answers253
viewsIs there a "in" comparator operator in Javascript?
In Javascript there is a way to use in to check whether the value of a variable is contained in a list of values? A visual example: if (tipoDemissao in [1, 2, 5]){ valorDemissao = 525.20; }…
-
9
votes2
answers4637
viewsWhat is the difference between "node", "attribute", "element" and "tag" in XML?
I am confused about some features and terms of the XML markup language that are: knot, attribute, element and tag, I would like to know what each of them is and what are the differences between…
-
9
votes1
answer120
viewsWhy in PHP is it possible to access the functions before the line they were declared?
Why in PHP it is possible to call a function before the line in which it was declared? echo ah(); // 'Ah!' function ah() { return 'Ah!'; } Notice that I called ah() first, then I declared. Even so,…
-
9
votes1
answer450
viewsWhat’s the comma for?
The comma is what? Just a language construct? An operator? Because it exists? This question is based on what was seen in How to return or extract more than one value from a function?. return base2,…
-
9
votes2
answers993
viewsIs there the equivalent of Andalso and Orelse in C#?
In VB.NET there are two interesting operators: the AndAlso and the OrElse. When used, the logical expression is not evaluated in full immediately. See the following example: If (Not Usuario Is…
-
9
votes3
answers189
viewsWhat happens in the expression "$a+++(+$a)"?
I was playing with PHP to see if I could find something that sounded strange with the syntax, inspiring me in the question What happens in 1...1 in PHP?. I just came across the code: $a = 0;…
-
9
votes3
answers623
viewsWhat is the Javascript Set object for?
I’ve asked a similar question about the Python language: What’s the set for in Python?. I wonder if that object Setin Javascript does the same things as set python makes. Example: var numbers = new…
-
9
votes1
answer119
viewsHow does PHP arrays work internally?
PHP handles arrays in a way different from other languages, apparently there are concepts of hashtable to associate values. How it works internally in the core language arrays?…
-
9
votes3
answers566
viewsHow does Python handle and represent an array internally?
In Python any type of array is of class type list, see: array = ['Gato', 'Jake', 'Finn'] print(type(array)) Exit: <class 'list'> That is, every array is an object of list. However, there is…
python array characteristic-language python-internals cpythonasked 5 years, 9 months ago gato 22,329 -
9
votes1
answer217
viewsHow will the null coalescence assignment operator work in PHP 7.4?
In version 7.4 of PHP was implemented the null coalescence assignment operator that promises to unify the behaviors of assignment and null coalescence operators, the latter being present since…
-
9
votes1
answer191
viewsWhat is Borrow Checker?
I was reading a little bit about Rust and I came across that term, I’d like to know: What is Borrow Checker? Is there any connection with Counting? What would be the translation for this term in…
terminology characteristic-language garbage-collector rustasked 4 years, 8 months ago Denis Rudnei de Souza 3,686 -
9
votes1
answer1353
viewsHow to overload methods in Typescript?
I’m having trouble overloading methods in Typescript. The method to be overloaded is a Object Factory rect() one signature has four numerical parameters and the other signature has only one…
-
9
votes1
answer443
viewsIs Laravel’s Blade a programming language?
After a brief discussion of why the HTML is not a programming language, characterize that not because it is not able to perform calculations, make decisions, change information contained in some…
-
9
votes1
answer941
viewsWhat is the difference between Object.assign and spread Operator?
What is the detailed difference of using Object.assign and the Operator spread (...) for spreading properties of objects? For example, when editing an object for new values, it is the same output:…
-
9
votes2
answers304
viewsWhat are the differences between match and switch in PHP8?
PHP 8 looks like have already been launched, with a series of changes and new things. Among the changes, they created the expression match. I saw that she reminds a little of the old and traditional…
php characteristic-language php-8 pattern-matchingasked 3 years, 11 months ago Wallace Maxters 102,340 -
9
votes1
answer74
viewsA function created within another function is created with each call or persisted by reference?
In the call for the declaration const minhaFuncao = fora(), i am storing the function execution result fora, that in this case would be the function dentro in minhaFuncao. In this case, am I…
-
9
votes1
answer271
viewsWhy does "parseint(0.0000005)" return "5" in Javascript?
Again, Javascript shows me a show of horrors magic and this time I want to know why this unexpected behavior while using the parseInt. Why parseInt(0.0000005) returns 5 and not 0? How I get around…
-
8
votes1
answer698
viewsDoes Prolog have static or dynamic typing?
Although I’m quite familiar with the concept of static vs. dynamic types - can easily recognize if a certain language fits in one or the other - I never knew exactly what the Prolog typing is:…
-
8
votes2
answers577
viewsWhat is the purpose of unsafe command?
I saw the use of the command unsafe, in this code in the declaration of this method: public unsafe static int GetSquareStack(int value) {...} Within the method there seems to be pointer manipulation…
-
8
votes2
answers1094
viewsHow to declare a function within another function in C#?
In Delphi it is possible to declare function within the block of a given function, see this example done in Delphi: procedure TForm1.btnRunClick(Sender: TObject); begin mostrarNome('Carvalho'); end;…
-
8
votes1
answer396
viewsProposal from the Clojure?
Recently I heard about this programming language, Clojure, it uses only functions, is not typed, and appears to be quite complex, this is an example of a function that takes a parameter and does the…
characteristic-language functional-programming clojureasked 8 years, 3 months ago Felipe Paetzold 4,527 -
8
votes2
answers523
viewsWhat is an extensible language?
I found some definitions on extensible language, from English Extensible language, in which it is defined that it is a language that the programmer himself can modify it. However, I did not…
-
8
votes2
answers308
viewsWhy does Kotlin use a way of declaring functions and variables other than "traditional"?
Traditionally the return type and variable type are indicated at the beginning, before the name: public int soma(int a, int b){ return a + b; } In Kotlin he is named after: fun sum(a: Int, b: Int):…
function characteristic-language kotlin variable-declarationasked 7 years, 3 months ago ramaral 44,197 -
8
votes3
answers213
viewsWhat’s a Kotlin label for?
In an example of loops in kotlin documentation, we have some codes with the following excerpt: loop@ for (i in 1..100) { for (j in 1..100) { if (...) break@loop } } From what I read in the…
-
8
votes2
answers1582
viewsVariable of the foreach loop
When we use a loop loop foreach, the local variable we create to receive the contents of the list in question is passed by value or reference? Ex: foreach (var item in listItems) { //TODO } The…
-
8
votes2
answers248
viewsAlternative to Observable and Observer in Java 9
For testing purposes, I am porting an application from version 7 to version 9 of Java. This application has some features that use Observer and Observable. I realized that both became obsolete:…
java pattern-design characteristic-language observer-pattern java-9asked 7 years, 1 month ago Homer Simpson 3,001 -
8
votes4
answers814
viewsWhy can’t we return a void call in a void return waiting method?
I was doing some C# tests to find out how the return issue works void. I did the following test below and realized that tests 1 and 3 work perfectly, however 2 no. Behold: public class Program {…
-
8
votes1
answer107
viewsWhat does @ do in variable names?
In the response code of this question on Soen I found an unfamiliar statement line on C#. I tested this line and it works, but I didn’t understand the meaning of this character @ behind the member’s…
-
8
votes1
answer450
viewsWhat is considered primitive in a programming language?
What is considered primitive in a programming language? Only the types or other language resources are also primitive?
-
8
votes1
answer329
viewsImporting the java.lang. package*
Adding the studies in Java I came across a package so much that special, the java.lang, where the author of the book mentions that we do not need to perform the import of that package. There’s a…
-
8
votes3
answers229
viewsWhy is an anonymous function seen as an object in PHP?
$f = function() { echo "OK"; }; echo gettype($f); Returns Object when theoretically looking was to return function. - In JS: var f = function() {}; typeof f; Returns function.…
-
8
votes2
answers118
viewsWhy does multiple variable assignment create a list when used with the asterisk operator?
Suppose there is a tuple with three values, ('a', 1, 'b'), and you want to assign the first value in one variable and keep the rest in another. For this you can do: a, *b = ('a', 1, 'b') Thus, a…
-
8
votes1
answer141
viewsWhat are the differences between "String" and "str" in Rust?
I know there are (apparently) two main types of string in Rust: str, which, as far as I can tell, is a primitive type; String, which, as far as I know, is part of the standard library std of…
-
8
votes1
answer110
viewsWhy, in C, is a statically declared array name not an lvalue?
Why, in C, the name of a statically declared array is not a lvalue? A lvalue is an expression that can appear on the left side of an assignment statement. It is an expression that represents a…
-
7
votes1
answer700
viewsWhat’s it for, and when to use Friend?
Code example: Friend Const Public Frind
-
7
votes1
answer401
viewsHow to create a function in the J language?
How to create a function in the J language? All the examples I found online show only how to describe functions through a Fork: media =: +/ % # media 1 2 3 4 2.5 The code above (+/ % #) is the same…
-
7
votes2
answers1801
viewslist.foreach vs foreach
I have a list of several string, there’s a difference between going through the list values: In this way: ListaString.ForEach(delegate(string str) { Console.WriteLine(str); }); Or this:…
-
7
votes2
answers692
viewsWhat is the purpose of the super command when used in the parameter declaration of a method?
In Java the command super has the function of calling the superclass constructor. However, in the method declaration forEach() class ArrayList it is used in a different way than usual, see the…
-
7
votes3
answers4285
viewsUse of colon character ":" in Python
In Python there is the character colon :, therefore, what I understand of this character is that it is used in functions def soma(x,y):, conditional commands if soma > 100: and for classes class…
-
7
votes4
answers492
viewsIn C# is it possible to use a local alias for class or namespace?
In languages like Python or PHP it is possible to use a local alias for classes or namespaces. PHP example: use Vendor\Package\ClassName as C; use Vendor\Package as P; $class = new C; $class = new…
-
7
votes3
answers1496
viewsWhy is it possible to define two or more methods with the same name in the same class in C#?
I’m starting my C# studies with ASP.NET MVC today. I’m still adapting to some things I’m not used to seeing, because I know languages like PHP, Python and Javascript. I realized that in a code that…
-
7
votes1
answer275
viewsWhat is the purpose of while(*variable) and if(!*variable) in the statements "while" and "if"?
In Code Review there is a implementation of a simply chained list that I am using. However, in the reply of one of the users, he made some modifications to the list, and had a particular…
-
7
votes3
answers815
viewsIn PHP are all variables declared global?
In C# there is the concept of local variables, see the example below: if (true) { int valor = 10; } else { valor = 5; } Console.Write(valor); The above code returns an error saying that the variable…
-
7
votes1
answer1482
viewsWhat is the difference between __init__ and __new__?
What is the difference between the special methods __init__ and __new__ in Python?
-
7
votes1
answer255
viewsHow does function pointer work in PHP?
In C it is possible to use pointers in functions to reference other functions, see an example: int somar(int a, int b) { return a + b; } int (*sPtr)(int,int); int main(void) { sPtr = &somar; int…
-
7
votes1
answer1874
viewsWhat are the differences between properties and attributes in HTML?
When trying to use this code: $(document).ready(function(){ $("#selectAllBoxes").on("click", function(){ if(this.checked){ $('.checkBoxes').each(function(){ $(this).attr("checked", true); }); } else…
-
7
votes2
answers229
viewsIf I can do everything with structural programming, why did you create object-oriented?
In the question about - Everything I can do in POO I can do in PE? - the answer accepted and better voted says: Yes, any programming language can do anything. Now, each paradigm has its own way of…
-
7
votes1
answer307
viewsWhat is the purpose of the Reflect object in Javascript?
Still curious with some news that I’m seeing in Javascript, I would now like to know what is the purpose of the object Reflect. I even found an explanation in MDN, but I didn’t quite understand the…
-
7
votes2
answers209
viewsWhat’s the Weakmap object for?
How the object works WeakMap? What’s the difference between him and a Object (which is the most common in Javascript)? What’s the difference between WeakMap and Map? Which browsers can I use?…