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


Groups > comp.lang.python > #52344 > unrolled thread

Re: Am I not seeing the Error?

Started byChris Angelico <rosuav@gmail.com>
First post2013-08-11 03:33 +0100
Last post2013-08-11 09:27 -0400
Articles 20 on this page of 25 — 13 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-11 03:33 +0100
    Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-10 22:43 -0400
      Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-11 03:47 +0100
      Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 08:33 -0400
      Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 08:20 -0500
      Re: Am I not seeing the Error? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-12 10:01 -0400
      Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 10:04 -0400
        Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-12 11:47 -0400
          Re: Am I not seeing the Error? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 12:56 -0400
          Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-12 18:19 +0100
          Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 16:16 -0400
          Re: Am I not seeing the Error? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 16:34 -0400
          Re: Am I not seeing the Error? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-12 16:35 -0400
          Re: Am I not seeing the Error? Joshua Landau <joshua@landau.ws> - 2013-08-13 09:19 +0100
            Re: Am I not seeing the Error? Steven D'Aprano <steve@pearwood.info> - 2013-08-13 08:50 +0000
              Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-13 06:31 -0400
              Re: Am I not seeing the Error? Robert Kern <robert.kern@gmail.com> - 2013-08-13 13:11 +0100
              Re: Am I not seeing the Error? Terry Reedy <tjreedy@udel.edu> - 2013-08-13 12:12 -0400
              Re: Am I not seeing the Error? Michael Torrie <torriem@gmail.com> - 2013-08-13 19:55 -0600
            Re: Am I not seeing the Error? Grant Edwards <invalid@invalid.invalid> - 2013-08-13 13:55 +0000
      Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 10:37 -0500
      Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 10:47 -0500
    Re: Am I not seeing the Error? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-11 08:28 +0000
      Re: Am I not seeing the Error? Joshua Landau <joshua@landau.ws> - 2013-08-11 11:18 +0100
      Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-11 09:27 -0400

Page 1 of 2  [1] 2  Next page →


#52344 — Re: Am I not seeing the Error?

FromChris Angelico <rosuav@gmail.com>
Date2013-08-11 03:33 +0100
SubjectRe: Am I not seeing the Error?
Message-ID<mailman.452.1376188442.1251.python-list@python.org>
On Sun, Aug 11, 2013 at 3:19 AM, Devyn Collier Johnson
<devyncjohnson@gmail.com> wrote:
> am checking my 1292-line script for syntax errors. I ran the following
> commands in a terminal to check for errors, but I do not see the error.
>
> collier@Nacho-Laptop:/media/collier/AI/Pysh$ python3 -m py_compile
> ./beta_engine
>   File "./beta_engine", line 344
>     JOB_WRITEURGFILES =
> multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID);
> write2file(SENTEMPPATH, ''); write2file(INPUTMEM, ''));
> JOB_WRITEURGFILES.start()
> ^
> SyntaxError: invalid syntax


When you get a syntax error you can't understand, look at the previous
line of code. Perhaps something there is incomplete; maybe you have
mismatched parentheses, so this line is considered to be part of the
same expression.

Next thing to do is split it into more lines. Why is all that in a single line?

ChrisA

[toc] | [next] | [standalone]


#52345

FromRoy Smith <roy@panix.com>
Date2013-08-10 22:43 -0400
Message-ID<roy-4A9C13.22431010082013@news.panix.com>
In reply to#52344
In article <mailman.452.1376188442.1251.python-list@python.org>,
 Chris Angelico <rosuav@gmail.com> wrote:

> When you get a syntax error you can't understand, look at the previous
> line of code. Perhaps something there is incomplete; maybe you have
> mismatched parentheses, so this line is considered to be part of the
> same expression.
> 
> Next thing to do is split it into more lines. Why is all that in a single 
> line?

Also, try reformatting the code in a tool like emacs or eclipse which 
does syntax coloring and auto indenting.  Often, if you're missing some 
piece of punctuation, it will become obvious when your tool tries to 
indent things in some unexpected way.  Or suddenly starts coloring all 
of your program text as if it were a string literal :-)

