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 - "i want static typing"
-
I found this on Quora and It's awesome.
Have I have fallen in love with Python because she is beautiful?
Answer
Vaibhav Mallya, Proud Parseltongue. Passionate about the language, fairly experienced (since ...
Written Nov 23, 2010 · Upvoted by Timothy Johnson, PhD student, Computer Science
There's nothing wrong with falling in love with a programming language for her looks. I mean, let's face it - Python does have a rockin' body of modules, and a damn good set of utilities and interpreters on various platforms. Her whitespace-sensitive syntax is easy on the eyes, and it's a beautiful sight to wake up to in the morning after a long night of debugging. The way she sways those releases on a consistent cycle - she knows how to treat you right, you know?
But let's face it - a lot of other languages see the attention she's getting, and they get jealous. Really jealous. They try and make her feel bad by pointing out the GIL, and they try and convince her that she's not "good enough" for parallel programming or enterprise-level applications. They say that her lack of static typing gives her programmers headaches, and that as an interpreted language, she's not fast enough for performance-critical applications.
She hears what those other, older languages like Java and C++ say, and she thinks she's not stable or mature enough. She hears what those shallow, beauty-obsessed languages like Ruby say, and she thinks she's not pretty enough. But she's trying really hard, you know? She hits the gym every day, trying to come up with new and better ways of JIT'ing and optimizing. She's experimenting with new platforms and compilation techniques all the time. She wants you to love her more, because she cares.
But then you hear about how bad she feels, and how hard she's trying, and you just look into her eyes, sighing. You take Python out for a walk - holding her hand - and tell her that she's the most beautiful language in the world, but that's not the only reason you love her.
You tell her she was raised right - Guido gave her core functionality and a deep philosophy she's never forgotten. You tell her you appreciate her consistent releases and her detailed and descriptive documentation. You tell her that she has a great set of friends who are supportive and understanding - friends like Google, Quora, and Facebook. And finally, with tears in your eyes, you tell her that with her broad community support, ease of development, and well-supported frameworks, you know she's a language you want to be with for a long, long time.
After saying all this, you look around and notice that the two of you are alone. Letting go of Python's hand, you start to get down on one knee. Her eyes get wide as you try and say the words - but she just puts her finger on your lips and whispers, "Yes".
The moon is bright. You know things are going to be okay now.
https://quora.com/Have-I-have-falle...#4 -
Dynamically typed languages are barbaric to me.
It's pretty much universally understood that programmers program with types in mind (if you have a method that takes a name, it's a string. You don't want a name that's an integer).
Even it you don't like the verbosity of type annotations, that's fine. It adds maybe seconds of time to type, which is neglible in my opinion, but it's a discussion to be had.
If that's the case, use Crystal. It's statically typed, and no type annotations are required (it looks nearly identical to Ruby).
So many errors are fixed by static typing and compilers. I know a person who migrated most of the Python std library to Haskell and found typing errors in it. *In their standard library*. If the developers of Python can't be trusted to avoid simple typing errors with all their unit tests, how can anyone?
Plus, even if unit testing universally guarded against typing errors, why would you prefer that? It takes far less time to add a type annotation (and even less time to write nothing in Crystal), and you get the benefit of knowing types at compile time.
I've had some super weird type experiences in Ruby. You can mock out the return of the type check to be what you want. I've been unit testing in Ruby before, tried mocking a method on a type, didn't work as I expected. Checked the type, it lines up.
Turns out, nested away in some obscure place was a factory that was generating types and masking them as different types because we figured "since it responds to all the same methods, it's practically the same type right?", but not in the unit test. Took 45 minutes on my time when it could've taken ~0 seconds in a statically typed language.11 -
Hi every developer! My name is Allen. English is not my native language so forgive me if I say something that does not make any sense. Let me tell you my story how I become a programmer. (I am still learning) My first computer was a DELL OptiPlex GX 720 desktop. My father bought it for our self-employee job. Before he allow me to use the computer, I used to sit next to him and watching what he do, what he click and what he gets. When he allow me to use the computer, I was slow at typing. One or 2 WPM (word per minute) my father taught me how to use the computer. Very slowly, my typing speed improves. I understand how to use the computer. but one day, I do what make me regret. I was playing with some executables, when I double clicking it, it does not work I used to associate files with apps. I associate music files with every player I want. So, I did what I used to, I associate exe files with windows media center! The computer started to open hundreds of windows media center (WMC for short) whenever an app is clicked, it opens windows media center. Today, I realized that windows were trying to open every app and every process that regularly run. However, since I associate it with WMC, instead of the app itself, it opens WMC some days after the mistake, I wonder how apps work and how I can create my own. My father told me before that a program is simply a binary file that the computer can read. However, it was too advanced to me at the time.I begin my search with google. Everytime I search, it says "learn to code" or something like that. I see some C++ code but, it was disgusting. when I read just a few lines of a hello world code in java. it was too complex
What I seen
#$$#% $%&$%&*#!@
~
(&*%&$ (_(*^% #&&* (^^$(&^$%^( %^*$())
~
^$70^(`*#%`*#&%^)*!" Hello world "#@
~
~
The actual code:
class helloworld
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}
I look for an easy way but my attempts fail. then. I push
I to learn how to code.I try learning java. but it still
Very complex. i tried LibertyBASIC. from LibertyBASIC to
Java. after learning LibertyBASIC, it was easy!
LibertyBASIC -> Java -> Ruby -> NOW, C# and XAML
Today, I am learning C# and XAML.
My first OS : Windows 7
My first Computer : DELL OptiPlex GX 720
My first successful click : The Start menu
My first used App : Microsoft Encarta 2009
My first created App : Hi-Lo(number-guessing game. written in LibertyBASIC)
Thankyou for reading this Long story.
8 -
How I met python
[long read but worth]
There's nothing wrong with falling in love with a programming language for her looks. I mean, let's face it - Python does have a rockin' body of modules, and a damn good set of utilities and interpreters on various platforms. Her whitespace-sensitive syntax is easy on the eyes, and it's a beautiful sight to wake up to in the morning after a long night of debugging. The way she sways those releases on a consistent cycle - she knows how to treat you right, you know?
But let's face it - a lot of other languages see the attention she's getting, and they get jealous. Really jealous. They try and make her feel bad by pointing out the GIL, and they try and convince her that she's not "good enough" for parallel programming or enterprise-level applications. They say that her lack of static typing gives her programmers headaches, and that as an interpreted language, she's not fast enough for performance-critical applications.
She hears what those other, older languages like Java and C++ say, and she thinks she's not stable or mature enough. She hears what those shallow, beauty-obsessed languages like Ruby say, and she thinks she's not pretty enough. But she's trying really hard, you know? She hits the gym every day, trying to come up with new and better ways of JIT'ing and optimizing. She's experimenting with new platforms and compilation techniques all the time. She wants you to love her more, because she cares.
But then you hear about how bad she feels, and how hard she's trying, and you just look into her eyes, sighing. You take Python out for a walk - holding her hand - and tell her that she's the most beautiful language in the world, but that's not the only reason you love her.
You tell her she was raised right - Guido gave her core functionality and a deep philosophy she's never forgotten. You tell her you appreciate her consistent releases and her detailed and descriptive documentation. You tell her that she has a great set of friends who are supportive and understanding - friends like Google, Quora, and Facebook. And finally, with tears in your eyes, you tell her that with her broad community support, ease of development, and well-supported frameworks, you know she's a language you want to be with for a long, long time.
After saying all this, you look around and notice that the two of you are alone. Letting go of Python's hand, you start to get down on one knee. Her eyes get wide as you try and say the words - but she just puts her finger on your lips and whispers, "Yes".
The moon is bright. You know things are going to be okay now.10 -
I was working with a stable installation of an elaborated platform. Some plugins were installed. After upgrading the installation by 2 patch level the customer registration was not working anymore.
In these two patch level a method in an interface got an additional optional parameter which had a major impact on the behaviour the implemented method. A plugin decorated the implementation without knowing about the new parameter. Therefore when calling the method the decorating class did not pass the new parameter in to the decorated implementation and the fallback value was given instead.
The caller expected the method to do something and did not branch into an alternative way but the default value disables the expected behaviour. Eventually nothing happened.
Breaking changes in patch levels woop di fucking do.2 -
!rant
Started learning Rust yesterday. As a web developer I like the static typing and the speed. I want to know a low-level language to complement Python but kind of dislike C and C++ and that's why I chose Rust. At the moment the syntax still feels kind of foreign but I probably need to just man up and embrace it. :)9 -
Oh my god, GDScript is the single biggest piece of shit scripting language I have ever witnessed. It somehow manages to combine the very worst things of dynamic typing with the downsides of static typing, all in one bundle of utter shit
Imagine you have two game object scripts that want to reference each other, e.g. by calling each others methods.
Well you're outta fucking luck because scripts CANNOT have cyclic references. Not even fucking *type hints* can be cyclic between scripts. Okay no problem, since GDScript is loosely based of Python I can surely just call my method out of the blue without type hints and have it look it up by name. Nope! Not even with the inefficient as fuck `call` method that does a completely dynamic-at-runtime fuck-compile-time-we-script-in-this-bitch function call can find the function. Why? Because the variable that holds a reference to my other script is assumed to be of type Node. The very base class of everything
So not only is the optional typing colossal garbage. You cant even do a fucking dynamic function call because this piece of shit is just C++ in Pyhtons clothing. And nothing against C++ (first time I said that). At least c++ lets me call a fucking function8 -
Things I wish I knew when I was younger:
- no matter how clean your teeth are, bad breath won't go away until you clean your tongue. Buy a tongue cleaner and use it after you brush your teeth
- whitening toothpastes don't work, while desensitizing ones work well.
- after you brush your teeth, spit but do NOT rinse!
- when brushing your teeth, keep the toothbrush angled 45 degrees. The bristle ends should touch the area where your gums meet your teeth.
- use sunscreen every morning.
- don't waste money on acne-treating products unless they contain salicylic acid, benzoyl peroxide, tretinoin or adapalene.
- if you want to lose weight, you have to eat MORE, not less. But, that “more” should be protein.
- showering every morning feels like “humanity restored” thing from Dark Souls. Also, clean your damn room and wash your damn windows.
- APS-C DSLR cameras make no sense. For their weight, you can get a full-frame camera, and for their price you can get an APS-C mirrorless cam that will be way lighter.
- If you want a damn thing, save up and buy that damn thing. Don't buy the alternative thing you don't want. You'll be asking “what if” till you either die or buy the original damn thing.
- people aren't replaceable, but many people can fit their designated role. Not being able to replace your ex-boyfriend with his exact copy doesn't mean no one else can be your boyfriend.
- try a MacBook & iPhone as soon as you can to check whether it's your thing or not, because if it is, oh boy are you in for a treat.
- added sugar is evil, but it's beneficial for the economy. It makes you fat, so you need a car, so you buy fuel. Also, you feel guilty because you're fat, so you buy diet products & things to compensate because you hate your reflection in the mirror. You also pay medical fees to treat your newly developed health problems, and you die a day before retirement. Everyone makes a buck on you eating added sugar but you.
- you can use the freshly removed sticker to remove the sticky residue left by that same sticker.
- static typing doesn't solve jack shit.3 -
Static typing : one boyfriend/girlfriend is enough for me
Dynamic typing : prostitute/womanizing mode activated (i have the right to fuck who ever i want) -
the irony appears to be that JavaScript is more consistent than rust
so let's say you want to create some enums to represent some potential values in a REST JSON payload
well you can implement Display trait but that won't determine the JSON output
you can make a as_str() method and that doesn't even make sense frankly, I guess it's not even a trait even though it's everywhere in the std library? (traits being rust's version of interfaces, so you'd think they should be consistent)
I have a halfway urge to say rust was a beloved language but then the foundations' drama made everyone escape the ship, leaving behind a mess
well evidently the answer is you use the stupid annotations:
enum Lang {
#[serde(rename = "en-US")]
EnUS,
}
well then this only works in serialization with serde. way to go.
how about if I have some JSON data that starts with numbers? I have an interval field in the REST that expects things like 1m, 15m denoting time scale
well no deal
because rust doesn't want enums starting with numbers
and here I thought rust was superior with its static typing. but I am having to rename things all the way down and nothing is consistent. this would be so trivial in JavaScript. and there's only one toString() method! and no interfaces people say you should use while nobody uses them!87 -
Realized what the meaning of life was yesterday.
Because the real meaning of life is yet to be found, there is an interim one — to do everything to help us exist as longer as possible as a species. So spread peace, empathy and forgiveness. If we live long enough to formulate the theory of everything, understand human brain and evolve past/patch our brains to avoid being greedy violent fucks, maybe then we'll find the real meaning. The longer we exist for, the better our chances are.
So, the ideal human according to kiki is:
- one that doubts everything and is free because of that. Freedom is doubt.
- one that has a habit of denying themselves pleasures. Without restraining themselves, one turns into a greedy, violent beast.
- actively contributes to the world peace & spreads peace among their peers, as true impact is immeasurable, and who knows, maybe butterfly effect will turn one “I'm sorry, I was wrong” into avoiding nuclear catastrophe.
There are adversaries that benefit from us bickering and fighting each other. They want to divide us. Let's deny them that. I announce that I won't engage in verbal battles and teardowns anymore.
Sometimes, static typing is beneficial. Sometimes, unit tests are necessary. JS, CSS and web platform as a whole are not perfect. JS is not perfect. Apple does anti-consumer stuff. Not all rich people deserve hate. Sass has its uses. Tailwind CSS has its uses. React has its uses.
Peace10