Re: Python handles globals badly.

2014-12-04 Thread jtan
How can Skybuck use so much globals. Wouldn't that introduce a lot of
thread safety problems?

On Thu, Dec 4, 2014 at 9:32 AM, Mark Lawrence 
wrote:

> On 03/12/2014 23:02, Skybuck Flying wrote:
>
>>
>>
>> "Mark Lawrence"  wrote in message
>> news:mailman.16534.1417610132.18130.python-l...@python.org...
>>
>> On 03/12/2014 02:27, Skybuck Flying wrote:
>>
>>> Excuse is: "bad programming style".
>>>
>>> I don't need snot telling me how to program after 20 years of
>>> programming experience.
>>>
>>> This is so far the only thing pissing me off in python.
>>>
>>> Now I have to declare "global" in front of these variables every where I
>>> want to use em:
>>>
>>
> This reminds of of a quote from a colleague some 25 years ago "Real time
> programming is easy, you just make all the data global".  Perhaps you
> attended the same school?
>
>
>> "
>> Another example of a bad workman always blames his tools.
>> "
>>
>> Euhm, so why don't you program with just 0 and 1's then ? ;)
>>
>>
> I did with the M6800 in the late 70s.  Thankfully maybe 12 years ago I
> came across Python and it was love at first sight.  I've never looked back.
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails  and Java 
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python handles globals badly.

2014-12-04 Thread jtan
I wish him all the luck while having sleep deprivation trying to solve
production issues :)

On Thu, Dec 4, 2014 at 7:35 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:

> jtan wrote:
>
> > How can Skybuck use so much globals. Wouldn't that introduce a lot of
> > thread safety problems?
>
> Of course it would. But I expect that Skybuck probably doesn't even know
> what threads are. Or if he does, he probably doesn't believe that they
> should be used.
>
> Thread safety is just the start of the problems with global variables:
>
> http://c2.com/cgi/wiki?GlobalVariablesAreBad
>
> Globals in Python are less bad than in many other languages, since they are
> localised to a single module only. And the use of a few globals here and
> there as needed is perfectly fine for small scripts. But using dozens of
> them to avoid passing arguments to functions, that's just awful code.
>
>
> --
> Steven
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails <http://grails.asia/> and Java <http://javadevnotes.com/>
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python docs disappointing

2014-12-04 Thread jtan
On Thu, Dec 4, 2014 at 6:27 PM, Albert van der Horst <
alb...@spenarnc.xs4all.nl> wrote:

> In article ,
> Joel Goldstick   wrote:
> 
>
> Plain google is far superior in finding information.
>
> And you tell me that writing yet another tutorial would improve that?
> No, there is just one way. The powers that be should look critically
> at their website, and test it with a beginners hat on.
>

The community is in the best place to document  language.  And community is
not limited to the official doc site.  That includes outsiders doing their
share of writing tutorials and whatnot.  I don't find anything wrong about
that.

If you have problems with the docs, why not be a part of the solution?
Write a doc for numpy and contribute it to the community.

Man, I remember using MSDN 15 years ago when working with Visual Studio.
And it's a paid product with docs. It's horrendous.


>
> >
> >I'm trying to wrap my mind around DOCUMENTION being STUPID.
> >
> >--
> >Joel Goldstick
> >http://joelgoldstick.com
>
> Groetjes Albert
> --
> Albert van der Horst, UTRECHT,THE NETHERLANDS
> Economic growth -- being exponential -- ultimately falters.
> albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails  and Java 
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

2014-12-07 Thread jtan
One reason why you would want max length 79 is because of working with
terminals.  Maybe ssh to you server and check how many spaces are consumed
by a tab?  In my boxes, it is usually 1 tab = 8 spaces.  So perhaps just
use that setting in your editor?

On Mon, Dec 8, 2014 at 10:15 AM, Aahan Krish  wrote:

> My understanding from talking to different people is that many do use
> tabs (instead of spaces) for indentation in their code.
>
> My question is to them (because I want to use tabs too) is: how do you
> maintain a line-length of 79 characters?
>
> E.g. scenario: The tab setting in your editor could be 2 or 4, and in
> other developer's browser it could be 8. The code will be longer than
> 79 chars in the latter's editor.
>
> I want to know if it's at all possible or if you use some simple and
> realistic (practical) hacks.
>
> *PS: Please avoid, "That's why you should use spaces," type of
> comments. I would like to avoid flame wars.*
>
> TY,
> Aahan
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails  and Java 
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

2014-12-07 Thread jtan
On Mon, Dec 8, 2014 at 10:23 AM, Chris Angelico  wrote:

> On Mon, Dec 8, 2014 at 1:15 PM, Aahan Krish  wrote:
> > My question is to them (because I want to use tabs too) is: how do you
> > maintain a line-length of 79 characters?
> >
> > E.g. scenario: The tab setting in your editor could be 2 or 4, and in
> > other developer's browser it could be 8. The code will be longer than
> > 79 chars in the latter's editor.
>
> Easy: You stop fretting about 79 characters. :)
>

I agree with this. Just settle with your team what's your standard and have
similar IDE settings.


>
> If your policy is "lines are no more than 80-100 characters long",
> then the difference between 4-space tabs and 8-space won't break stuff
> unless it was already marginal. So if you run 4-space (or 2-space)
> indentation, you just make sure you keep your lines to the lower end
> of the limit.
>
> Even better, don't quibble about any sort of specific limit, and just
> have a policy of "don't make stuff so long that it's unreadable, and
> don't put silly arbitrary rules on your programmers". That's my
> policy.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails  and Java 
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Most Diabolical Python Antipattern

2015-01-29 Thread jtan
I would usually just log the stack trace so that I would still know that
something bad happened while the app looks okay.

On Fri, Jan 30, 2015 at 1:17 AM, Mark Lawrence 
wrote:

> The author is quite clear on his views here https://realpython.com/blog/
> python/the-most-diabolical-python-antipattern/ but what do you guys and
> gals think?
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Freelance Grails
 and Java
 developer
-- 
https://mail.python.org/mailman/listinfo/python-list