[toc] | [prev] | [next] | [standalone]


#52346

FromChris Angelico <rosuav@gmail.com>
Date2013-08-11 03:47 +0100
Message-ID<mailman.453.1376189281.1251.python-list@python.org>
In reply to#52345
On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.452.1376188442.1251.python-list@python.org>,
>  Chris Angelico <rosuav@gmail.com> wrote:
>
>> When you get a syntax error you can't understand, look at the previous
>> line of code. Perhaps something there is incomplete; maybe you have
>> mismatched parentheses, so this line is considered to be part of the
>> same expression.
>>
>> Next thing to do is split it into more lines. Why is all that in a single
>> line?
>
> Also, try reformatting the code in a tool like emacs or eclipse which
> does syntax coloring and auto indenting.  Often, if you're missing some
> piece of punctuation, it will become obvious when your tool tries to
> indent things in some unexpected way.  Or suddenly starts coloring all
> of your program text as if it were a string literal :-)

Agreed. Though I've had some odd issues with SciTE in that way; I
think its Python handling may have bugs in it here and there. But 95%
of the time it's helpful.

ChrisA

[toc] | [prev] | [next] | [standalone]


#52413

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-08-12 08:33 -0400
Message-ID<mailman.496.1376310836.1251.python-list@python.org>
In reply to#52345
On 08/10/2013 10:47 PM, Chris Angelico wrote:
> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
>> In article <mailman.452.1376188442.1251.python-list@python.org>,
>>   Chris Angelico <rosuav@gmail.com> wrote:
>>
>>> When you get a syntax error you can't understand, look at the previous
>>> line of code. Perhaps something there is incomplete; maybe you have
>>> mismatched parentheses, so this line is considered to be part of the
>>> same expression.
>>>
>>> Next thing to do is split it into more lines. Why is all that in a single
>>> line?
>> Also, try reformatting the code in a tool like emacs or eclipse which
>> does syntax coloring and auto indenting.  Often, if you're missing some
>> piece of punctuation, it will become obvious when your tool tries to
>> indent things in some unexpected way.  Or suddenly starts coloring all
>> of your program text as if it were a string literal :-)
> Agreed. Though I've had some odd issues with SciTE in that way; I
> think its Python handling may have bugs in it here and there. But 95%
> of the time it's helpful.
>
> ChrisA

Thanks everyone. Unfortunately, I have not found the problem yet. I use 
the Geany IDE which has syntax highlighting, but nothing wrong is seen. 
None of the suggestions helped. The lines before this one set variables. 
The lines further up "appear" fine. I will keep looking. If I ever 
figure it out, I will share with all of you.

As for the code being one line, my style of coding is very different 
from others. I try to keep similar or related tasks on one line. 
Programming like that is called trolling. A programmer that uses 
trolling is called a troll. A troll can also refer to such a line of 
code itself. My scripts contain a lot of trolls. It is easier for me to 
read trolls than "typical" coding styles. (Yes, I am a weird troll (^u^))

Mahalo,

DevynCJohnson@Gmail.com

[toc] | [prev] | [next] | [standalone]


#52414

