Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Are ABCs an anti-pattern?

Reply
Thread Tools

Are ABCs an anti-pattern?

 
 
Demian Brecht
Guest
Posts: n/a
 
      10-02-2012
I don't use them anymore, but I'm curious about others opinions on this
list...

The more time I spend in Python, discovering what "Pythonic" code is and
such, it seems that I throw away much in terms of academic learnings as
far as "OOP correctness" goes. In doing so, I find that, in general,
overall LOC (yes, I'm aware that this is a poor metric to judge anything
on), readability and overall quality of code seems to go up. Yes, you
give the user much more rope to hang themselves with making the general
assumption that the user knows what they're doing, but we're all
consenting adults here after all, right?

As an example, I initially had an OAuth 2.0 client library that was
roughly 450 LOC (using ABCs, adapter patterns for the various flows,
etc). Dropping this for a more "Pythonic" (at least, what my
interpretation of Pythonic code is) brought the entire library down to
55 LOC. Having said that, the decline in LOC and overall grok-ability
wasn't entirely due to moving away from ABCs and dropping the use of
adapters, but it did have quite a bit to do with it).

As such, I see ABCs as somewhat of an anti-pattern in the Python world.
The concept is obviously essential in non-duck-typed language using
strict OOP, but does it *really* belong in Python?

--
Demian Brecht
@demianbrecht
http://demianbrecht.github.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interfaces and ABCs Paulo Matos C++ 4 12-03-2006 03:41 PM
Opaque pointers, templates and ABCs =?iso-8859-1?q?Ernesto_Basc=F3n?= C++ 3 10-25-2006 08:53 PM
Interfaces without ABCs? Mark P C++ 6 09-13-2005 08:16 AM
Polymorphism, iterators and ABCs? Steven T. Hatton C++ 5 09-02-2005 12:42 AM
name conventions for pure ABCs gelbeiche C++ 1 04-28-2005 03:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57