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
-
5
votes2
answers519
viewsWhat are checked exceptions?
While following a discussion about programming languages, I saw people arguing about checked excpetion each with its arguments for or against. They said that such language implements and such…
-
5
votes1
answer86
viewsHow to know which exception can be cast in C#?
If in Java I invoke the method void cadastra() throws SQLException for example, I will be required to add a block try catch or to "relaunch" the exception that can be launched by this method. That…
-
5
votes1
answer296
viewsWhat are the main differences between Ruby and Crystal?
I saw some information about the Crystal language a few days ago, but I would like to understand a little better what the main differences with Ruby. Examples: Which is faster and lighter in…
-
5
votes1
answer677
viewsWhat is the difference between getCanonicalName() and getName()?
To return the package name with the class name I always used the method getName(). However in that reply of @Articuno of the question: Customize the eclipse Generate toString() to print the path of…
-
5
votes1
answer183
viewsPass arguments to the property getter
VB.NET allows you to declare parameters in the property getter Public ReadOnly Property Propriedade(param As String) As String Get Return param & "!" End Get End Property It’s a strange feature…
-
5
votes2
answers1259
viewsWhat are the function of each string prefix in Python?
In Python, we often see strings with a prefix, such as below, where the prefix is used r: r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix…
-
5
votes3
answers167
viewsDoubt about C pointers
So guys, I got a question here. What does each of these statements mean below? *ponteiro = Valor do ponteiro ponteiro = (?) &ponteiro = Endereço de memória do ponteiro I would like someone to…
-
5
votes1
answer1303
viewsWhat are the scenarios in which C# has an advantage over other languages?
Here on the site have some similar questions, for example, What are the ideal use scenarios for Node.js? and Why choose C instead of C++ or C++ instead of C? I would like something in this sense but…
-
5
votes1
answer72
viewsAtomic Types in C language
What is the difference between primitive and atomic type ? What are atomic types for ? In which situations they are applied ?
-
5
votes2
answers908
viewsWhat is the real PHP interface utility?
I know what interface is used as a common pattern. But it doesn’t seem useful. Because what good it is to create an interface that only has the name of the methods? I have to encode each of them in…
-
5
votes1
answer728
viewsWhat is and what is the explanation for type-safe in C#?
Not being able to understand the concept of type-safe in C# and what is its use, since C# is type-safe.
-
5
votes1
answer295
viewsWhat is the difference between extension and library in PHP?
In PHP there are some extensions within the language. For example, the SPL, to PHAR and the PDO are some of these extensions. Basically, my doubts are as follows:: What’s the difference between an…
php terminology characteristic-language library extensionasked 5 years, 11 months ago raphael 2,131 -
5
votes1
answer138
viewsThe spread of Ecmascript ... arr is an operator?
I’ve seen articles referring to spread as "spread syntax" and as "spread operator" (for example here). I understand that an "operator" is "a function that takes arguments and returns a single…
javascript terminology characteristic-language operators ecmascriptasked 5 years, 6 months ago Thiago Krempser 1,878 -
5
votes2
answers215
viewsDid "Class Components" die in React?
Before the React update 16.8 it was not possible for functional components to be internal, so Hooks arrived to solve this problem, so the functional components became the standard of React. Then the…
-
5
votes1
answer348
viewsWhat is Pattern Matching?
I’m reading about the Pattern matching and I’m still very confused about this feature because it’s something new for me. Here are some examples: {:ok, result} = {:ok, 12} {:okay, 12} and 12 = result…
-
5
votes2
answers61
viewsWhat is the definition of delete in Javascript?
I came across an instruction that delete represents a type in Javascript. At least that’s what I understood. I’d like your help because I couldn’t find any references on the Internet. if…
javascript characteristic-language objects operators deleteasked 4 years, 6 months ago Willian Andrade 53 -
5
votes1
answer60
viewsWhy can’t Ambroses support type notes?
We know that Python, as of version 3.6, supports annotating types in functions and variables, according to the PEP 526 -- Syntax for Variable Annotations and PEP 3107 -- Function Annotations. def…
-
5
votes2
answers237
viewsAccess Javascript properties: point notation or square brackets?
Let’s say we have an object called rectangulo and a property called area. We can access this property in the following ways: Point notation: rectangulo.area. Bracket notation: rectangulo['area']. I…
javascript characteristic-language objects propertyasked 4 years, 4 months ago Tiago Martins Peres 李大仁 236 -
5
votes1
answer185
viewsWhat is the difference between creating an object from the literal form or from a constructor function?
I wonder if it has any difference or relevance between the two forms below in the construction of an object: Create an object from the literal form: let pessoa = { nome: 'Pedro' };…
javascript characteristic-language objects builder prototypeasked 4 years, 7 months ago felipe cardozo 275 -
5
votes2
answers162
viewsWhen using the term "prototype" to refer to a Javascript method, as in "Array.prototype.foreach"?
Javascript has several objects with methods, as is the case of arrays which have, for example, the method forEach. But eventually the same name can be used by other objects, such as method forEach…
-
5
votes1
answer129
viewsHow do PHP 8 attributes work?
In PHP 8, the attributions, which can be used in classes or methods. Example: namespace MyExample; use Attribute; #[Attribute] class MyAttribute { const VALUE = 'value'; private $value; public…
-
5
votes1
answer53
viewsWhat good is lib.rs in Rust?
As shown in this question, in Rust it is possible to import a file (its structs, functions, etc) using the keyword mod. For example, in the following directory structure: src/ main.rs…
-
5
votes1
answer60
viewsWhat is the relation of the "+" operator to the "valueOf()" method in Javascript?
I have a question about the operator +. In this answer on the operator, the following was said: The + can also play the role of a binary operator. In that case, operates on two values. In this…
javascript characteristic-language operators type-conversionasked 3 years, 6 months ago Cmte Cardeal 5,299 -
5
votes2
answers86
viewsIs there a difference in creating objects and adding properties with literal notation or with`new Object` in Javascript?
I have a question. Do this here: let meuCarro = new Object(); meuCarro.fabricacao = 'Ford'; meuCarro.modelo = 'Mustang'; meuCarro.ano = 1969; console.log(meuCarro.fabricacao);…
-
4
votes1
answer110
viewsHow this expression 'a' <= c <= 'z' is evaluated in Python
I would like to know the evaluation order of this expression in Python: if 'a' <= c <= 'z': # c é uma variável de tipo `chr` print("Ronal... D'oh!")
-
4
votes1
answer214
viewsWhy does javascript "{} + []" equal 0?
I was watching a video that was shown to me by the user @CiganoMorrisonMendez, called WAT. There were some examples where they showed some bizarre things present in some languages. In particular…
-
4
votes1
answer3647
viewsIf Boolean('0') is true and Boolean(0) is false, why is '0' == false true in Javascript?
Why in javascript Boolean('0') is true, Boolean(0) is false, whereas when comparing '0' (a zero alone in the string) with false he returns true? Why would you behave? Example:…
-
4
votes1
answer66
viewsWhy can’t we use Await inside a Catch, Finally and Synclock in VB?
Why can’t we use the operator Await within the statements Catch, Finally and Synclock in VB? The C# 6.0 has support to use the Await within the Catch/Finally.…
.net vb.net characteristic-language try-catch asynchronousasked 7 years, 10 months ago vinibrsl 19,711 -
4
votes2
answers334
viewsSentence separated by comma in an IF Javascript would have what purpose? " if (1, 2) {}"
By accident when I was changing a Javascript code I made, I put a comma instead of the || in an expression if. I altered if (that.busy || that.completed) return; for if (that.busy, that.completed)…
-
4
votes1
answer1480
viewsAfter all, why use C when programming in C++?
I’m learning C++ and I can’t understand why people think C knows C++? Or are the differences between the two despicable? I know the syntax is similar, but C++14 does things that C doesn’t, and aside…
-
4
votes0
answers58
viewsIsn’t the value of an unassigned int variable in C++ 0 (zero)?
I’m having my first serious contact with C++. I wanted to see what would happen if I added up a value int of a variable assigned with another without assigning, and see what happened: #include…
-
4
votes0
answers40
viewsWhat is the purpose of using "{ }" keys to access the property of a class?
I was doing some tests with the magic method __get PHP and discovered a different way to access class properties, which is by using keys { }, see: return $this->{$bar}; I can also access the…
-
4
votes1
answer944
viewsHow to pass values by reference in Java?
Gentlemen, one of the methods of the class Array has the method sort. The method sort works like this: Arrays.sort(vetor); The vector itself is changed, I searched in many places and from what I…
-
4
votes1
answer357
viewsDifferences between Python and Javascript in relation to arrays?
I’m having some difficulty because in Javascript it was possible to do this: const x = [] x[0] = 1 x[1] = 2 But in Python when I create an empty list and try to make a statement it says that the…
-
4
votes1
answer3377
viewsWhy is the use of ';' mandatory in the WITH clause?
I’ve always used the WITH in my consultations, however, I never understood exactly why is required the ';' before the clause WITH. The Error is very succinct, but it gives an idea that the WITH…
-
4
votes1
answer225
viewsStrength of typing in Lua language
Lua has dynamic typing, but after all, is it strongly typed or weakly typed? Every source I consult has a different information, which left me in doubt.
-
4
votes2
answers459
viewsWhat’s the "Never" type for?
Today I was asked what the guy is for never Typescript, but it got confused for me. It just serves to say that it does not return anything? What’s the difference to the void?…
-
4
votes2
answers317
viewsWhy does "echo" accept parentheses in PHP?
In PHP, the echo can you receive parentheses because you consider that an expression? Apparently, some language features do not seem to be standardized and can therefore be used in numerous ways.…
-
4
votes1
answer85
viewsWhy use parameter modifiers?
While writing functions and subroutines, we use parameters to interact with the function algorithm. These parameters can have several purposes, such as passing a value, a reference, or leaving a…
-
4
votes1
answer90
viewsMultiple dispatch in Julia language
I’m studying about the language Julia and read that the multiple dispatch allows the functions to be dispatched dynamically, but it’s still not clear to me.
-
4
votes1
answer64
viewsDoes the programming language that follows only one paradigm have any advantage?
Programming languages that have only one paradigm such as Haskell (functional programming) or Smalltalk (object-oriented/message-oriented) benefit from focusing fully on that paradigm? What are the…
-
4
votes2
answers189
viewsSum function with a large value returns a wrong result
Why is my summation function returning to me 633223344234234200000 and not 633223344234234234235? function plus(n) { return n+1; } console.log(plus(633223344234234234234))…
-
4
votes1
answer127
viewsWhat are Javascript property descriptors and attributes and how do they work?
Eventually I read, mainly in more advanced content about objects in Javascript, the terms "proprietary descriptors" and "property attributes". I believe they are related concepts. What they are and…
-
4
votes1
answer176
viewsHow to use . reduce with async/await?
In synchronous code I can have a .reduce to make a sum calculation (as in this simple example of a shopping list): const tipos = ['leite', 'manteiga', 'pão']; const precos = [23, 21, 32]; const…
-
4
votes1
answer179
viewsWhat are the main differences between Arrow Function and Closures (anonymous functions) in PHP?
In version 7.4 of PHP, it was implemented Arrow Functions. Example: $double = fn($x) => $x * 2; var_dump($double(4)); // int(8) Which could be done as follows in previous versions: $double =…
-
4
votes1
answer166
viewsWhat is globalThis in Javascript?
I was looking at an example of code and I came across an example that had globalThis: // timeout de 1s globalThis.setTimeout(() => alert('Olá'), 1000); The setTimeout no secrets, but had not yet…
-
4
votes1
answer68
viewsWhat are dependent types and dependent language?
About what they are statically typed languages I am already aware, but the concept of dependently typed language is new to me. I think it has to do with something called dependent types, but I also…
characteristic-language typing language-independent computer-science type-theoryasked 3 years, 8 months ago Luiz Felipe 32,886 -
4
votes1
answer146
viewsWhat is the difference between the "in" operator and the "hasOwnProperty" method in Javascript?
An unexpected behavior (at least for me) occurred with the following excerpt of code that I will demonstrate below: const str = new String('olá SOpt'); console.log('Usando "in"', 'length' in str);…
-
4
votes1
answer47
viewsWhy does the "delete" operator not remove references to a deleted Javascript property?
I am reading a book about data structure in Javascript and came across the following situation: why delete does not delete a reference value? I will give an example to be clear. const items = { a:…
javascript characteristic-language objects operators deleteasked 3 years, 7 months ago Mr Genesis 464 -
4
votes2
answers67
viewsIs there practical application in write-only properties?
In object-oriented programming, a property is a member of a class that provides information about the object. That is, properties expose attributes. Properties can also be "write only". An example…
oop characteristic-language software-engineering property language-independentasked 3 years, 5 months ago vinibrsl 19,711