FromZachary Ware <zachary.ware+pylist@gmail.com>
Date2013-08-12 08:20 -0500
Message-ID<mailman.497.1376313643.1251.python-list@python.org>
In reply to#52345
On Mon, Aug 12, 2013 at 7:33 AM, Devyn Collier Johnson
<devyncjohnson@gmail.com> wrote:
>
> On 08/10/2013 10:47 PM, Chris Angelico wrote:
>>
>> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
>>>
>>> In article <mailman.452.1376188442.1251.python-list@python.org>,
>>>   Chris Angelico <rosuav@gmail.com> wrote:
>>>
>>>> When you get a syntax error you can't understand, look at the previous
>>>> line of code. Perhaps something there is incomplete; maybe you have
>>>> mismatched parentheses, so this line is considered to be part of the
>>>> same expression.
>>>>
>>>> Next thing to do is split it into more lines. Why is all that in a
>>>> single
>>>> line?
>>>
>>> Also, try reformatting the code in a tool like emacs or eclipse which
>>> does syntax coloring and auto indenting.  Often, if you're missing some
>>> piece of punctuation, it will become obvious when your tool tries to
>>> indent things in some unexpected way.  Or suddenly starts coloring all
>>> of your program text as if it were a string literal :-)
>>
>> Agreed. Though I've had some odd issues with SciTE in that way; I
>> think its Python handling may have bugs in it here and there. But 95%
>> of the time it's helpful.
>>
>> ChrisA
>
>
> Thanks everyone. Unfortunately, I have not found the problem yet. I use the
> Geany IDE which has syntax highlighting, but nothing wrong is seen. None of
> the suggestions helped. The lines before this one set variables. The lines
> further up "appear" fine. I will keep looking. If I ever figure it out, I
> will share with all of you.
>
> As for the code being one line, my style of coding is very different from
> others. I try to keep similar or related tasks on one line. Programming like
> that is called trolling. A programmer that uses trolling is called a troll.
> A troll can also refer to such a line of code itself. My scripts contain a
> lot of trolls. It is easier for me to read trolls than "typical" coding
> styles.

Obviously not, since you can't find the syntax error.  If you replace
each semicolon in that line with a newline, the syntax error will be
immediately obvious.  I'll even give you a hint: it's on the third
line.

-- 
Zach

[toc] | [prev] | [next] | [standalone]


#52415

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-08-12 10:01 -0400
Message-ID<mailman.499.1376316118.1251.python-list@python.org>
In reply to#52345
On 8/12/13 8:33 AM, Devyn Collier Johnson wrote:
>
> On 08/10/2013 10:47 PM, Chris Angelico wrote:
>> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
>>> In article <mailman.452.1376188442.1251.python-list@python.org>,
>>>   Chris Angelico <rosuav@gmail.com> wrote:
>>>
>>>> When you get a syntax error you can't understand, look at the previous
>>>> line of code. Perhaps something there is incomplete; maybe you have
>>>> mismatched parentheses, so this line is considered to be part of the
>>>> same expression.
>>>>
>>>> Next thing to do is split it into more lines. Why is all that in a 
>>>> single
>>>> line?
>>> Also, try reformatting the code in a tool like emacs or eclipse which
>>> does syntax coloring and auto indenting.  Often, if you're missing some
>>> piece of punctuation, it will become obvious when your tool tries to
>>> indent things in some unexpected way.  Or suddenly starts coloring all
>>> of your program text as if it were a string literal :-)
>> Agreed. Though I've had some odd issues with SciTE in that way; I
>> think its Python handling may have bugs in it here and there. But 95%
>> of the time it's helpful.
>>
>> ChrisA
>
> Thanks everyone. Unfortunately, I have not found the problem yet. I 
> use the Geany IDE which has syntax highlighting, but nothing wrong is 
> seen. None of the suggestions helped. The lines before this one set 
> variables. The lines further up "appear" fine. I will keep looking. If 
> I ever figure it out, I will share with all of you.
>
As Terry Reedy pointed out, you have semicolons separating arguments in 
a function call.  This is your line of code:

JOB_WRITEURGFILES = 
multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID); 
write2file(SENTEMPPATH, ''); write2file(INPUTMEM, '')); 
JOB_WRITEURGFILES.start()

Replacing names with shorter ones to see the structure, it's like this:

J = m.P( w('', E); w(S, ''); w(I, '') ); J.s()

You have three semicolons in that line.  Two are inside a call, though 
I'm not sure that's what you intended.  One is separating statements.  
You might be a little too attached to your "more readable" style.  
Putting things on different lines really does help you see what is going on.

--Ned.

[toc] | [prev] | [next] | [standalone]


