Most voted "typing" questions
For data type system related issues.
Learn more…349 questions
Sort by count of
-
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
answer282
viewsAre all Javascript values, except primitives, objects?
The documentation at w3school says All Javascript values, except primitives, are objects, which are they: string number boolean null undefined So let nome = 'João'; It’s primitive string type, and…
-
10
votes2
answers882
viewsStandard for typifying errors/exceptions?
As far as I know, Javascript has no error typing. In C# and Java, it is possible to do things like: try { /* .. snip .. */ } catch (FooException foo) { /* .. snip .. */ } catch (BarException bar) {…
-
10
votes2
answers16161
viewsWhat types of data exist in Mysql for text?
What kind of data exists in Mysql? What’s best for storing long texts? (HTML-shaped document for example) Why?
-
10
votes2
answers375
views -
10
votes2
answers6643
viewsWhy is my function concatenating instead of summing the numbers?
I am learning Javascript and I am breaking my head with this code that I created. Why is my function concatenating instead of summing the numbers I store in the variables? <!DOCTYPE html>…
-
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 <=…
-
9
votes2
answers235
viewsWhat does the _t suffix mean and when to use it?
I see in many codes some variables with the suffix _t. There are a lot of examples in the standard C library like size_t, int32_t, mbstate_t. What is the use, and when to use this suffix?…
-
9
votes1
answer128
viewsHow does a machine identify the type of data?
A little while ago I had a question about how a machine defines/identifies the data type. I mean, when we’re a high-level application we have the definitions that that data can be a integer, string,…
-
9
votes1
answer94
viewsWhy can Unboxing only be made for the type that was previously performed Boxing?
I’ve been searching for why there is Unboxing and Boxing, the answers I found say there is to value types have the same behaviour as Reference types, for example on non-generic lists ArrayList. So…
-
9
votes1
answer147
viewsPHP 7 - Why does a method that returns the primitive String type not generate an error when returning a Boolean value?
PHP 7 - Why a method that returns the primitive type String, does not generate error when returning a value Boolean? <?php class Foo { public function bar() : string { return true; } } $Foo = new…
-
9
votes2
answers1126
viewsWhat kind of data (double, float) should I use when representing a temperature?
My question is regarding the use of Double and of Float in Java exercises when having to declare a temperature (Celsius scale). Which one should I use in this case? I declared as Double, but the…
-
8
votes3
answers920
viewsCan using non-priminal variable type in C# affect performance?
Using non-priminal variable type in C# can affect performance? I have seen several codes where, instead of using primitive C#types, many use types similar to other languages that the IDE accepts. I…
-
8
votes1
answer702
viewsMeaning of (void *)
What is the meaning of calling a function with one that was int and is passed as (void *)? If variable was declared as int because it is passed as a parameter to a function *(void *)variavel* ?…
-
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
votes1
answer14933
viewsDouble type and Decimal type, which is suitable for monetary value?
I found here in the SO a question with an answer until well accepted by the community What kind of data (double, float or decimal) should I use to represent currency in . NET with C#? I just never…
-
8
votes2
answers2568
viewsWhat is the purpose of the size_t and ssize_t commands in C?
What is the purpose of commands size_t and ssize_t? What kind of data they represent? size_t minhavariavel1; ssize_t minhavariavel2;
-
8
votes1
answer2417
viewsSimulate boolean type in C
What is the most appropriate way to simulate the type bool in C? My teacher did it in a very simple way. #define bool int But I also found an excellent answer here (follows a copy of the code). //…
-
8
votes1
answer91
viewsType Int8 on Swift does not store maximum integer 255
Doing some pranks on the Playground, With Swift 2.2 we can declare constant let testeIntOitoBits: Int8 = 127 //maximo - deveria ser 255 let testeIntOitoBits2: UInt8 = 255 Why can’t I store 255 in…
-
8
votes1
answer1179
views -
8
votes3
answers1793
viewsHow to divide integers and get value with decimal part?
I am trying to divide the following values into c#: Double media = 0.0; int soma = 7; int cont = 2; media = soma / cont; Is returning 3.…
-
8
votes4
answers8025
viewsCheck if int is "null" in C#
Cannot assign on C# null at an integer value (int, nay int?). However, how can I know if an integer value (int) has not yet had an assigned value (being of the type int)? int? valor; if (valor ==…
-
8
votes1
answer1237
viewsDoes the type annotation in a function not guarantee the type in Python 3?
It is known that in Python it is not necessary to define the type when declaring a variable and this is interesting, however, when creating a function, I cannot restrict the types of attributes, so…
-
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
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
votes1
answer170
viewsWould it be bad practice to insert monetary symbols directly into the bank?
In a system I had to tamper with wage values and commissions, perform calculations on them and the like. However I went to analyze that the monetary symbols are being inserted directly in the…
-
7
votes3
answers823
viewsAssign array type in PHP
I know PHP is a weakly typed language. But there is some alternative way to "type" a array in PHP? Example, I can do this below to force receive a specific type of data in a function. function…
-
7
votes3
answers1561
viewsIncrement letters in PHP?
Recently I needed to increment letters in PHP within a loop. For each iteration, instead of numerical indexes, it needed letters of the alphabet. So, as I already know that PHP does letter…
-
7
votes1
answer2097
viewsWhat is the difference between the concept of static and dynamic typing and the concept of strongly and weakly typed?
There is some confusion about the concept of programming languages with static and dynamic typing and the concept of strongly and weakly typed programming languages. For example, in my opinion…
-
7
votes1
answer1093
viewsHow does dynamic typing work in Python 3.x?
I am new to Python and a question came to me when solving exercise 1001 of Uri Online (read A and B, assign sum to X and print), when writing the following code, I received the concatenation: a =…
-
7
votes1
answer2296
viewsRounding as a result of multiplication
I have this scenario: - multiply by 2 values which will be rounded to 2 boxes for the table to be inserted. Follow the example: CREATE TABLE #TMP ( A DECIMAL(23,6), B DECIMAL(28,2) ) INSERT INTO…
-
7
votes1
answer10908
viewsWhat does a double precision variable mean?
I would like to understand the meaning of a variable of double precision.
-
7
votes1
answer10500
viewsWhen to use lists and when to use tuples?
What’s the difference between the types list and tuple in Python and when to use each?
-
7
votes1
answer311
viewsWhen to use Supertype or Subtype when returning the method?
Suppose I have a method called "meuMetodo()" that returns an Object of Type ArrayList<String>, i can make this method declare that returns more concrete or more abstract types: public…
-
7
votes1
answer115
viewsWhy is the expression (double.Minvalue == double.Minvalue + 1) true?
The following code C#: public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(double.MinValue == double.MinValue + 1); Console.WriteLine(int.MinValue…
-
7
votes2
answers74
viewsWhat is the best type to store area, volume, perimeter?
Decimal, Numeric or Float. What is the best option for storing area or volume? I would use Decimal, but I would like to see the opinion of others as well. I guess not, but the right guy or the next…
-
7
votes2
answers406
viewsWhy doesn’t Java add up the numbers in expression?
public class Teste { public static void main(String[] args) { int x = 0; int y = 1; int z = 2; System.out.print(x + y + z); } } This returns: 3 public class Teste { public static void main(String[]…
-
7
votes2
answers4291
viewsDifference between date and datetime
I was researching the type of data SQL SERVER and I came across this table What would be the real difference between date and datetime data? Time, minute, second notation only ? What would that…
-
7
votes2
answers602
viewsError splitting image in half using Python
I’m trying to split an image in half using the code below, but I’m having a feedback error. Code: import cv2 import numpy as np # Read the image img = cv2.imread("IMD015.png") width = img.shape #…
-
7
votes1
answer1335
viewsIs it possible to "force" Javascript typing?
In PHP I’m used to creating a function and can declare the types of parameters I want, even knowing that the language is weakly typed, but in JS I can do this? Example in PHP: <?php class Teste {…
-
7
votes1
answer309
viewsJava how to compare "float" to "null"?
public class NuloOuNao { public static boolean isZero(float num) { if(num == null) { return true; }else { return false; } } public static void main(String[] args) { isZero(10); } } Row 5: The…
-
7
votes2
answers116
viewsWhat happens when we assign the default value to objects?
Example: public Carro Metodo(string marca) { Carro carro = default; if(!string.IsNullOrEmpty(marca)) { carro.Marca = marca } return carro; } Studying on the Internet, I realized that some objects…
-
7
votes1
answer295
viewsDifference between using Generics and "any" in Typescript?
When I know it’s better to use Generics or any in Typescript?
-
7
votes3
answers229
viewsHas Javascript changed its rules about what is false or true?
It occurred to me in the part about booleans, the following problem. I have this variable: var name = "10kg" / 10; if (name) { console.log(name); } else { console.log("Not exist"); } The same should…
-
6
votes3
answers8025
viewsDifference between decimal and Numeric
The two types of data, DECIMAL and NUMERIC, are/can be used to store exact values. For example: Is there any difference between Salario DECIMAL(5,2) and Salario NUMERIC(5,2) in Mysql? Is there any…
-
6
votes1
answer297
views -
6
votes1
answer75
views -
6
votes1
answer712
viewsWhat is the concept of integers signed in a programming language?
I would like to clarify the meaning of the term "whole signed". I’m researching protocols, to build one in Java, and sometimes I find the term. I don’t know what it’s about. I’ve always heard of…
-
6
votes1
answer81
viewsJava type relationship or other language with processor architecture
Java has the primitive types: int and float, that store at most 32 bits of information, and we also have the types long and double that store 64 bits of information. Does this have or might have…