You have a God given, natural talent for teaching, especially for Python. I can't get enough of your videos. Please, please make as many as you can. I've subscribed and will probably 'like' them all. Thank you! BTW: Can you make another video that details your particular environment for optimal debugging Python code with Sublime? What is your solution for doing break points, variable checking, etc.? Thank you again so much.
@coreyms8 жыл бұрын
Thanks! As far as debugging goes, I usually have Eclipse pulled up if I need to do anything in-depth. If I'm within Sublime then I just stick to simple printing and logging. I'll do a video in the near future on both logging and debugging so people can get an idea of my process there. Thanks again.
@SirThane137 жыл бұрын
I've also found in what little I've done that EAFP pushes you towards code with fewer bugs. The exceptions are verbose and easier to diagnose. With it, I'm forced to see everything that doesn't match up. If I check for every little thing (as admittedly I used to), it turns into a scavenger hunt for why something I needed to run didn't. You can fix this by adding logging to every checked function, but that destroys your project with clutter. I've naturally gravitated towards EAFP, but you've put it into words. As always, thank you a thousand times for your excellent instruction.
@djanthony66629 жыл бұрын
Coming from PHP, this vid is one of the sweetest 15 mins in my life. Thank you.
@hasibahmad36603 жыл бұрын
I have watched a lot of tutorials on youtube, coursera, udemy on python but when it comes to your tutorial, I just can't skip a minute or speed up the video to finish it quickly. Your video says every minute is important, so, don't skip, just learn... Such an eloquent teacher you are who has precision as well as profound knowledge
@Makkar-b3v5 ай бұрын
Exactly
@rajeshkumarreddy8 жыл бұрын
I have learned a lot in Python from your videos than my online courses. A ton of thanks to you.
@thunder____2 жыл бұрын
I'm glad I was already aware of how new f-strings are before discovering your channel, bc if I didn't know f-strings didn't exist yet at the time you made this video, I'd be very confused at around 7:36 lol
@markb61936 жыл бұрын
Just like to add also. Your videos are fantastic; love the way you explain the concepts underneath. As most of it is hidden these days, you rarely see people explaining what's going on in the background.
@7674Manish5 жыл бұрын
I have watched most of your videos and can say you are awesome. Thanks for the contribution.
@finix74192 жыл бұрын
thank you Corey ,learning python is actually enjoyable with a teacher like you
@athisii_ekhe61674 жыл бұрын
Corey, you are the best at explaining things.
@alixaprodev4 жыл бұрын
you are the best teaching methodology I have ever seen
@hongphuongo18627 жыл бұрын
if only KZbin has a "Haha" reaction for your videos and codes. Very funny and attractive way to teach programming skills.
@TonyFlexPromo7 жыл бұрын
Your videos are flawless and priceless. I have learned so much new stuff on your channel.
@coreyms7 жыл бұрын
Awesome. That's good to hear. Thanks!
@FamilyGuySweden6 жыл бұрын
I am a newbie to python and it helped me alot, thanks Corey
@팍준하4 жыл бұрын
Summary: Duck Typing and EAFP are the fundamentals for a code to be 'Pythonic' Duck Typing is when programmers do not care about exactly what an object is, but only care about whether an object can do the operations that we need it to be. In Corey's example where he created classes 'human' and 'duck' and instance for each, both had the method 'quack' and 'fly'. Therefore, a programmer who does duck typing makes functions that can make use of objects that are of any classes, as long as they support the operations used in the function. (I believe this is partly caused by python's feature that we don't have to set the data type for the input and output of function. For example, Golang, or simply 'GO' is an programming language created by Google, and it requires the programmer to specifically set the input and output data type for function.) This leads to occasional errors, that occur when some objects do not support the operations. To avoid an error, programmers have 2 choices. 1. Avoid it in the first place 2. handle the error The first choice necessitates using an if block. Corey displays an example where he checks whether certain objects have certain attributes, to prevent errors such as 'class ~~~ does not support attribute ~~~'. He also shows an example where a file might could not be open even after chekcingthat is is accessible using an 'isaccessible' method, which could lead to an error. This is called 'Look before you leap', abbreviated as 'LBYL', and 'Asking Permission' from 'Easier to Ask Forgiveness than to ask Permission'. The second choice leads the coder to use 'try' and 'except' block, which handles the error after it has been found. There are reasons that the second method is favored over the first. 1. It is faster. The first method, 'LBYL' is checking whether an object supports an operation. That means the computer has to access and interpret what kind of class or type the object is. Executing the operations after that 'check', will make the computer having to interpret what the object is 'twice'. 'Asking forgiveness' method only has to access the object once, using the if block. This makes the runtime for 'asking forgiveness' faster, becuase it has less workload for the computer to do. 2. It is more readable compared to the first. In the video, Corey shows an example where he had to check whether a dictionary had a number of keys in it. That was indeed lengthy, which made it harder to read. In another example he showed, he had to be sure that a list had more than 6 arguments in order to print an item at index 5. He used an len() method and >= conditional, which was obviously lengthy . Using Try and Except blocks was a relatively concise and clear about what the code was all about. 3. It gives more control over 'unexpected' error. In the last example that Corey showed, 'LBYL' method did take account of instance where the file might not be accessible. However, Corey points out that a file could be closed right away and raise an error. 'LBYL' method has no way of handling this situation, since it is only designed to 'prevent' an error and does not has the ability to confront it. Try and Except blocks on the other hand, has the ability to resolve errors of any kind. Thank you Corey, you are changing the world for what you have done. I believe that your such actions of uploading free education videos are creating a difference in the world. Anyone in the world, whether they have money or not, can educate themselves as long as they have internet. That is the first step towards reaching general rights to education. Thank you!!! I will support you soon when I get a job!
@peggychen34114 жыл бұрын
팍준하 I have read all of your comments, very useful. Thx
@Aulin0014 жыл бұрын
@@peggychen3411 yes me too
@vivekan973 жыл бұрын
Thanks to you and Corey
@ericmacharia8042 жыл бұрын
This is a great video explaining how to use try/except. But one thing to keep in mind, try/except are most useful in catching errors, ie when you need to display errors to users based on an operation. If you go adding these blocks everywhere then a memory intensive op might be executed overloading your system, only for the whole function to be cancelled since some later block of code did not pass
@hnd4r79 ай бұрын
Thank you for sharing this duck type philosophy. Ask forgiveness, Not permission. 1. avoid multiple acess 2. avoid double check race condition.
@akashpatel55056 жыл бұрын
I have to agree with other commentators. You are awesome at explaining python concepts!
@Ninja-iq2xt7 жыл бұрын
Thanks for explaining such concepts Corey, You should better know that their isn't anyone who is teaching as good as you. Your channel could just take off once it gets visibility on youtube. Loved your channel!
@meosh9304 жыл бұрын
6:42 The reason we got all the attributes checked is because the "bark" attribute is located at the last line in try. What's a good way to ensure everything in try block runs and gets checked, in real life where we don't know which one's missing? For example, if we had the below order inside try block, thing.quack() thing.bark() thing.fly() .. Correct me if I'm wrong, but I feel it stops after not finding bark(and therefore moves into exception block) without checking fly?
@anelm.51273 жыл бұрын
There is no way to catch all errors because as soon as one line raises an error the remaining will be ignored. Typically, the code you execute is consecutive in priority (e.g connect_to_database(), read_data(), write_data(), disconnect()), so if the first thing throws an error the rest does not really matter because it depends on the "things that should happen before". If your commands are not somehow coupled (e.g clean_storage(), update_date(), send_email(), connect_to_database()), then you could use individual try: except: for each function call.
@meosh9303 жыл бұрын
@@anelm.5127 gotcha. Thanks!
@mcan5434 жыл бұрын
#KeyTakeAways 7:00 and 10:42 Asking forgiveness, not permission > more proactive and pythonic way
@simonolofsson74885 жыл бұрын
Thank you for this video, Corey. I've been coding Python for almost two years and just realized I've been duck typing without knowing it. I still recognize the anti-patterns from my development in C. Putting names on these patterns made it super clear.
@marcello42583 жыл бұрын
good point at the end for this atomic transaction. yes this is always tricky if you are not using mutex
@samchan25358 жыл бұрын
Thanks,Schafer. It 's been a great help for me.
@AmeerulIslam3 жыл бұрын
Brilliant explanation! Best Python teacher!
@entropyz52425 жыл бұрын
I like the pythonic way. It’s more badass with no permission needed. If it messes up, it will handle it like a G.
@johnr18755 жыл бұрын
shut the fuck up. youre such a bitch!!!!
@SamOween4 жыл бұрын
@@johnr1875 who the heck are you?
@johnr18754 жыл бұрын
@BT you are absolutely right for calling me out. one thing that you dont know is that I actually know entropy z. We go to the same school. We were taking the python course on udemy together over the summer to keep sharp over break. haha but you are right for calling me out
@johnr18754 жыл бұрын
@@SamOween im actually good friends with entropy z. we're both engineering students. im a huge fan of python. i was just trolling on his ass. youre right for calling me out lol
@entropyz52424 жыл бұрын
@john r wtf, I don't know who the hell you are.
@JuniorBloxHD4 жыл бұрын
At 4:52, you have code that checks two conditions with a nested if statement. Couldn't you use and instead?
@benurm23903 жыл бұрын
Yes.
@oliaquino40492 жыл бұрын
I finally understood this topic after watching it the 2nd time. and I realized.. this is how I code! as a beginner , I always ask for permission lol. I always thought that it was kinda wrong because its a cluttered way of coding but I also thought that as long as I'm getting the results I want , It's ok. I should probably simplify my code more haha.
@easydatascience2508 Жыл бұрын
You can watch mine too. Python and R playlists, and you can find links to source files in video description.
@codecobber11077 жыл бұрын
Superb as usual, Thanks again Corey
@patrickmullan83567 жыл бұрын
The only problem I see here, is that I have to know all Error-Types, now. Meaning, which error (or its corresponding literal) do I have to catch in the exception part. Is there a easy way to solve this? Or a concise look-up table, somewhere
@intrepidsouls6 жыл бұрын
I usually throw errors manually, i.e. commit errors deliberately so that the compiler complains and throws an exception with its name.
@alopexcheung25256 жыл бұрын
Maybe you can look for this www.tutorialspoint.com/python/python_exceptions.htm .
@TrumanBurbonk5 жыл бұрын
I wanted to ask this question myself. We'll see what is going to be easier - to commit errors deliberately or to recognize them from the list.
@mirham38025 жыл бұрын
I think it's somehow obvious which exception to look after as long as you know your data type you're dealing with. I mean if you're using collections, try to pay attention to index and keys errors and so on
@MrRyanroberson13 жыл бұрын
try / except Exception as e; the 'Exception' covers every exception besides the user attempting to halt the program, and is a superclass of all other exceptions (again besides a 'halt the program' exception)
@alecdelu833 жыл бұрын
When Corey says "Now you may be wondering..." I'm like hold your horses, I may be understanding just yet.
@Darth_Pro_x4 жыл бұрын
Using try except is faster than if when no exceptions is raised, and slower when an exception is raised. So a good rule of thumb is to use try when you expect it to work most of the time, and if when you expect it to not work most of the time
@cryptoTeacherAcademey6 жыл бұрын
The video tutorials is the best and I really appreciate the fact that your are a good teacher and you make complex things easy to understand. Thanks very much!!!!
@sergeyb.35024 жыл бұрын
From now on I'm going to go pythonic with my wife. EAFP.
@bellamvishnuvardhanreddy58284 жыл бұрын
make sure to add finally block
@milindyadav77034 жыл бұрын
Nah dude u r missing the point ...in python it is to make things faster....while that may not be the case with ur wife :p
@angelcaru3 жыл бұрын
@@milindyadav7703 r/woooosh
@MichaelLeo3 жыл бұрын
don't forget about the "duck" type after you try that!!
@heshankumarasinghe31594 жыл бұрын
Thank you.... Learnt new stuff.... Gonna watch this vid again....
@jonathan34883 жыл бұрын
Great presentation about EAFP. I personally rather use type hinting with the typing module, to make it less error prone
@cjromb4 жыл бұрын
Race Condition example: I admit, I didn't look at ALL the comments to see if this was discussed, and I'm definitely NOT arguing about if statements vs. try...I'm coming from a background where race conditions are a BIG deal that ran the entire design of the system...and I'm also just switching over to Python from another language. Anyway...In the race condition example...you mention that the small amount of time between the IF and and the OPEN/READ in the Non-Pythonic way could mean that the file that LOOKED like it was available is suddenly NOT available. So I'm thinking about this...I can immediately think of several scenarios where if you just immediately read the file, like in your Pythonic example....but then that same file disappeared in that same micro amount of time....it might be a problem that you've already read (and may be processing) a file that just disappeared or got locked/inaccessible for one reason or another. What happens when it goes to read, and the file has been locked? I'm going to see if I can reproduce that as a test. In general, I'm curious about what to do to avoid that kind of situation, but still code in a pythonic manner. My whole life is about EAFP....so definitely can appreciate code like that. LOL Also, I have sooo many of your videos in my queue! They're fantastic!
@HugoDoucet9 жыл бұрын
Thank you for sharing this philosophy. This has been a great help for me.
@ExplorerDheeraj92714 жыл бұрын
Thank you so much.....loving your teaching...😍😍
@Petemackenshaw2 жыл бұрын
In the quack() fly() bark() example, the code worked as expected since it was the last method ('bark') that was missing in each case. But we can't be sure of that. What if 'bark' was the first method call in the sequence or quack was the missing method from the class. In that case none of the methods would get invoked but ideally we would still want the two existing methods on the class to be invoked. Is there a better way of tackling this issue other than adding the try/except to each method call individually? Thanks in advance!
@thomasslone19642 жыл бұрын
i just remembered, this is why ive given up writing python code like 6 times before i could really learn it, bro its rediculous how many ways i can say the same expressions in ruby
@randomguy757 жыл бұрын
bloody fucking perfect is every fucking video on this channel. thanks mate.
@vsabinat4 жыл бұрын
Excellent explanation
@briskwalk1100 Жыл бұрын
really useful thing, I didn't know that, thank you!
@MarekSuchomel2 жыл бұрын
I have a problem with EAFP. Just looking at the code I cannot see if it will work correct or not, if the catched exception really covers potential error resulting from the previous code.
@muntadher80873 жыл бұрын
Thank you so much! this really helped me, thank you so much
@johnny_silverhand7 жыл бұрын
Nice and clear explanation
@rafaelbraschi4 жыл бұрын
Very good... But why using the 'else' on this last try/except? Its not be a better aproach to leave all the code on the 'try'?
@rambo50042 жыл бұрын
Can you please make a video on the typing module? Specifically, im pretty lost when it comes to generics
@rickliles24603 жыл бұрын
Just getting started wyth python -- Wondering -- could ya parse the thing.__dict__ for the available attributes and create a set based on a filter... then match the set to a dictionary of thingies to determine how to use the object? Kinda like a regex for objects regex for text is one dimensional ... object oriented regex can have N dimensions
@catatonico1239 жыл бұрын
Another great explanation, thanks
@amortalbeing2 жыл бұрын
@14:40, didnt know we can treat except as an if, and if that ends up false, we can use an else after it!!!
@Lahiru_Udana5 жыл бұрын
Thanks for this great video
@bartuslongus2 жыл бұрын
Perfect. Thank you.
@xaco564 жыл бұрын
Another way to think of it is that the library will be doing those checks anyway. If you put in checks of your own, you are duplicating the library code, and the checks will be done twice.
@rakeshkumar-jk4lt5 жыл бұрын
Duck flew over my head, highly technical.
@turboromy7 жыл бұрын
Got a dumb question. At about 2:00, is there a term to call "quack_and_fly(p)' as opposed to what I expected 'p.quack_and_fly()' ? I'm wondering if it's a new concept or something I missed.
@coreyms7 жыл бұрын
In that example, we are actually passing each object into a function that runs the quack and fly methods on each object, but the quack_and_fly function itself is NOT a method of either object, therefore we don't run it as a method. It is a separate function that takes an object as an argument. I hope that helps.
@sukurcf5 жыл бұрын
Dude. How did you comment two lines at once? at 7:37
@pisceangs39485 жыл бұрын
select all lines that you want to comment and then press Ctrl+/
@sukurcf5 жыл бұрын
@@pisceangs3948 I mean those were different lines at different places. Not in sequence.
@phamvantho49814 жыл бұрын
@@sukurcf in PyCharm it can be done by holding the Alt key
@glenbenton21754 жыл бұрын
Isn't the statement "with f:" on 14:22 unnecessary here?(no-race condition)
@satoshinakamoto1714 жыл бұрын
this is really helpful. thanks .
@veyselaksin2 жыл бұрын
Thank you so much for this tutorial. I have question that Can I use BaseException for all exception type? Does it make sense?
@xschen40455 жыл бұрын
I guess I'm gonna be Pythonic from now on.
@meunomejaestavaemuso7 жыл бұрын
Nice video But I would like to point a small mistake. When you say that you are throwing some error, what you actually mean is catching it. Since you are using the `except SomeError`. Throwing the error would use the `raise SomeError`. When you except the error you are asking forgiveness, but when you throw the error you are not. a = 'a' b = 1 try: print(a + b) except TypeError: print('Forgive-me for trying to add an string to an int') if isinstance(a, str) and isinstance(b, int): raise TypeError('ERROR! You can\'t add string to ints!') else: print(a + b) ########################################## Forgive-me for trying to add a string to a int Traceback (most recent call last): File "", line 10, in raise TypeError('ERROR! You can\'t add string to ints!') TypeError: ERROR! You can't add string to ints!
@peterye16663 жыл бұрын
I think Corey means that you are allowing Python to throw an error. For example, if I have code like this: nums=[1,2,3] print(nums[10]) then I am allowing Python to throw an IndexError. At 14:02, Corey says, "we can't access the file anymore so then when we try to open it then we're going to THROW an error and we're likely not going to CATCH that error because we thought that we could access the file" So when Corey says "we're going to throw an error" he actually means "Python is going to throw an error." I agree that he could have worded this more clearly.
@finalsecretofchrono13393 жыл бұрын
So with this specific race condition example, the opening of the file natively prevents the deletion of the file by another function/user?
@MrBrainOwl7 жыл бұрын
Thank you so much for the explanation!!!
@akiratoriyama13204 жыл бұрын
Thank you!!
@ahmedesmaeil61947 жыл бұрын
what is the relation between duck typing and ABC "Abstract Base Classes" ?
@ligrt24264 жыл бұрын
hello Corey , i really learned a lot from ur videos , thnx so much. but my question on this video is that the 1st eg of class person and class duck , is it related or same as polymorphism in python? Thank you
@SeaDadLife7 жыл бұрын
Great video! Thanks for sharing your wisdom. I get the advantages of EAFP. However, an object may have quack() and fly() methods yet not fulfill the contract of a Duck object. In large applications would sufficient code in the try-catch block really be more efficient than just using isinstance?
@royalpranay7 жыл бұрын
Thanks for the tutorials. I also have a small question regarding EAFP, What if I don't want my program to stop execution? Shouldn't it be better to "Ask Permission" and if not allowed, the program should continue further execution.
@coreyms7 жыл бұрын
In Python, catching an exception doesn't mean you need to exit the program. You can do whatever you like... log the error, add an entry to a database, or just ignore it completely with a 'pass' statement. It's up to you.
@hanjiali14 жыл бұрын
Well, the file needs to be closed at the end of the video to prevent error, although it went exception.
@SeekHeart9 жыл бұрын
another example of pointing out something not pythonic is not using a list comprehension when it's appropriate.
@coreyms9 жыл бұрын
+SeekHeart Great point. I'll continue creating videos on being Pythonic and show some more common examples.
@VISHALROHRA_7 жыл бұрын
Eagerly waiting
@panagiotisdeligiannis96105 жыл бұрын
Great video, thank you. Unfortunately I was 3 years late and now I 'll just schedule to change my code. :D One question: There are times that instead of just calling two methods, we have to make a big job and the method calls are seperated by some processing time (method0() ----- TIME CONSUMING JOB --- method1() ). Is that a case that we could check if the methods exist prior, so that we can avoid losing time if the methods do not exist?
@shrikantdangi60648 жыл бұрын
nicely explained
@salrite6 жыл бұрын
Can anyone please explain how are quack and fly attributes, they are methods (functions) right ?
@tshaylatte95024 жыл бұрын
thank you once again
@sudipta_samanta7 жыл бұрын
Can you please explain this line: print("I'm {name}. I'm {age} years old and I am a {job}".format(**person)) how unpacking of dictionary values works ?
@coreyms7 жыл бұрын
Basically, when you unpack a dictionary, you can imagine it passing in all the keys and values as key/value pairs to the format method. So for example, when you unpack, in the background you can think of it doing something like: print("I'm {name}. I'm {age} years old".format(name='Corey', age=30))
@sudipta_samanta7 жыл бұрын
Corey Schafer Thank you for explanation. Can we use this unpacking in other cases like list or tuple ?
@ptf420696 жыл бұрын
Is "assert" considered one of LBYL?
@cahangirove7 жыл бұрын
Great video! But I have a question. What about performance? Is try.. except.. method is faster than if.. else.. statements or vice versa?
@g_th1n7 жыл бұрын
I think you can have a look at this, stackoverflow.com/questions/1835756/using-try-vs-if-in-python
@ZzZ-km2bh4 жыл бұрын
Can please anybody tell me, what is the keyboard combination to comment/uncomment a block of code? It really kills me. thanks!!
@jvsnyc3 жыл бұрын
Highlight Ctrl-/ is the most common, but varies by editor/IDE.
@ZzZ-km2bh3 жыл бұрын
@@jvsnyc Thanks, its a huge help :)
@jvsnyc3 жыл бұрын
@@ZzZ-km2bh please do good in the world with the millions of hours u eventually save!
@mohittheanand7 жыл бұрын
great video. just one question. is my_dict.get('some_attribute') following EAFP
@coreyms7 жыл бұрын
Sure... if you were to explicitly check if the attribute existed before trying to get it then it would not. It also allows you to return a None or default value if the key doesn't exist, and that is perfectly fine and useful as well.
@mohittheanand7 жыл бұрын
thanks
@TheSpacecraftX6 жыл бұрын
Yeah I'm not convinced. I'd much rather get an early warning that it's the wrong type than figuring out why a type conversion error happened at runtime several functions deep, using a library I'm not very familiar with. it makes more sense to me to have it checked for you rather than explicitly writing all the checking yourself when a compiler can do it for you. Try catch statements are a thing in static languages so why go to the extra trouble it causes to forego type checking entirely. Is it pythonic to use try catch in Java or C++ or C#?
@adamwisniewski93867 жыл бұрын
But what if I need to call these three methods, and calling only one or two of them will mess things up? In that case I would have to check if they all exist before running them, would that still be unpythonic or is there pythonic way to deal with such circumstance?
@JJ_eats_wings4 жыл бұрын
pure awesome!
@TinkCSA7 жыл бұрын
great video! could you zoom in a bit next time? Having only 30 lines in view will be great.
@DsiakMondala7 жыл бұрын
Ouch, I'm having a very hard time with this duck... My code is not optimized to this style at all, I feel like I must learn a new way to define classes and functions before this trumps over classic coding. The worst is not knowing what the functions wants and not knowing what it will return to me. Going back to read the class is proving to be very time consuming.
@MatiasEzelQ8 жыл бұрын
Could you do a video explaining how to use python base api? PD: Great videos!
@markb61936 жыл бұрын
Only thing that annoys me about try/catch, is that people use it far too lazily, when they should be using an if.
@michaelholding54695 жыл бұрын
I suppose the obvious pitfall with this approach is that you might unexpectedly find that due to a minor error you have just overwritten a file that contains valuable data?
@ivandrofly7 жыл бұрын
thank you
@hasifkhan81976 жыл бұрын
I'm unable to understand anything in this particular video, In the whole series till now. Maybe it's my first attempt of learning the OOps Concepts.
@awengirr9 күн бұрын
The HUGE problem with this method is that you should know in advance what type of error you are expecting to arise. And that is a huge drawback because in most cases you don't know.
@shahriarzaman47158 ай бұрын
Life's easy with static type system. Use traits/interfaces
@rajeshraut29555 жыл бұрын
Please increase your font size
@goodboy94134 жыл бұрын
Hey duck! Please fly while quacking!
@bulldawg44985 жыл бұрын
In the Java OOP world, polymorphism and interfaces take the place of "duck typing" ...
@8w4946 жыл бұрын
To me this seems very dangerous. I prefer static typing for this reason.
@IsaacC206 жыл бұрын
The mnemonic, EAFP, is non intuitive imo. Long story short: Prefer try/catch/else blocks to checks (type checks, value checks) to handle invalid inputs to functions.
@malharjajoo73937 жыл бұрын
The explanation was good but felt the motivation wasnt clear , like why we would like to take this approach
@SirThane137 жыл бұрын
When the concepts of Corey's examples are expanded out to the scale of full projects, EAFP results in less file and object process time and produces more clear and readable code.