#52416

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-08-12 10:04 -0400
Message-ID<mailman.500.1376316293.1251.python-list@python.org>
In reply to#52345
On 08/12/2013 09:20 AM, Zachary Ware wrote:
> On Mon, Aug 12, 2013 at 7:33 AM, Devyn Collier Johnson
> <devyncjohnson@gmail.com> wrote:
>> On 08/10/2013 10:47 PM, Chris Angelico wrote:
>>> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
>>>> In article <mailman.452.1376188442.1251.python-list@python.org>,
>>>>    Chris Angelico <rosuav@gmail.com> wrote:
>>>>
>>>>> When you get a syntax error you can't understand, look at the previous
>>>>> line of code. Perhaps something there is incomplete; maybe you have
>>>>> mismatched parentheses, so this line is considered to be part of the
>>>>> same expression.
>>>>>
>>>>> Next thing to do is split it into more lines. Why is all that in a
>>>>> single
>>>>> line?
>>>> Also, try reformatting the code in a tool like emacs or eclipse which
>>>> does syntax coloring and auto indenting.  Often, if you're missing some
>>>> piece of punctuation, it will become obvious when your tool tries to
>>>> indent things in some unexpected way.  Or suddenly starts coloring all
>>>> of your program text as if it were a string literal :-)
>>> Agreed. Though I've had some odd issues with SciTE in that way; I
>>> think its Python handling may have bugs in it here and there. But 95%
>>> of the time it's helpful.
>>>
>>> ChrisA
>>
>> Thanks everyone. Unfortunately, I have not found the problem yet. I use the
>> Geany IDE which has syntax highlighting, but nothing wrong is seen. None of
>> the suggestions helped. The lines before this one set variables. The lines
>> further up "appear" fine. I will keep looking. If I ever figure it out, I
>> will share with all of you.
>>
>> As for the code being one line, my style of coding is very different from
>> others. I try to keep similar or related tasks on one line. Programming like
>> that is called trolling. A programmer that uses trolling is called a troll.
>> A troll can also refer to such a line of code itself. My scripts contain a
>> lot of trolls. It is easier for me to read trolls than "typical" coding
>> styles.
> Obviously not, since you can't find the syntax error.  If you replace
> each semicolon in that line with a newline, the syntax error will be
> immediately obvious.  I'll even give you a hint: it's on the third
> line.
>
Zachary, are you, Ned, and Terry trying to say the syntax should be

job = multiprocessing.Process(func1(), func2())

not

job = multiprocessing.Process(func1(); func2())

DCJ

[toc] | [prev] | [next] | [standalone]


#52420

FromRoy Smith <roy@panix.com>
Date2013-08-12 11:47 -0400
Message-ID<roy-7AC408.11471812082013@news.panix.com>
In reply to#52416
I can't quite sort out the multiple quoting levels, but somebody said:

>>> Programming like that is called trolling. A programmer that uses 
>>> trolling is called a troll. A troll can also refer to such a line 
>>> of code itself. My scripts contain a lot of trolls. It is easier 
>>> for me to read trolls than "typical" coding styles.

Please tell me this is all just an elaborate joke.

[toc] | [prev] | [next] | [standalone]


#52422

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-08-12 12:56 -0400
Message-ID<mailman.504.1376326614.1251.python-list@python.org>
In reply to#52420
On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith <roy@panix.com> wrote:
> I can't quite sort out the multiple quoting levels, but somebody said:
>
>>>> Programming like that is called trolling. A programmer that uses
>>>> trolling is called a troll. A troll can also refer to such a line
>>>> of code itself. My scripts contain a lot of trolls. It is easier
>>>> for me to read trolls than "typical" coding styles.
>
> Please tell me this is all just an elaborate joke.

