[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What exactly is wrong with duck typing?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 59
Thread images: 6

File: 6799351990_a716c10ae8_z.jpg (194KB, 588x640px) Image search: [Google]
6799351990_a716c10ae8_z.jpg
194KB, 588x640px
What exactly is wrong with duck typing?
>>
Wrong board
>>>/fa/
>>>/lgbt/
>>
File: duckling-6622.jpg (217KB, 1366x768px) Image search: [Google]
duckling-6622.jpg
217KB, 1366x768px
>>56395061
>programming languages are off-topic
>>
>>56395041
Trades safety for short-term convenience.

The way Go does interfaces deprecates it.
>>
>>56395041

absolutely nothing

I like to think of it as the language getting off your dick

you can just do whatever you want
>>
>>56395739
>>56397189
You guys realize OP is a degenerate homosexual right?
>>
>cuck typing
FTFY OPFaggu
>>
>>56395061
>>56397252
>>56397215
>xD le macbook meme
>xD le degenerate meme
>>
>>56397252
this lmao
>>
>>56397272
>unironically making fun of ironic memes that involve unironic faggottry
>>
>>56397272
It's not a meme though. I'm gay and own apple products, my friends are the same. We all like to blow each other in the weekends while playing U2 songs on our macbooks.
>>
>>56395041
>What exactly is wrong with cuck typing?
>>
>>56397287
Circumstantial. I'm gay and I've never owned a Mac product. My friends and I don't even blow each other on the weekends because we're too busy fixing our broken Arch updates.
>>
Nothing. If your project is large enough that duck typing would legitimately make it more difficult to debug, it is too large for a slower language like Python or Ruby in the first place.
>>
File: 61e.jpg (96KB, 800x891px) Image search: [Google]
61e.jpg
96KB, 800x891px
>>56397664
>or Ruby in the first place.
You wanna get shot son?
>>
>>
Am I the only one whose developed a weird hybrid typing style? I predominantly only use my pointer and index finger, but I reach my hand all around the keyboard to type.

It's pretty efficient too, I'm no pro typist but I can crack 60wpm if I'm familiar with the keyboard. Haptically, the use of the thumbs, vestigial finger and pinky is retarded and handicaps dexterity.
>>
>>56398038
>60wpm
lmao
>>
>>56397189
Sometimes doing whatever you want is a good thing, sometimes it's a bad thing.
Static typing has a lot of advantages; safety (can provide a type that doesn't implement the interface), compiler optimizations (methods are known at compile time, can be inlined, etc.), better tooling (the IDE can determine the names and signatures of the methods).
Dynamic typing pretty much just insures that none of the above can be guaranteed.
>>
>>56398011
From the thumbnail I though that duck was going into a spinning fan
>>
File: 1468110203681.jpg (126KB, 768x1024px) Image search: [Google]
1468110203681.jpg
126KB, 768x1024px
>>56398038
>pointer and index finger
>>
>>56395041
It's slow
>>
>>56395041
Do you hold ctrl while typing? :^)
>>
>>56395041
fucking love ducks
https://www.youtube.com/watch?v=mENSZw01c_8
>>
>>56401384
yo who is that
he looks familiar
>>
>>56395041
Structural typing is more weakly typed than nominal typing.
For some cases, this is a good thing, and for some cases, this is a bad thing.

>>56397664
Languages like Python or Ruby are not the only languages with structural typing.

>>56399814
This has nothing to do with static vs. dynamic typing.
>>
>>56395041
It makes code completion without running code more difficult since you don't know the type of an object until runtime.

Similarly you cant perform certain optimizations until runtime unless you know the type of the object.
>>
>>56397272

>xD le reddit refugee
>>
>>56400177

Were you disappoint?
>>
>>56395041
How can a duck type?
>>
>>56404376
I know I was
>>
>>56397619
Kek
>>
>>56397664
This, I work on a 500k LOC rails project, makes new hires get started on the project really slow, especially if they're edgy neckbeards that refuse to use a decent ide like Rubymine. Stuff like duck typing and monkey patching are OK if you're a small team on a small project.
>>
>>56395739
>Go invented anything new.
>>
>>56395041
Type errors can propagate far away from where they were caused. It's the same problem that null references have.
>>
More ducklings please.
>>
>>56395061
>>56397215
>>56397279
>>56397287
>>56397619

>judging people on their choice in computers
>using homophobic insults
>2016
>>>/pol/

>>56405530

WE DEMAND MORE DUCKS
>>
>>56395041
It isnt a duck if it isnt a duck.
I dont give a fuck if it looks, walks and sounds like one.
>>
>>56398038
this thread is about typing as in data type management
>>
>>56405590
>2016
bait?
>>
>>56395041
it's okay, but it's still dynamic typing. structural subtyping is essentially the same thing but static so there's usually no reason to use duck typing.
>>56404295
>Structural typing is more weakly typed than nominal typing
wrong. it encodes more type information than nominal typing. neither one is necessarily stronger than the other though. there are different axes on which type systems can be compared.
>>
>>56395041
>>56395078
>>56398011
where do you even get a duck?
>>
>>56405590
Hah, calling people faggots is standard procedure on 4chan. Newfag detected.
>>
>>56406397
Being a "faggot" is not congruent with homosexuality.
>>
>>56406001
there are dozens of ducks outside my apartment complex that live here
feed store is an option

not that hard
>>
Duck typing allows a language like Ruby to use its OO more like functional programming because object behavior is not constrained to the class definition and so objects can have methods added to it at runtime giving it very dynamic behavior. This is why Ruby is compared to Smalltalk, Alan Kay has always said that Smalltalk is not an object oriented language, that its based on message passing and that objects themselves should not have static types.
>>
>>56398038
>non lad here
isn't index finger basically a pointer
>>
>>56397664
Everytime you post talking like you know shit about anything, I feel like punching you in the face repeatedly until you say, bleeding from your mouth "I'm just a dumb tripfag and I don't know shit. I'm only in it to boost my bloated ego because I was raped as a child! I'm sorry /g/!".
>>
>>56405590
cuck typing
>>
>>56406449
It is here now fuck off
>>
>>56398011
expected gore
>>
>>56407611
There's a webm of male ducklings (not the one with the chicks) getting shredded to pieces by some machine. I was expecting that but sadly it wasn't the case.
>>
>>56398011
If only ducks didn't shit so much and so often, they'd make great pets. I have a cockatiel and I can barely deal with his relatively tiny shits.
>>
File: 3e8.jpg (28KB, 367x390px) Image search: [Google]
3e8.jpg
28KB, 367x390px
>>56405590
>>
>>56397215
do you guys just not realize that you sound autistic as fuck when you say "degenerate"
>>
Duck typing is the future when type are checked at compile time
https://en.wikipedia.org/wiki/Structural_type_system
>>
>>56408763
That's literally against the definition of duck typing.
>>
>>56408829
No it's literally an example of duck typing.
>If it's quack like a duck it's a duck
That exactly what structural type system does.
>>
>>56407550
You should work on your grammar and punctuation.
http://grammar.ccc.commnet.edu/GRAMMAR/
Thread posts: 59
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.