Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "duck typing"
-
Stack Overflow is my rubber duck. I can't tell you the number of times I've figured my problem when I'm typing in my question. Something about trying to find the best way to word the problem helps jumpstart my brain and so I can figure out the solution.3
-
Everyone talks about their hate of js but like python is honestly just as bad.
- shitty package manager,
* need to recreate python environments to keep workflows seperate as oppose to just mapping dependencies like in maven, npm, cargo, go-get
* Can't fix python version number to project I.e specify it in requirements
- dynamic typing that gets fixed with shitty duck typing too many times
- no first class functions
- limited lambda expressions
- def def def
- overly archaic error messages, rarely have I gotten a good error message and didn't have to dive into package code to figure it out
- people still use 2.7 ... Honestly I blame the difficulty of changing versions for this. It's just not trivial to even specify another python version
- inconsistent import system. When in module use . When outside don't.
- SLOW so SLOW
- BLOCKING making things concurrent has only recently got easier, but it still needs lots of work. Like it would be nice to do
runasync some_async_fcn()
Or just running asynchronous functions on the global scope will make it know to go to some default runtime. Or heck. Just let me run it like that...
- private methods aren't really private. They just hide them in intelisense but you can still override them....
I know my username is ironic :P11 -
Developers created IDEs with intelligent code completion and languages provide users with an annotation syntax to document their methods.
And then there is Python, nuking all the efforts of our ancestors by dynamic typing. And they are smug enough to call this laziness duck typing. "If it squawks like a duck, swims like a duck, walks like a duck its a duck".
Shit no, it ain't a duck because a fucking goose does all the same but is a mean bastard compared to a duck. You might pet a duck but only the craziest will attempt to pet a goose.
Fuck python and undocumented methods in particular!5 -
Python. Ok, so it's a really cool language, as a scripting language it's awesome, quick to write.
When it's been used to make full fledged oop programs that you suddenly have to maintain things like duck typing become problematic. Looking at an object fuck knows what methods are available. Worse still when some bastard that thinks he's being clever doesn't bother declaring any object attributes and instead overrides the __set_attr method to dynamically add them as they are used there is no hope for the poor sod that has to maintain it later.
I've also now worked out I'm at least the 3rd person having been given the task of maintaining it, i spent a day changing CLI options wondering why they didn't do anything but occasionally crash the app. I've now found a few thousand lines deep that someone had hard-coded these values because they couldn't work out where to get the CLI args from!
I've gained a new appreciation for nominative, strictly typed languages.11 -
OK I've just got an idea that I think would be quite neat:
How about a virtual rubber duck that sits in the corner of your editor? Just like the gem in old Word, if you remember. It's yellow and quacks sometimes, and nods understandingly when you talk to it (mic monitoring).
And it also monitors your typing and says (popup text bubble) things like:
"those parentheses doesn't look balanced to me"
"did you really initialize that variable?"
"you wrote JASON again"
"you forgot the ;"
You get the point.
I don't have time to implement, feel free to steal my idea and become a millionaire.5 -
Duck typing
If something quacks that does not mean it's a duck. A duck has wings, can fly and is renowned for eating bread. For all you know what you have is a tape player.5 -
I was flash developer once, it was great when macromedia was around, then adobe acquired them, now flash is gone.
Years are passing and most of industry is the same as always. Trying to drag you into this rat race of learning new amazing technologies, amazing projects that are actually doing same job as 50 years ago but using more memory and cpu cycles. Because all has it’s roots in algorithms from previous centuries.
So youngsters loose your best life time, be innovative by doing nothing more then copy paste from stackoverflow and duck typing shitty code.
Be a slave and sit in the amazing office, that has everything but not your real life that meanwhile is sucked by corporate squeezer till your last breath.
Be piece of shit that can be kicked around.
Watch youtube, facebook, instagram or whatever social network that shows you pictures that are fooling your mind that you’re someone special and you need this stuff.
Then be ready to suck some dicks to earn money and buy stuff you don’t need, live where you don’t want and do what you don’t like. You piece of shit.
Well that’s what disappoints me from my tech stack.
Now chill out, turn off your electronic gadgets, go out and enjoy real world.1 -
On C++ forum and see reference to Type Erasure (TE). Search around, some Java shit bleeding into other programming languages. Finally find an article that not only explains what TE is, but why you would use it in C++. ITS JUST FUCKING DUCK TYPING. Please stop using stupid names for stuff. You don't sound smarter. You sound like an asshole. Anyway, thinking about it does make sense to call it Type Erasure, but I still think it sounds pretentious. Cool concept, stupid name. Will continue to confuse people saying: "oh, you mean duck typing?"
Cool article:
https://davekilian.com/cpp-type-era...
The wikipedia article about TE doesn't explain shit about why you would even use it. Just repeats the same word salad of words I first saw about TE. I get that its jargon, but from the outside it just sounds like bullshit. I have never heard anyone I work with spew out shit like that. Even the ones with masters degrees in computer science.
I am not even sure I want to learn more about CS than what keeps me employed. I don't want to sound like this when I talk. I have already said shit in meetings about modern C++ that has colleagues (other sparkies, and some CS people) wondering what I was smoking. It wasn't even that jargony.
Don't mind me, just a sparky starting to understand why the CS world is so fucked. Maybe its just academia I can't stand. I dunno.
I should ask in a meeting if someone can define a monad for me.21 -
Finished exams, in 3 days i have a flight to my parents house to see them.
Before that, thought about comming to my grandma's home, which has a beach nearby so i can spend 1-2 days relaxing.
Came here. No one is home. I don't have keys either. I'm hungry too.
Fortunately the wifi signal is ok.
Sat in front of the door, and opened my laptop.
Time to start migrating my projects from duck to static typing and practising my ability to write python code with type annotations until someone comes home.3 -
About half the chats with my line manager is just me being a rubber duck equivalent to him.
M: Can you implement the stuffity stuff like I asked?
Me: *starts typing*
M: Oh nevermind it was cached -
Just found out that Ruby does not have any formal langauge specification. Instead, they just use the ruby-spec test suite. If your compiler can pass those, then it's probably a ruby compiler.
This is a pure duck typing at a compiler level. LMFAO.4 -
Can JS events bubble in trees of objects other than DOM nodes? If so, what properties do I need?
I tried to read this: https://dom.spec.whatwg.org//... but it's stupid long, references a bunch of other functions and I got lost in between the variables.
I'm kinda confused because it often uses type checks (i.e. if target is a Node or a Window object), which goes against the very point of duck typing.
I could technically make my nodes into DOM nodes, but I'd rather have them inherit from Worker.1 -
My new favourite RUNTIME c# error, evidently thrown by the standard library because the string is not present in the project:
"no parameterless constructor defined for this object"6