I was thinking something similar Roy.  Devyn, you may think you code
differently, but you don't.  You have a half of dozen people trying to
show you how your style causes confusion between what you think you
are writing and what you actually coded.  There is plenty of room in
coding for personal expression, but what you call 'trolling' is not
that.  If you like semicolons, use another language that needs them.
I think you think it is some version of premature optimization.  Since
you are a novice at the language, stick with the standards, and learn
to embrace them.  Ultimately standard coding styles has nothing to do
with code optimization.  It has to do with readability.  Although this
is a small example, you can see that if several people get involved
debugging it, the first thing that gets in the way is your
non-standard coding style.  If you want to code alone your whole life,
do as you like.  But the time spent reading and fixing code in the
lifetime of any useful software system is greater than the time spent
creating the original code.
> --
> http://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#52424

FromChris Angelico <rosuav@gmail.com>
Date2013-08-12 18:19 +0100
Message-ID<mailman.506.1376327978.1251.python-list@python.org>
In reply to#52420
On Mon, Aug 12, 2013 at 5:56 PM, Joel Goldstick
<joel.goldstick@gmail.com> wrote:
> If you like semicolons, use another language that needs them.
> I think you think it is some version of premature optimization.  Since
> you are a novice at the language, stick with the standards, and learn
> to embrace them.

I'm a C programmer who really likes his semicolons, and I often write
long lines. But I still was right up there early on saying "split this
line". It definitely wants to be split. And when *I* say that, it must
be pretty notably splittable. :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#52428

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-08-12 16:16 -0400
Message-ID<mailman.510.1376338570.1251.python-list@python.org>
In reply to#52420
On 08/12/2013 12:56 PM, Joel Goldstick wrote:
> On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith <roy@panix.com> wrote:
>> I can't quite sort out the multiple quoting levels, but somebody said:
>>
>>>>> Programming like that is called trolling. A programmer that uses
>>>>> trolling is called a troll. A troll can also refer to such a line
>>>>> of code itself. My scripts contain a lot of trolls. It is easier
>>>>> for me to read trolls than "typical" coding styles.
>> Please tell me this is all just an elaborate joke.
> I was thinking something similar Roy.  Devyn, you may think you code
> differently, but you don't.  You have a half of dozen people trying to
> show you how your style causes confusion between what you think you
> are writing and what you actually coded.  There is plenty of room in
> coding for personal expression, but what you call 'trolling' is not
> that.  If you like semicolons, use another language that needs them.
> I think you think it is some version of premature optimization.  Since
> you are a novice at the language, stick with the standards, and learn
> to embrace them.  Ultimately standard coding styles has nothing to do
> with code optimization.  It has to do with readability.  Although this
> is a small example, you can see that if several people get involved
> debugging it, the first thing that gets in the way is your
> non-standard coding style.  If you want to code alone your whole life,
> do as you like.  But the time spent reading and fixing code in the
> lifetime of any useful software system is greater than the time spent
> creating the original code.
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
>

I know using semicolons will not optimize the code, but it is actually 
easier for me to read. I can handle such code better than spacing it out.

DCJ

[toc] | [prev] | [next] | [standalone]


#52429

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-08-12 16:34 -0400
Message-ID<mailman.511.1376339696.1251.python-list@python.org>
In reply to#52420
On Mon, Aug 12, 2013 at 4:16 PM, Devyn Collier Johnson
<devyncjohnson@gmail.com> wrote:
>
> On 08/12/2013 12:56 PM, Joel Goldstick wrote:
>>
>> On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith <roy@panix.com> wrote:
>>>
>>> I can't quite sort out the multiple quoting levels, but somebody said:
>>>
>>>>>> Programming like that is called trolling. A programmer that uses
>>>>>> trolling is called a troll. A troll can also refer to such a line
>>>>>> of code itself. My scripts contain a lot of trolls. It is easier
>>>>>> for me to read trolls than "typical" coding styles.
>>>
>>> Please tell me this is all just an elaborate joke.
>>
>> I was thinking something similar Roy.  Devyn, you may think you code
>> differently, but you don't.  You have a half of dozen people trying to
>> show you how your style causes confusion between what you think you
>> are writing and what you actually coded.  There is plenty of room in
>> coding for personal expression, but what you call 'trolling' is not
>> that.  If you like semicolons, use another language that needs them.
>> I think you think it is some version of premature optimization.  Since
>> you are a novice at the language, stick with the standards, and learn
>> to embrace them.  Ultimately standard coding styles has nothing to do
>> with code optimization.  It has to do with readability.  Although this
>> is a small example, you can see that if several people get involved
>> debugging it, the first thing that gets in the way is your
>> non-standard coding style.  If you want to code alone your whole life,
>> do as you like.  But the time spent reading and fixing code in the
>> lifetime of any useful software system is greater than the time spent
>> creating the original code.
>>>
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>>
>
> I know using semicolons will not optimize the code, but it is actually
> easier for me to read. I can handle such code better than spacing it out.

