Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104822

Re: Simple exercise

Newsgroups comp.lang.python
Date 2016-03-14 08:22 -0700
References <mailman.117.1457600573.15725.python-list@python.org> <nbt1vd$k00$1@dont-email.me> <mailman.163.1457659326.15725.python-list@python.org> <99e0c48c-862b-479e-9b86-3282b16ed56d@googlegroups.com> <iLzFy.1577124$Dn6.217816@fx46.am4>
Message-ID <9d987940-5635-4b43-912a-df4696cc2ca3@googlegroups.com> (permalink)
Subject Re: Simple exercise
From Rick Johnson <rantingrickjohnson@gmail.com>

Show all headers | View raw


On Monday, March 14, 2016 at 9:19:04 AM UTC-5, alister wrote:
> A code smell does not necessarily mean the code is wrong,
> just that it warrants investigation as there is a strong
> possibility it may be sub- optimal

Yes, technically speaking, you're correct. 

But the concept of "code smell" has become something of a
scarlet letter within the programming community. Once you
apply it to someone's code, the stigma becomes very
difficult to rub off -- and not just the "external" stigma
you feel radiating from scornful stares of your peers, but
the "self-imposed" stigma as well. It has become a
derogatory term, and sadly, one that is thrown around much
too carelessly.

Sure, there are legitimate instances where the term should
be applied, but in the case of "zip vs explicit sequence
indexing", the usage of this term could influence a "less
experienced Python programmer", to adopt a very dangerous
habit *SIMPLY* because he does not want to be labeled a "bad
programmer". But the irony is, he may produce worse code by
blindly reaching for his "sequence zipper"!

The zip function is not something you should get in the
habit of using without first considering the consequences of
*EACH SPECIFIC USE-CASE*. Yes, it can be helpful at times,
and yes, it can make code easier to read. But it can also
create subtle bugs. Personally, i choose to avoid it, but
others should make the decision for themselves.

In a nutshell, the zip function is both "elegantly powerful"
and "cunningly destructive". So buyer beware. Because,
Python.org ain't no Walmart folks, and they sure as hell
don't give refunds for sequence members that evaporated into
the ether, after you adopted the bad habit of using zip,
simply because -> "Mark said so"!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Simple exercise Rodrick Brown <rodrick.brown@gmail.com> - 2016-03-10 04:02 -0500
  Re: Simple exercise Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-10 11:30 +0100
    Re: Simple exercise Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-10 12:07 +0100
    Re: Simple exercise Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-10 17:05 +0100
      Re: Simple exercise Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-10 17:08 +0100
  Re: Simple exercise Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-03-11 12:24 +1300
    Re: Simple exercise Chris Angelico <rosuav@gmail.com> - 2016-03-11 10:38 +1100
  Re: Simple exercise BartC <bc@freeuk.com> - 2016-03-11 00:05 +0000
    Re: Simple exercise Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-11 01:21 +0000
      Re: Simple exercise BartC <bc@freeuk.com> - 2016-03-11 01:45 +0000
        Re: Simple exercise Larry Martell <larry.martell@gmail.com> - 2016-03-10 20:53 -0500
        Re: Simple exercise "Martin A. Brown" <martin@linux-ip.net> - 2016-03-10 17:56 -0800
        Re: Simple exercise Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-11 02:03 +0000
          Re: Simple exercise BartC <bc@freeuk.com> - 2016-03-11 02:18 +0000
          Re: Simple exercise Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 07:35 -0700
            Re: Simple exercise Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2016-03-14 15:06 +0000
              Re: Simple exercise Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 09:00 -0700
              Re: Simple exercise Steven D'Aprano <steve@pearwood.info> - 2016-03-15 10:59 +1100
                Re: Simple exercise Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-15 07:26 +0200
                Re: Simple exercise Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-15 19:39 +1100
                Re: Simple exercise Chris Angelico <rosuav@gmail.com> - 2016-03-15 19:53 +1100
                Re: Simple exercise Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-15 11:04 +0200
                Re: Simple exercise Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2016-03-15 11:09 +0000
            Re: Simple exercise Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-14 09:16 -0600
              Re: Simple exercise Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 09:11 -0700
            Re: Simple exercise Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-14 15:23 +0000
            Re: Simple exercise Peter Otten <__peter__@web.de> - 2016-03-14 17:00 +0100
        Re: Simple exercise Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-11 02:05 +0000
      Re: Simple exercise Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 07:07 -0700
        Re: Simple exercise Larry Martell <larry.martell@gmail.com> - 2016-03-14 10:13 -0400
        Re: Simple exercise alister <alister.ware@ntlworld.com> - 2016-03-14 14:18 +0000
          Re: Simple exercise Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 08:22 -0700
            Re: Simple exercise MRAB <python@mrabarnett.plus.com> - 2016-03-14 15:57 +0000
    Re: Simple exercise Chris Kaynor <ckaynor@zindagigames.com> - 2016-03-10 18:14 -0800
  Re: Simple exercise boffi <boffi@casa.sua> - 2016-03-17 22:28 +0100

csiph-web