Hahahahaha take that, type safety.
-
Microsoft they have punted on yet another type system. Film at... now, above, it's not film it's an article.
-
@Gribnit said in Hahahahaha take that, type safety.:
Microsoft they have punted on yet another type system. Film at... now, above, it's not film it's an article.
what?
-
@pie_flavor to
punt
vs tomake
was referenced in the first sentence. Atype system
is a thing some programming languages have. To complete the first sentence: IntroducingVariant
is punting on a type system.There is a commonly referenced phrase
Film at 11
being abused for the second sentence.A film
is an instance offilm
, another point where the second sentence might have thrown ya, buckaroo.Are you all better?
-
@Gribnit
unknown
seems fine to me - it's likeobject
in C#. You know it's an object of some type, and you need to pass it along, but you don't care which type it is nor do you need to operate on it.Your real complaint should be with the existing
any
type, which completely violates type safety.
-
@Gribnit To 'punt' is to drop-kick a football.
-
@pie_flavor The expression
punt or make
is unfamiliar to you. I have now used a sports analogy unfamiliar to the victim.
-
@Unperverted-Vixen Probably, but I didn't know it already existed.
-
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor The expression
punt or make
is unfamiliar to you. I have now used a sports analogy unfamiliar to the victim.OK.
What's it mean?
-
@pie_flavor It refers to a situation where you can
punt
and achieve a lesser score, ormake
and achieve a full score.
-
@Gribnit Ah, I see none of the languages you use have types like
object
orAny
.
-
@Unperverted-Vixen That's fine, as long as you can't inspect the value. If you can poke and prod at it and get it to do things, it breaks safety and puts you into the realm of duck typing.
-
@pie_flavor There's a difference between greenfield languages and non. When they reintroduce well-known mistakes, in a greenfield, there's a difference between that and a well-known mistake existing in non-greenfield.
-
@Gribnit What the fuck does greenfield mean?
I don't understand how it's so hard to use words that the people reading your posts are likely to understand.
-
@pie_flavor I'm sorry, I thought you worked in software engineering.
green
like the color, andfield
like where grass grows, to not help.
-
@Gribnit Well since not even you understand your own posts, I will make a wild ass-guess that you actually meant to say 'blank slate' (a metaphor that people actually use). The concept of
Any
/Object
is not a mistake.
-
@pie_flavor H'mm, depends on how precisely limited you intended your statement to be, sport. I am assuming "no precision of limitation" so I'm just going to laugh at you.
-
@pie_flavor That is what
greenfield
means. I've heard it a lot (well, I am in Silly Valley...). I always think of it as "it's a green field, there's no shit in it yet"
-
@pie_flavor said in Hahahahaha take that, type safety.:
@Gribnit What the fuck does greenfield mean?
I don't understand how it's so hard to use words that the people reading your posts are likely to understand.Greenfield development is a well-known term meaning developing something new, from the ground up, rather than building on an existing thing. As for what the rest of his post means, .
-
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor H'mm, depends on how precisely limited you intended your statement to be, sport. I am assuming "no precision of limitation" so I'm just going to laugh at you.
what?
-
@pie_flavor A statement can be limited or not limited. Are you with me on that? Precision, it is a thing, it differs from accuracy for instance, you are aware of the implications of that distinction? It will help.
Checkpointing here, is anything bleeding?
-
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor A statement can be limited or not limited. Are you with me on that? Precision, it is a thing, it differs from accuracy for instance, you are aware of the implications of that distinction? It will help.
I don't understand how limitations apply to what I posted.
Checkpointing here, is anything bleeding?
what?
-
@pie_flavor Having a way to denote an immutable object of a root type is fine. Mutable references to that kind of instance also seems fine. That's the precise limitation I'd place on such a statement.
-
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor Having a way to denote an immutable object of a root type is fine. Mutable references to that kind of instance also seems fine. That's the precise limitation I'd place on such a statement.
As opposed to what?
Object
doesn't have mutable methods, for example. If your object has mutable public methods, that's its own fault.
-
@Gribnit Putting it in C# parlance, TypeScript's
unknown
: C#object
:: TSany
: C#dynamic
. Both have their place,any
is a necessary evil for adding incremental typing to your existing JS codebase, andunknown
is a very welcome improvement over it.
-
@Gribnit said in Hahahahaha take that, type safety.:
Microsoft they have punted on yet another type system. Film at... now, above, it's not film it's an article.
... Huh? It already had
any
which is far worse than this. (But required to interface with legacy JS in a lot of cases.)
-
@blakeyrat okay. So they'd punted to begin with, I suppose. It seems like introducing
unknown
opens up a chance they'll eliminateany
in a future release.
-
@Gribnit said in Hahahahaha take that, type safety.:
Checkpointing here, is anything bleeding?
Checkpoint status: OK. System Health monitor indicates no significant internal or external unexpected blood transference.
-
@pie_flavor said in Hahahahaha take that, type safety.:
If your object has mutable public methods, that's its own fault.
I think I'll blame Javascript for allowing objects to mutate their methods.
-
@Gribnit said in Hahahahaha take that, type safety.:
a chance they'll eliminate
any
in a future release."Oh, you want to utilize this plain in-house JS library in your project? Fuck you, write a full definition for it first."
One of TypeScript's objectives is to
strike a balance between correctness and productivity
. The ability to describe your existing code step by step, by gradually replacing usages ofany
with more specific types, is very important for that. Without it, your cost of introducing TS to an existing codebase would explode.
-
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor It refers to a situation where you can
punt
and achieve a lesser score, ormake
and achieve a full score.What game does this come from, sport?
-
@pie_flavor said in Hahahahaha take that, type safety.:
What the fuck does greenfield mean?
-
@pie_flavor said in Hahahahaha take that, type safety.:
@Gribnit To 'punt' is to drop-kick a football.
Yes. You punt when you have decided to give up and not continue any farther.
-
@dkf said in Hahahahaha take that, type safety.:
@pie_flavor said in Hahahahaha take that, type safety.:
If your object has mutable public methods, that's its own fault.
I think I'll blame Javascript for allowing objects to mutate their methods.
Python can do that, too. Dunno about more recent Py3, but Py2 certainly can.
class X: def frobble(stuff): print "hello" def defrobble(self, value): self.frobble = value x = X() x.frobble(6) x.defrobble(5) x.frobble(7)
The second call to frobble will fail because numbers aren't callable.
-
@Steve_The_Cynic said in Hahahahaha take that, type safety.:
@dkf said in Hahahahaha take that, type safety.:
@pie_flavor said in Hahahahaha take that, type safety.:
If your object has mutable public methods, that's its own fault.
I think I'll blame Javascript for allowing objects to mutate their methods.
Python can do that, too. Dunno about more recent Py3, but Py2 certainly can.
class X: def frobble(stuff): print "hello" x = X() x.frobble(6) x.frobble = 5 x.frobble(7)
The second call to frobble will fail because numbers aren't callable.
That's because Py2 objects are (mostly) a fancy dictionary. That second call merely overwrites the
frobble
key to point to a new value. It gives rise to lots of magic methods (__init__
,__dict__
and friends).And it works the same in Py3.4 (haven't bothered updating yet):
-
@Benjamin-Hall said in Hahahahaha take that, type safety.:
That's because Py2 objects are (mostly) a fancy dictionary. That second call merely overwrites the
frobble
key to point to a new value. It gives rise to lots of magic methods (__init__
,__dict__
and friends).Sure, I know why and how it happens (mostly by having done it by inattention when I was first learning Python back near the turn of the millennium(1)). My point was more that the ability to do that isn't unique to JS.
(1) Indeed, the question of it being so long ago is why I hedged on Py3.
-
@Gribnit Do you happen to work in the cloud storage business?
-
@Steve_The_Cynic said in Hahahahaha take that, type safety.:
@Benjamin-Hall said in Hahahahaha take that, type safety.:
That's because Py2 objects are (mostly) a fancy dictionary. That second call merely overwrites the
frobble
key to point to a new value. It gives rise to lots of magic methods (__init__
,__dict__
and friends).Sure, I know why and how it happens (mostly by having done it by inattention when I was first learning Python back near the turn of the millennium(1)). My point was more that the ability to do that isn't unique to JS.
(1) Indeed, the question of it being so long ago is why I hedged on Py3.
I was explaining for the audience, not attacking your competence. Sorry for the confusion.
-
@boomzilla said in Hahahahaha take that, type safety.:
@Gribnit said in Hahahahaha take that, type safety.:
@pie_flavor It refers to a situation where you can
punt
and achieve a lesser score, ormake
and achieve a full score.What
gamesport does this come from, sport?FTFY
-
@pie_flavor said in Hahahahaha take that, type safety.:
@Gribnit To 'punt' is to drop-kick a football.
In American (and Canadian? Wikipedia says yes.) gridiron football, a punt is different than a drop-kick. In a punt, the ball is kicked while in the air (before it hits the ground), and is a way of transferring possession to the other team under (one hopes) more advantageous circumstances than they would have if they attempted a riskier play and failed. The kicking team cannot retain possession of the ball unless the receiving team fumbles it. Punting is a very commonplace occurrence, generally happening many times during a game.
In a drop-kick, the ball is kicked on the bounce, and is a legal method of attempting to score a field goal. This is very risky, since the ball is not spherical and may bounce in difficult-to-predict ways, and consequently is very rare. There has been only one successful drop-kick field goal since the 1940s. (They were much more common before the ball was made more pointed in 1934, because the rounder ball bounced more reliably.)
Apparently both punts and drop-kicks exist in rugby, too, but I don't know enough about rugby to the difference between them.
-
@boomzilla Soccer.
-
@Benjamin-Hall said in Hahahahaha take that, type safety.:
@Steve_The_Cynic said in Hahahahaha take that, type safety.:
@Benjamin-Hall said in Hahahahaha take that, type safety.:
That's because Py2 objects are (mostly) a fancy dictionary. That second call merely overwrites the
frobble
key to point to a new value. It gives rise to lots of magic methods (__init__
,__dict__
and friends).Sure, I know why and how it happens (mostly by having done it by inattention when I was first learning Python back near the turn of the millennium(1)). My point was more that the ability to do that isn't unique to JS.
(1) Indeed, the question of it being so long ago is why I hedged on Py3.
I was explaining for the audience, not attacking your competence. Sorry for the confusion.
Ah, OK. No problem, no harm done.
-
@HardwareGeek said in Hahahahaha take that, type safety.:
They were much more common before the ball was made more pointed in 1934, because the rounder ball bounced more reliably.)
Apparently both punts and drop-kicks exist in rugby, too, but I don't know enough about rugby to the difference between them.
In rugby, the ball is not pointed (its an ellipsoid), so kicking it is probably more accurate. There are different circumstances under which a rugby player will kick the ball, which differ in whether that player attempts to score, whether the player expects his team to recover the ball afterwards, and how much the opposing team is allowed to interfere. I guess you could call the score attempts drop kicks and the kicks where the player doesn't attempt to score and expects to opposing team to get the ball punts (I don't know the full rugby vocabulary in English).
-
@dkf said in Hahahahaha take that, type safety.:
@pie_flavor said in Hahahahaha take that, type safety.:
If your object has mutable public methods, that's its own fault.
I think I'll blame Javascript for allowing objects to mutilate their methods.
FTFY