Except it doesn't make it easier to read.


JOB_WRITEURGFILES =
multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID);
write2file(SENTEMPPATH, ''); write2file(INPUTMEM, ''));
JOB_WRITEURGFILES.start()

As I understand it the above line of code caused you problems.  I
don't know what muliprocessing.Process() is supposed to have as
arguments, but I don't think is can have arguments with semicolons,
unless they appeared in a string.

So your semicolons, that you insist make your code easier to read,
have made code that doesn't work, and you don't know why.  All I am
saying is you are stating a fact not in evidence.  You only think the
semicolons are useful because you haven't taken the time to read and
write enough python code to appreciate that they are not only not
helpful, but they serve no useful purpose.  Sure, they allow you to
put several statements on a single line.  But that isn't what you were
doing.

good luck.  I can see you are interested.  keep at it.




>
> DCJ
> --
> http://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#52430

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-08-12 16:35 -0400
Message-ID<mailman.512.1376339754.1251.python-list@python.org>
In reply to#52420
On 8/12/13 4:16 PM, Devyn Collier Johnson wrote:
>
> On 08/12/2013 12:56 PM, Joel Goldstick wrote:
>> On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith <roy@panix.com> wrote:
>>> I can't quite sort out the multiple quoting levels, but somebody said:
>>>
>>>>>> Programming like that is called trolling. A programmer that uses
>>>>>> trolling is called a troll. A troll can also refer to such a line
>>>>>> of code itself. My scripts contain a lot of trolls. It is easier
>>>>>> for me to read trolls than "typical" coding styles.
>>> Please tell me this is all just an elaborate joke.
>> I was thinking something similar Roy.  Devyn, you may think you code
>> differently, but you don't.  You have a half of dozen people trying to
>> show you how your style causes confusion between what you think you
>> are writing and what you actually coded.  There is plenty of room in
>> coding for personal expression, but what you call 'trolling' is not
>> that.  If you like semicolons, use another language that needs them.
>> I think you think it is some version of premature optimization. Since
>> you are a novice at the language, stick with the standards, and learn
>> to embrace them.  Ultimately standard coding styles has nothing to do
>> with code optimization.  It has to do with readability. Although this
>> is a small example, you can see that if several people get involved
>> debugging it, the first thing that gets in the way is your
>> non-standard coding style.  If you want to code alone your whole life,
>> do as you like.  But the time spent reading and fixing code in the
>> lifetime of any useful software system is greater than the time spent
>> creating the original code.
>>> -- 
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>
> I know using semicolons will not optimize the code, but it is actually 
> easier for me to read. I can handle such code better than spacing it out.
There's no point debating the readability of code that doesn't work.  
Get it functioning first, then let's talk about how best to format it.

--Ned.

>
> DCJ

[toc] | [prev] | [next] | [standalone]


#52444

FromJoshua Landau <joshua@landau.ws>
Date2013-08-13 09:19 +0100
Message-ID<mailman.523.1376381989.1251.python-list@python.org>
In reply to#52420
On 12 August 2013 16:47, Roy Smith <roy@panix.com> wrote:
> I can't quite sort out the multiple quoting levels, but somebody said:
>
>>>> Programming like that is called trolling. A programmer that uses
>>>> trolling is called a troll. A troll can also refer to such a line
>>>> of code itself. My scripts contain a lot of trolls. It is easier
>>>> for me to read trolls than "typical" coding styles.
>
> Please tell me this is all just an elaborate joke.

