Questions tagged [weak-typing]
The weak-typing tag has no summary.
10 questions
1
vote
7
answers
438
views
Is it possible to introduce Pointers to a weakly typed programming language?
Most weakly typed languages do not have a concept of a pointer. Instead, most of them use references. However, is it possible to introduce pointers to such a language.
From a naive point of view, to ...
9
votes
3
answers
2k
views
Paradigm for handling list of things or single elements
Very often when coding in Python (or any language where type is not specified) I run into the following problem:
I want to write a function that can accept either a thing, or a container of such ...
11
votes
3
answers
3k
views
Is changing the type of a variable partway through a procedure in a dynamically typed language bad style?
In Python (and occasionally PHP) where variables do not have fixed types, I'll frequently perform 'type transformations' on a variable part-way through my code's logic. I'm not (necessarily) talking ...
6
votes
4
answers
2k
views
Can a loosely typed language be considered true object oriented?
Can a loosely typed programming language like PHP be really considered object oriented?
I mean, the methods don't have returning types and method parameters has no declared type either.
Doesn't ...
8
votes
3
answers
7k
views
Is there a difference between casting and converting types in imperative programming languages?
The question came up in a discussion at StackOverflow.
Is there a clean distinction between the two concepts cast and convert (concerning the type of an object), or are these two words describing ...
17
votes
4
answers
7k
views
Why are weakly-typed languages still being actively developed?
I wonder why are weakly-typed languages still being actively developed. For example, what benefit can one draw from being able to write
$someVar = 1;
(...) // Some piece of code
$someVar = 'SomeText'...
11
votes
4
answers
3k
views
How does thinking on design patterns and OOP practices change in dynamic and weakly-typed languages?
There is a fairly helpful question already along these lines ("Non-OOP Design Patterns?"), but I am more curious about a transitional point of view for someone just getting started with dynamic and ...
1
vote
4
answers
274
views
Syntax extension in weakly typed lanuages?
I like languages that give me the ability to extend the syntax of the language. At the same time, all the languages that I know will let me extend the syntax have relatively heavy type systems. Are ...
44
votes
4
answers
18k
views
What arguments are there in favor of weak typing?
This came up in a discussion with a friend, and I found myself hard-pressed to think up an any good arguments. What benefits do weak typing confer?
45
votes
7
answers
92k
views
Type casting variables in PHP, what is the practical reason for doing this?
PHP, as most of us know, has weak typing. For those who don't, PHP.net says:
PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by ...