If you don’t use type hints you fucking deserve it lmao
@AndreaDalseno2 жыл бұрын
I liked the joke. Actually, KZbin subtitles translated your sentence as "be an Arian" and it sounds a little bit scary, doesn't it? 😵💫
@cdhit2 жыл бұрын
Hi Arian, love your videos definitely. Could you make an episode about how to use Python package and to structure Python code to make project nice and clear ? @Arian
@RBBlackstone2 жыл бұрын
My condolences for Bernard ( AKA Wilhelm).
@HexenzirkelZuluhed2 жыл бұрын
"I don't want to push you in any specific direction" he said, while dismembering Person B.
@terencetsang95182 жыл бұрын
Dumbledore asked calmly
@derGerlach2 жыл бұрын
When I started with Python, TypeHints were not available. Then I had to work with Springboot wich uses Java. I really loved the statical typed style. It just forced me to write better code. Nowadays I use type hinting in every piece of Python code and i love it. It helps so much, especially with bigger projects. Great video, keep it up 👍👍
@roelmathys2 жыл бұрын
But it's a game of hints in Python. No statistical analysis is done, in Java it would not compile and would not run. And it's getting better, but it's making code much more verbose.
@redcrafterlppa3032 жыл бұрын
@@roelmathys a good rule of thumb is when your types get out of hand and look verbose and cluttered, rethink your design decisions.
@roelmathys2 жыл бұрын
@@redcrafterlppa303 Python existed for two decades without this. Python doesn't do anything to improve type safety based on type hints. You still can run the code if the type hints indicate it should not run (mypy). It's bolted on and feels more like documentation than something else.
@redcrafterlppa3032 жыл бұрын
@@roelmathys only because it runs doesn't guarantee its good code. The level of control a strongly typed language provides python can never achieve. Overall in my opinion python is a really ugly language with to much dynamic and "it works somehow" in it. I don't get what to even use python for.
@roelmathys2 жыл бұрын
@@redcrafterlppa303 statically compiled languages give type guarantees but do not guarantee correctness or good code. But I do not understand what you are commenting about. If you don't want Python, what are your remarks adding?
@wesselbindt2 жыл бұрын
My main gripe with type hints is that they have a tendency to give a false sense of security. I've lost count of the times where I and my colleagues thought some piece of code was type safe only to later find out that something was inferred to be of type Any because of a poorly typed 3rd party library or some forgotten subscripts on a generic (the idea usually being that surely mypy should be able to infer this). Sure, many of these instances could've been avoided by configuring mypy to be as strict as possible, but in projects which started out untyped and are in the process of migrating to using types, this is simply not realistic. Still, in spite of this, it is absolutely beyond me that someone would choose to write a large production system in completely untyped code. The horror
@andyblue9532 жыл бұрын
I'm always wondering why developers would switch at all to Python for larger productions? It's not like there aren't good alternatives.
@tkerkvliet2 жыл бұрын
isn't that just the perfect description of development reality: fixing shit of people that made choices that are absolutely beyond us
@alex9522 жыл бұрын
@@andyblue953 because of its extremely fast turn around for development and easy of use/learn. It’s also got many libraries that help you deliver code. As a company you can enforce documentation, testing, etc. which helps overcome the drawbacks of the language.
@newperspective59182 жыл бұрын
@@alex952 Tbh I don't really see easy of use/learn to be a mayor point. For me it is all about libraries and the ability of the language to solve the problem. Python is a bad choice if type safety or high performance is key, so just pick something else, e.g. C++. I think Python, C++, HTML, CSS and JS is all the languages you need to know in most cases. Then add som SQL, bash and UNIX knowledge on that and you can basically solve any problem.
@stephens39092 жыл бұрын
Where third party libraries are involved, this is where type casting comes in, especially if you are taking advantage of abstract interfaces and some OO patterns when using some third party libraries.
@cemsity2 жыл бұрын
My use case for type hints is mostly for the IDE Intellicode. If i have a larger application then using type hints with mypy keeps me sane and prevents a lot of dumb bugs. Also the fact that type hints aren't required enable the developer to omit type hints where they aren't need or obvious.
@simmonslucas2 жыл бұрын
I guess that this benefit should have been apparent to me, but I didn't realize. A great time saver to find errors before you debug.
@rban1232 жыл бұрын
yeah especially on a big project I'll typically have a CI job which runs mypy automatically on every PR and fails the PR if there are any type errors
@xor2003 Жыл бұрын
* Type hints in Python are optional * They can aid with debugging and avoiding outdated documentation * They also assist with autocomplete options in IDEs and make code easier to read and write * Python 3.10 allows for lowercase type hints for certain data types * Using type hints improves code quality and catches errors early on * It promotes explicit data structure design and simplifies code-writing * Type-driven development clarifies how data will interact and detects issues with complex functions * Pydantic and type hints improve data understanding, focus unit tests, and offer faster and accurate accuracy checking.
@TomTrval2 жыл бұрын
Agreed👍. Type hints are especially helpful for me in 2 cases> -when I return to my code after long time or study code from someone else🤯 -early detect problems with code architecture. I learned when I am thinking to my self "Hmm typing this code is hard" it means there is something wrong with architecture (usually I missed abstraction to decouple modules)
@roelmathys2 жыл бұрын
Type hints are just hints, if somebody puts them in, and the next person does not respect the "contract", the application still runs.
@Aldraz Жыл бұрын
My personal strongest arguments for using or not using type hints are these: Pros - Using type hints will actually make your code much faster one day, because libraries like mypy, etc will use it to compile to much faster code. Cons - It clutters the screen and the more type hints you have the less immidiate information you have in some sense, so maybe using it for every function isn't the best idea.
@Ludwighaffen19 ай бұрын
Another "con" is that, at least in data science, many bugs come from the wrong dimensionality of a data structure, or the wrong formatting of a specific table column, or a column not existing. These bugs can only be properly handled by managing exceptions inside functions and type hints is not really helping.
@CornishMiner2 жыл бұрын
I've picked up the habit, and I like it. It helps me a lot with keeping track of what I'm doing, it reduces documentation and it helps make the most of the ide.
@SophieJMore2 жыл бұрын
3:06 minor correction, before 3.9 I remember I had to change all my type hints in one of my projects to make it compatible with python 3.8 so that it could run on windows 7
@lunarmagpie43052 жыл бұрын
3.9+ style type hints work in 3.8 if you do `from __future__ import annotations` at the top of the file
@SophieJMore2 жыл бұрын
@@lunarmagpie4305 Interesting. Thank you, I didn't know that
@mamazu19952 жыл бұрын
It's a great video and I completely agree that types are a great way to ensure correctness and proper scope of functions. One thing that I would also like to add to point 4 is that, if your program is sufficiently typed then you can do "type assisted refactoring". For example you want to replace a property of an object with a method call or something. Just remove the property from the object and then run a static analyzer like mypy and see where the code fails. Then you know which places to fix. This is much easier than trying out all possible paths that could crash the program.
@ErnestGWilsonII8 ай бұрын
I just want to say thank you very much for making these videos and sharing them with all of us. I only recently found your channel and I am now subscribed with notifications enabled and thumbs up! Thank you, Ernie in Pennsylvania
@ArjanCodes8 ай бұрын
Thank you for the kind comment, Ernie!
@NStripleseven2 жыл бұрын
Another nice ide-related thing that type hints improve is autocomplete. If your ide knows that a variable is supposed to be an int, it can give you suggestions that make sense for an int value.
@tronicit10 ай бұрын
I think that's probably the best reason to use them. That and the methods which work as soon as you apply the hints. It's often easier to pick a method or related function from the list than trying to remember the exact syntax which doesn't work if you haven't got it correct.
@liquidpebbles2 жыл бұрын
I recently moved from a C# job to Python... Man, I can't stand dynamically typed languages. The development experience with a typed language is far superior in my opinion as it opens up so many possibilities for the IDE.
@Michal_Peterka2 жыл бұрын
I prefer the way F# works. You don't have to specify the type at most of time but it is still strongly typed. And there is VS Code extension Ionide that displays the types annotation for you.
2 жыл бұрын
@@Michal_Peterka type inference of ML-like languages are awesome, F# is underrated
@Pirake1232 жыл бұрын
Type hints actually make python more enjoyable. Putting them in the language means we don't get a Tython language down the track (like Typescript for JavaScript)
@roelmathys2 жыл бұрын
I don't know, it's a lot of extra typing, a lot of extra verbosity. And it's not that it's statically typed at that moment, it will just run fine, wel :) Statically typed languages result in not being able to execute the application. Type hinting is just that: hints. It - currently - does not make code magically safer, it depends on running mypy ... , or makes the generated application faster..
@Shivnaren2 жыл бұрын
Thanks a lot, Arjan-learned all about typing and types from you. One downside is I can't stand to read untyped python anymore...unfortunately there's a lot of it about :D
@dougalscott48962 жыл бұрын
I teach people coding (i.e. programming, not just python) and I find type hints very useful. It gets the student to think about the code that they are writing before they start bashing away at the keyboard, and if they need to change the types it probably means that they need to change the code.
@joningram2 жыл бұрын
You briefly mention 'duck typing' in the beginning, and I think this is the issue I have with the mass importation of type hints into Python - they miss that what I want to specify in a function header is not the type I require of an input variable, but instead what capabilities that variable should have. For example, if I am writing a 'max' function, then I don't want to restrict it to a list, or a tuple, or any inbuilt type - I want to accept anything which can be iterated through. There are various guises of this idea - interfaces, templates, contracts - in other languages and I am hoping that this is the direction that typing will go in Python. The other issue I have with typing is that it can make quite simple ideas (like passing a function into another function) complicated purely through awkward syntax. I have been able to explain and demonstrate ideas such as callback functions very easily in Python which I would have struggled to write in a language which required types.
@DajesOfficial2 жыл бұрын
You have types such as Iterable and Callable for that specific purposes
@wyst69 Жыл бұрын
Your recorded the whole video in one single shot ! That's clean.
@arnold91032 жыл бұрын
We started using those at work! Improved readability and quality somehow !
@andyblue9532 жыл бұрын
I use Python for data science purposes and am perfectly happy with dynamic types for rapid prototyping. I use type hints only very rarely and prefer default values instead. But it seems that more and more serious programmers move to Python as well, to write larger projects with a stronger need for type control. Since there's plenty of excellent alternatives with static types, I always wonder about their motivation to switch... ?
@ArjanCodes2 жыл бұрын
What I often see in the companies I’m working with is that they start with a simple data science project in Python, but then things become more complex. They want to keep using all the useful libraries in the Python ecosystem, but they want to add an API layer to the data processing system. Or what about doing complex computations in parallel? Or how about running all those things in the cloud? Or what if you want to make the code generic so you can use it for multiple clients? Or add authentication to control access to the data? Etc etc. It’s at this stage where you can really benefit from a more strict approach to writing Python code to keep things manageable.
@Witpaardt2 жыл бұрын
@@ArjanCodes that is more a cultural problem and by definition not generalizable. I think you make good points in your video, but @Andreas Groth does as well. Also microservices. In many companies those data science scripts might turn into a small service where typing can be useful, but not necessary. There your final point about short scripts remains valid. Furthermore, naming things clearly can also help with documentation (as you can see in your video). The thing about Python is, the language is flexible and that is a good feature imho.
@Ziggity2 жыл бұрын
I started a job at a young startup last year, backend was written in python and was completely untyped. I was losing my mind. These days after pushing hard in that direction everything is typed and I am a happy dev
@kayakMike10002 жыл бұрын
Type hints are sorta like stronger typing which is pretty good... Wasn't available when I started with python, but I can see great value.
@roelmathys2 жыл бұрын
Python was already strongly typed - has always been told. You do not get a statically type checked language with these type hints. It's more for documentation purposes.
@anyyyel Жыл бұрын
Dude, your channel is really good. Congratulations! Simple, objective.
@ArjanCodes Жыл бұрын
Glad you like the videos!
@quaxBK2 жыл бұрын
The strongest argument for type hints are for the LSP imo, you get much better diagnostics and completions that way.
@nargileh12 жыл бұрын
yeah code completion is the best thing I get out of type hints; with CTRL-click to jump to definition code in second place
@sorvex910 ай бұрын
Literally the primary reason I use them lol
@andrewglick62792 жыл бұрын
I love type hints in Python and I always try to use them. For people wanting safe validation from type hints, checkout the Beartype library (it is a decorator you can add to functions that verifies your arguments with your type hints). I do think type hints have ways to go, and part of that may be Python's refusal to enforce them even as part of convention. For example, there is something so much more elegant about `foo?: int` in TypeScript than `foo: Optional[int]` (I hate having to import Optional). The lack of type hinting enforcement in libraries also makes it difficult for IDEs to work at their full potential. And don't even get me started on how hideous the `Callable` type hint is. Though generally speaking, I think Python is headed on the right track for improving type hints.
@cn-ml Жыл бұрын
I just cannot grasp why people dislike using type annotations. The amount of coding errors type hints prevent is just insane. Even with statically typed languages people usually code bugs, but without type checking even it's almost impossible to write code that works the first try. I absoltely hate python without types.
@ЮрійАндрашко-у8я Жыл бұрын
For complex tasks where we need types there are Java or C#... Python and JS does not need types, they are for rapid development. Type hints are ok until you need to use multiple generics with restrictions. And then you need more time to write type definitions than the actual code.
@wylde7802 жыл бұрын
This video is prefectly timed as i recently came across some type hints in some airflow code and didn't understand it. Thanks
@robertbrummayer49082 жыл бұрын
Great video Arjan. I also use type hints a lot in my code. I recommend mypy as type checher. It can easily be integrated into VS code.
@bonquaviusdingle5720Ай бұрын
Using type hints actually enables your editor to function similarly to a compiler, which helps a lot in developing quality code.
@sync98272 жыл бұрын
The PyCharm IDE checks if the types of the arguments and of the return value match with the types specified in the docsring. So while you're writing the code the IDE checks if all the types are correct even though you aren't using any type hints. So you can do type-driven development without type hints. But since type hints are pretty elegant and less work than writing docstrings, I might also start using type hints...
@hansdietrich149611 ай бұрын
Also, PyCharm hints become much better, when you're generous with adding type hints to your code.
@postmodernist1848 Жыл бұрын
After learning a lot of Python I tried C and it really changed my perspective. At first, I thought that static typed languages are inferior (are dumb??) and then I realised that it's much, much easier to understand and maintain typed code. Static typing is a great feature, not a disadvantage. When I came back to Python, I knew I needed to use (optional) typing
@ThatOpinionIsWrong Жыл бұрын
You mean Optional[typing] ? lol
@bluzter2 жыл бұрын
Type hints are kinda satisfying which is why I love them.
@nisheetpatel26542 жыл бұрын
I often forget to hit the like button until the time you mention it, but this time, with the lego people in the first 20 seconds, I knew this video was legendary!
@Betacak32 жыл бұрын
Source code is meant to be read by humans. You only ever write a piece of code once, but you will read it many times. So, whenever you ask yourself "Is it worth it to spend this extra time to write this?", think of the time it could save when you have to deal with that bit of code 6 months or more later. That's my response to the "It's more work" argument and - in my experience - a good way to approach code in general. Don't write code for your computer. Write it for yourself and your collleagues.
@banatibor832 жыл бұрын
Very very good point. The most important attribute of code that it should be easily readable. That's why I like to use small functions with self explanatory names, and spend time on naming my variables. When things are well named it is easy to read and understand the code. Type hints start to get extremely helpful when multiple scrum teams are working on the same software. Unavoidable that these teams will develop a common library for certain tasks for that software, type hints in that common library can save many hours.
@victormungai Жыл бұрын
In one of the latest updates(at the time of writing this comment) to the python extension on vscode, one can instruct vscode to activate the type checker. I have mine set to strict and I'm glad I did.
@aashayamballi2 жыл бұрын
Just wanna say.. thank you, Arjan! Have learned a lot from you on Python 🙏
@ArjanCodes2 жыл бұрын
You’re welcome - glad to hear that the content is helpful to you!
@fexofenadinaGenerica2 жыл бұрын
I agree. Type hints help to better understand the code.
@rachinini2 жыл бұрын
Python as a simple scripting language that is used for writing small to medium-sized programs is beautiful. Adding type hints, redundant features (how many string interpolation methods do you need?), and other excess features has turned Python into an ugly, unstable mess.
@bluesdog882 жыл бұрын
Arjan you are a strange man, that's mostly why I subscribed....keep up the good work and code!
@הודגמרסני-ת5ל2 жыл бұрын
A team for the win!! Once again, great video. notes are taken!
@ArjanCodes2 жыл бұрын
Thank you, glad you liked it!
@ivhea2 жыл бұрын
Density of jokes per minute is augmenting with each new video. At some point this will become a comedy channel. Just a fact, not a judgement. :)
@ArjanCodes2 жыл бұрын
You got me!
@Pawl0solidus2 жыл бұрын
After working for years with Typescript I’m learning Python for some months and I can see extreme value in these type hints, they are really useful for the reasons mentioned in this video.
@maksimon519 Жыл бұрын
in short, type hints make development much faster. it also help editor to auto-complete the name of attributes, which makes writing codes much faster and satisfying.
@josewilhelm27172 жыл бұрын
Great video! Can we have a discussion video about Object Oriented Programming and why it is being criticized so much lately?
@HelloWorlds__JTS2 жыл бұрын
@ArjanCodes already has a handful of videos discussing tradeoffs between functional and object oriented programming. Just search for object oriented in the search bar on his main page, and the first 5-6 videos are probably exactly what you're looking for.
@josewilhelm27172 жыл бұрын
@@HelloWorlds__JTS oh thanks, I didn't know. I will search it out!
@distant66062 жыл бұрын
I also recommend using mypy to check for these type hints.if u type hint a variable to str and then assign to it an integer mypy will throw you an error.
@riptorforever22 жыл бұрын
Psico introduction with Dexter's serial killer flavor.. loved!
@ArjanCodes2 жыл бұрын
Tonight’s the night…
@ea3gug2 жыл бұрын
Hey!, excellent video as always, very educational. Thanks!. I am oriented into app security, and I have found a paralelism about this technique and a tool called 42Crunch that does unit testing against an API definition (Swagger, OpenAPI), doing unit tests against the type definition to check the specification against the real input/outuput, messing with parameters, so it is the same concept, to check that development meets specification.
@ArjanCodes2 жыл бұрын
Thanks for sharing!
@sanketower2 жыл бұрын
Doing OOP without type annotations is practically against the basic design patterns that define that paradigm. Typing in Python may not be the default behavior and is technically just sugar coating, but adding it to your already structured project can help you discover a lot of vulnerabilities and bad practices hidden behind your Python trickery. Like they always say; make it work, then make it right.
@airatvaliullin84202 жыл бұрын
I don't want to push you in any particular direction *beheads a lego man who is against typehinting*
@willemvdk48862 жыл бұрын
The Wilhelmscream had me, haha. And the fact that you used Uncle Bob's book lol
@ArjanCodes2 жыл бұрын
Thanks :)
@TheSzybas Жыл бұрын
That "luhnatic" joke was perfect!
@ArjanCodes Жыл бұрын
Thank you Tomasz, glad you liked the video!
@FabioKasper2 жыл бұрын
Ohh, "type hint" is how it is called then. All I know is that I started using them after seeing it in your videos. Thanks again. 😂
@JorgeEscobarMX2 жыл бұрын
I have to agree that removing type checks on unit tests is removing a lot of boring repeating work. As long as we are all consenting adults, I'm removing type checks from my own unit tests.
@thomassmail68962 жыл бұрын
This is really cool, I wasn’t even aware of them. I feel they are something I might add at the end of writing a function when I go back and comment my code.
@ArjanCodes2 жыл бұрын
Thanks so much Thomas, glad it was helpful!
@NicholasShanks2 жыл бұрын
Try adding them right at the start when you don't even know how the function is going to work yet.
@JuampyRabino2 жыл бұрын
Love that you used Wilhelm's scream at the beginning 🤣🤣🤣🤣
@ArjanCodes2 жыл бұрын
It's my favorite sound effect :)
@handle_and_gretel2 жыл бұрын
use type hints and then vscode extension AutoDocString to create the small snippet for documentation
@tugrulpinar162 жыл бұрын
Thanks a lot for expanding on this
@ArjanCodes2 жыл бұрын
You’re welcome!
@LewisCowles2 жыл бұрын
I Liked this. Another reason to use them (I wrote you an email about not liking type-hints) is that it can make it easier for compliant tools to assist a coder in refactoring in certain code-bases. I Still don't type-hint everything, but have found myself using type-hints more and more. Do you think Guido comments have proven to be unhelpful in use of this language feature, or perhaps are misinterpreted?
@ArjanCodes2 жыл бұрын
Thanks Lewis! Your email was one of the reasons I created the video 😊. I can’t speak for Guido, but programming languages are always changing, leading to new insights into how to make things better which in turn changes our opinions about things. I’m in favor of a stricter Python, while at the same time not losing the flexibility and simplicity of the language in its current form. But let’s see, that might also change in the future 😁.
@sillytechy2 жыл бұрын
Hi could you recommend a book on software design. Like how to design a large scale software with multiple elements like database, cloud elements(AWS/AZURE), break into smaller components, make Class relationship diagrams to use OOPs properly. Any book that talks on this.
@Ludwighaffen19 ай бұрын
Thanks for this great video. In your neat example on the luhn_checksum function (I liked your lunatic joke btw 🙂), I'd argue that "number" is a pretty bad variable or argument name in the first place. But we all Bernards got your point. ;-)
@snippletrap2 жыл бұрын
Arjan you have the best programming content and the high production values are impressive. But if you're going to show your arms, you ought to tone them up!
@JeffreyChadwell2 жыл бұрын
Nice use of the Wilhelm Scream!
@ArjanCodes2 жыл бұрын
Ha, thanks! 😁
@k98killer2 жыл бұрын
Might be preaching to the choir with this one, but I imagine some people haven't experienced the difference between coding with type hints and coding without them.
@matrixtoogood56012 жыл бұрын
How to use type hints in frameworks like Django?
@parisqs Жыл бұрын
Beware: If you don't write type hint, you LEGO body will be torn apart!
@zackadam25982 жыл бұрын
I liked this video explicitly for the LUNA dig. Spicy! 🌶
@cdhit2 жыл бұрын
Hi Arian, love your videos definitely. Could you make an episode about how to use Python package and to structure Python code to make project nice and clear ? @Arian
@Andrumen012 жыл бұрын
Think about typehints as seat belts for code. In principle, they aren't needed, but during a crash they can save you!
@DanielStoehr203 Жыл бұрын
Do you have a favorite Type checker? Pyright? Mypy? And why? Are there differences?
@ranjansingh99722 жыл бұрын
Type Hints add to why I find Python to be a frustrating language. It’s a language that seems to support every paradigm of programming, and because of that it’s hard to know ‘the right way’. It’s just endless learning of new language features and tweaks - and there’s no escaping it because the libraries/frameworks you use pull in language features from across the spectrum. Probably been trying to learn/code in Python for 6 years and still feel like a complete novice. That same amount of time in an older language, like C, was enough for relative mastery (vastly different eras though, I concede).
@lowkeygaming4716 Жыл бұрын
Nice vid. Very insightful.
@ArjanCodes Жыл бұрын
Thank you, glad you liked the video!
@samsung40_media872 жыл бұрын
I do it automatically, it doesn't feel like extra work and follows on from explicit > implicit and defining the return type as a way to guide others so as not to use mixed return types
@davethorn94232 жыл бұрын
If I had a function expecting a string , surely don't call the argument number , call it num_str or something ? Or am I missing something . Just clear naming seems to be a solution ?
@johnjsal Жыл бұрын
Is that VS Code you were using? What is the name of that syntax theme?
@davidedigrande32042 жыл бұрын
My internal OCD programmer COMMENDS that I add type hints in all of the code. Sometimes I do it in variables declarations too, when the type of the object is not obvious.
@eengamer1582 жыл бұрын
The only reason I use type hints is to irritate my teacher by using intentionally wrong hits because he doesn't allow me to use my programming language of preference
@cezhou91409 ай бұрын
Type hints is like you spent an eternity to get accustomed to duck typing and then it gets shattered to dust.
@vaolin17034 ай бұрын
Just use typing.Protocol
@colletantoine88852 жыл бұрын
Thanks for this great video ! How to you manage type hints with bumpy in Vscode ? I always end up with a lot of warnings although I use bumpy.typing ...NDArray etc.
@bitswapper Жыл бұрын
VSCode doesn't show the type mismatch in python when I use type hints
@HaiderGill-th5bp Жыл бұрын
I was always told to prefix my variable names with int_, flo_, str_, boo_ in C so I know what type it is, I expanded it for C++ obj for object why do it because datetime could be an datetime obj or a string holding a datetime...
@miguelvasquez98492 жыл бұрын
How should i type when a function receive an object that is not imported in my module? Should i import it only for the hinting?
@p.t.83122 жыл бұрын
Do I need a special VS Code extension to highlight incorrect types in, for example, function arguments? Looks like it doesn't work by default.
@Celestialzzz2 жыл бұрын
in vs.code for me type hinting does not flag a type mismatch error as you display at 7:55 in your video. Is there an extension that you have to download first to have this work?
@CynicalOldDwarf2 жыл бұрын
I like the concept, hate the syntax though. I wish they'd have kept a c-style typing syntax (as in type first, e.g. int a_number) instead of using typescript's syntax
@blutella41622 жыл бұрын
Great video.
@ArjanCodes2 жыл бұрын
Thank you!
@willemvdk48862 жыл бұрын
I definitely like "Type Driven Development" way more than I like "Test Driven Development", honestly ;)
@kurkabane7022 жыл бұрын
Can someone explain why the function argument 'number' is reffered further as 'nr'? Is it some recent feature?
@sandie_jr7 ай бұрын
Finally, I'm convinced!
@ArjanCodes7 ай бұрын
Glad the video was useful then! Ahah
@hansdietrich149611 ай бұрын
I'm waiting for the day, when all python code, that is type hinted, automatically gets jitcompiled and is just 100x faster than the other code. At that point, most people will switch by themself.
@kosmonautofficial2962 жыл бұрын
Interesting video thanks
@TechieGuy822 жыл бұрын
Love you videos.. Actually "your bad joke" made me laugh :D Thumbs up
@ArjanCodes2 жыл бұрын
Thanks! 😃
@hshhsjhahsvs77282 жыл бұрын
Am rooting for type hints included.
@TheKubaski Жыл бұрын
I noticed that you use a tab to debug the python code. Does anyone know how to set that up?
@realms42192 жыл бұрын
Type hints are implicit documentation, the best kind
@appuser2 жыл бұрын
It's hard not to like them when you discover bugs right away when you start using them and from that point forward (that would otherwise escape your notice).
@russianbotfarm30365 ай бұрын
If you’re going through the rigmarole of type hints you should just use a static language.
@presstv2 жыл бұрын
Did you kill Person A along with Bernard The Headless? that's not fair🤣😂. great video Arjan :)
@malmiteria2 жыл бұрын
i think you didn't talk about some fair criticism of type hint tho. For exemple, one of the great value of type hint you talk about is entirely reliying on IDE tooling, which make it much less valuable in general (think any IDE that doesn't support type hint) Another big one to me is that it's a hint, so i can be wrong. And since it's built in a way for you to trust it, and rely on it, it can trap you in some errors hard to anticipate, if you absolutely type hint everything everytime. In other term, it's a situational tool, which has its good use case, and its dangerous use case also, for any non straightforward code, you're kinda lost in some more complexity I mean, how would you type hint a decorator for example? what about a decorator with parameters? Sure, it's doable, but is it really helping? I'm sure there's more to say, like, it's made to look a lot like type declaration in other statically type language, so it gives a very missplaced impression of what it is, for anyone coming from those language, which is definitely *not* going to lower the learning curve for them (by trapping them harder in the idea that it's more than just a hint i mentionned earlier, for example), and python is usually known for its great learning curve.