That was the OP (Devyn Collier Johnson, <devyncjohnson@gmail.com>) and I, too,
am hoping this is an elaborate joke. However, see
"http://bazaar.launchpad.net/~devyncjohnson-d/neobot/trunk/view/head:/lib/beta_engine".

I am struggling to see what the punchline is...

[toc] | [prev] | [next] | [standalone]


#52448

FromSteven D'Aprano <steve@pearwood.info>
Date2013-08-13 08:50 +0000
Message-ID<5209f360$0$29885$c3e8da3$5496439d@news.astraweb.com>
In reply to#52444
On Tue, 13 Aug 2013 09:19:07 +0100, Joshua Landau wrote:

> On 12 August 2013 16:47, Roy Smith <roy@panix.com> wrote:
>> I can't quite sort out the multiple quoting levels, but somebody said:
>>
>>>>> Programming like that is called trolling. A programmer that uses
>>>>> trolling is called a troll. A troll can also refer to such a line of
>>>>> code itself. My scripts contain a lot of trolls. It is easier for me
>>>>> to read trolls than "typical" coding styles.
>>
>> Please tell me this is all just an elaborate joke.
> 
> That was the OP (Devyn Collier Johnson, <devyncjohnson@gmail.com>) and
> I, too, am hoping this is an elaborate joke. However, see
> "http://bazaar.launchpad.net/~devyncjohnson-d/neobot/trunk/view/head:/
lib/beta_engine".
> 
> I am struggling to see what the punchline is...


If Artificial Intelligence code is hard to write, it damn well should be 
hard to read too. Otherwise, how will people know how brilliant you are?

But seriously... I don't know what language Devyn is writing in Python, 
but I've seen code like that before. Mostly code written back in the 
early to mid 1980s. I may have even written some of it myself :-)

Anyway, I don't think we should badger Devyn, we're not his dad and we're 
not the code police. All we can do is continue to demonstrate good, 
idiomatic, *working* Python code, and hopefully he will learn to write 
the same.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#52451

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-08-13 06:31 -0400
Message-ID<mailman.527.1376389873.1251.python-list@python.org>
In reply to#52448
On 08/13/2013 04:50 AM, Steven D'Aprano wrote:
> On Tue, 13 Aug 2013 09:19:07 +0100, Joshua Landau wrote:
>
>> On 12 August 2013 16:47, Roy Smith <roy@panix.com> wrote:
>>> I can't quite sort out the multiple quoting levels, but somebody said:
>>>
>>>>>> Programming like that is called trolling. A programmer that uses
>>>>>> trolling is called a troll. A troll can also refer to such a line of
>>>>>> code itself. My scripts contain a lot of trolls. It is easier for me
>>>>>> to read trolls than "typical" coding styles.
>>> Please tell me this is all just an elaborate joke.
>> That was the OP (Devyn Collier Johnson, <devyncjohnson@gmail.com>) and
>> I, too, am hoping this is an elaborate joke. However, see
>> "http://bazaar.launchpad.net/~devyncjohnson-d/neobot/trunk/view/head:/
> lib/beta_engine".
>> I am struggling to see what the punchline is...
>
> If Artificial Intelligence code is hard to write, it damn well should be
> hard to read too. Otherwise, how will people know how brilliant you are?
>
> But seriously... I don't know what language Devyn is writing in Python,
> but I've seen code like that before. Mostly code written back in the
> early to mid 1980s. I may have even written some of it myself :-)
>
> Anyway, I don't think we should badger Devyn, we're not his dad and we're
> not the code police. All we can do is continue to demonstrate good,
> idiomatic, *working* Python code, and hopefully he will learn to write
> the same.
>
>
I now see why this programming style is called trolling. It brings the 
worst out of people (^u^). Can I have the number for the coding police, 
I want to turn myself in (^u^).

For me, this style is easier to read. I have tried the "typical" style, 
but I find this one to be easier.

Good thing no one knows my address. A mob might show up at my door (^u^).

Once I have the next version of my chatbot released, I will tell you all 
so you can see it work.

Mahalo,

DevynCJohnson@Gmail.com

[toc] | [prev] | [next] | [standalone]


#52455

FromRobert Kern <robert.kern@gmail.com>
Date2013-08-13 13:11 +0100
Message-ID<mailman.533.1376395918.1251.python-list@python.org>
In reply to#52448
On 2013-08-13 11:31, Devyn Collier Johnson wrote:

> I now see why this programming style is called trolling.

This programming style is not called "trolling". It does not have a name. It's 
just your particular style. I think you misinterpreted someone who accused you 
of deliberately coding in this style to troll.

   http://en.wikipedia.org/wiki/Troll_(Internet)

> For me, this style is easier to read. I have tried the "typical" style, but I
> find this one to be easier.

Consider the topic of this thread as evidence against that proposition.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

[toc] | [prev] | [next] | [standalone]


#52465

FromTerry Reedy <tjreedy@udel.edu>
Date2013-08-13 12:12 -0400
Message-ID<mailman.541.1376410343.1251.python-list@python.org>
In reply to#52448
On 8/13/2013 6:31 AM, Devyn Collier Johnson wrote:

> I now see why this programming style is called trolling.

'Trolling' is a posting style.

Your initial post was legitimate. When the first three respondents 
missed the syntax error, ';' instead of ',' within function() calls, I 
reported it. You could have easily verified that this change removed the 
syntax error, thanked me, and moved on.  Most of what you did instead, 
including pretending that there was still a mystery, could be seen as 
trolling.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#52489

FromMichael Torrie <torriem@gmail.com>
Date2013-08-13 19:55 -0600
Message-ID<mailman.558.1376445358.1251.python-list@python.org>
In reply to#52448
On 08/13/2013 04:31 AM, Devyn Collier Johnson wrote:
> For me, this style is easier to read. I have tried the "typical" style, 
> but I find this one to be easier.

One thing I do know is that your style makes it very hard to find
errors, even when the parser flags them.  And the fact that you posted
about not being able to find the syntax error proves that it's, in fact,
not easier to read.  That could be why people are pointing out your
unorthodox style and criticizing it.

I'm curious as to what language you first learned this style of coding
on.  It certainly appears reminiscent of earlier, very verbose
languages.  Capital letter variables, large, wordy blocks, etc.

[toc] | [prev] | [next] | [standalone]


#52459

FromGrant Edwards <invalid@invalid.invalid>
Date2013-08-13 13:55 +0000
Message-ID<kuddsp$msh$1@reader1.panix.com>
In reply to#52444
On 2013-08-13, Joshua Landau <joshua@landau.ws> wrote:
> On 12 August 2013 16:47, Roy Smith <roy@panix.com> wrote:
>> I can't quite sort out the multiple quoting levels, but somebody said:
>>
>>>>> Programming like that is called trolling. A programmer that uses
>>>>> trolling is called a troll. A troll can also refer to such a line of
>>>>> code itself. My scripts contain a lot of trolls. It is easier for me
>>>>> to read trolls than "typical" coding styles.
>>
>> Please tell me this is all just an elaborate joke.
>
> That was the OP (Devyn Collier Johnson, <devyncjohnson@gmail.com>) and I, too,
> am hoping this is an elaborate joke. However, see
> "http://bazaar.launchpad.net/~devyncjohnson-d/neobot/trunk/view/head:/lib/beta_engine".
>
> I am struggling to see what the punchline is...

The mind wobbles.

-- 
Grant Edwards               grant.b.edwards        Yow! Vote for ME -- I'm
                                  at               well-tapered, half-cocked,
                              gmail.com            ill-conceived and
                                                   TAX-DEFERRED!

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.python


csiph-web