Suggested coding style

R

rantingrick

Strangely, calling the bible self-contradictory wasn't seen as
inflammatory...

For the same reason that telling the truth is not slander. The fact is
that the Bible IS contradictory with itself. However, your opinion
unlike my facts, were full of vile hatred. Nice try attempting to
shift the mob against me.
 
R

rantingrick

Nope, that doesn't work.


'00000-1234'

The whole point of zfill is that it handles signs correctly.

py> "{0:-010d}".format(-1234)
'-000001234'

My point was: Use the {char}{repeat}d format for integers and the
{char}{<|>|=}{repeat} for strings. Problem solved. No more need for
zfill.

py> "{0:0>10}".format(-1234)
'00000-1234'

What result would you expect from that string argument? I think it
behaves as anyone would expect. If you have a str and you want it
interpreted as a negative integer then cast it.

py> "{0:010d}".format(int("-1234"))
'-000001234'

If you would like for the spec to handle the case of integers and
strings transparently then you need to lobby to have the API changed.
Maybe they could add a !i like the !s and !r which would be explicit.
However, i don't think implicit coercion of strings to integers is a
good idea. Using the int function or !i removes and ambiguities.

For me, the spec works just fine as is.
 
C

Chris Angelico

Well "alex", like yourself, i hold expertise in many fields BESIDES
programming. One of which being psychology.

I *knew* it! We're all part of a huge experiment to see how much the
human psyche can withstand. If we succeed on the Rick test, do we
"level up" and get a second troll to deal with, or is this MST3K-style
eternity?

ChrisA
 
D

DevPlayer

I still assert that contradiction is caused by narrow perspective.

By that I mean: just because an objects scope may not see a certain
condition, doesn't mean that condition is non-existant.

I also propose that just because something seems to contradict doesn't
mean it is false. Take for instance:

Look out your window. Is it daylight or night time? You may say it is
daylight or you may say it is night time. I would disagree that only
one of those conditions are true. Both conditions are true. Always. It
is only day (or night) for YOU. But the opposite DOES in fact exist on
the other side of the world at the same time.

I call this Duality of Nature (and I believe there was some religion
somewhere in some time that has the same notion, Budism I think but I
could be mistaken). I see such "contradictions" in what appears to be
most truths.

If I am correct; not sure here; but I think that is part of the new
math Choas theory. (The notion that not all variables are known and
the results of well defined functions may result in completely
different actual outcomes) [Missing variables in such data sets and
functions, to me is basically a narrow(er) perspective of the all the
revelent factors for such computations.]

You could think of this in terms of classes and attributes if you
want. Just because an object does not see an attribute, like "has_
connection", doesn't mean the app doesn't have a connection to the
server, just that that object doesn't have access to the existance of
that attribute, because it is not in scope (ie narrow perspective).

I propose that if something seems to contradict itself, that that
doesnt' invalidate its value outright. It -could- invalidate its
value, but doesn't guarentee no value.

How this matters to coding style? No connection visible. It's just a
proposed notion.
 
N

Neil Cerutti

I still assert that contradiction is caused by narrow perspective.

By that I mean: just because an objects scope may not see a certain
condition, doesn't mean that condition is non-existant.

I also propose that just because something seems to contradict doesn't
mean it is false. Take for instance:

Look out your window. Is it daylight or night time? You may say
it is daylight or you may say it is night time. I would
disagree that only one of those conditions are true. Both
conditions are true. Always. It is only day (or night) for YOU.
But the opposite DOES in fact exist on the other side of the
world at the same time.

I call this Duality of Nature (and I believe there was some
religion somewhere in some time that has the same notion,
Budism I think but I could be mistaken). I see such
"contradictions" in what appears to be most truths.

You are not alone. Many ancient philosophers, fathers of
religious and scientific thought, thought the same.

They thought that contradictory qualities could exist in objects
simultaneously. For example, they thought that a cat was both big
and small, because it was big compared to a mouse and small
compared to a house. They didn't notice that big and small were
not poperties of the cat, at all but were instead statements
about how a cat relates to another object.

When you say, "It is night," you are making an assertion about a
position on the surface of the earth and its relationship to the
sun.

If you are not discussing a specific a position on the Earth,
then you cannot make a meaningful assertion about night or day at
all. Night and Day are not qualities of the entire Earth, but
only of positions on the Earth.
 
R

rusi

You are not alone. Many ancient philosophers, fathers of
religious and scientific thought, thought the same.

They thought that contradictory qualities could exist in objects
simultaneously. For example, they thought that a cat was both big
and small, because it was big compared to a mouse and small
compared to a house. They didn't notice that big and small were
not poperties of the cat, at all but were instead statements
about how a cat relates to another object.

When you say, "It is night," you are making an assertion about a
position on the surface of the earth and its relationship to the
sun.

If you are not discussing a specific a position on the Earth,
then you cannot make a meaningful assertion about night or day at
all. Night and Day are not qualities of the entire Earth, but
only of positions on the Earth.

But just imagine that we were all pre-galiliean savages -- knowing
nothing about the roundness of the earth, the earth going round and so
on and somehow you and I get on the phone and we start arguing:
Rusi: Its 9:30 pm
Neil: No its 12 noon

How many cases are there?
We both may be right, I may be wrong (my watch may have stopped) or we
both etc

ie conflicting data may get resolved within a larger world view (which
is what devplayer is probably saying).

Until then it is wiser to assume that that larger world view exists
(and I dont yet know it)
than to assume that since I dont know it it does not exist.

For me (admittedly an oriental) such agnosticism (literally "I-do-not-
know-ness") is as much a foundation for true religiosity as effective
science.
 
W

Westley Martínez

But just imagine that we were all pre-galiliean savages -- knowing
nothing about the roundness of the earth, the earth going round and so
on and somehow you and I get on the phone and we start arguing:
Rusi: Its 9:30 pm
Neil: No its 12 noon

How many cases are there?
We both may be right, I may be wrong (my watch may have stopped) or we
both etc

ie conflicting data may get resolved within a larger world view (which
is what devplayer is probably saying).

Until then it is wiser to assume that that larger world view exists
(and I dont yet know it)
than to assume that since I dont know it it does not exist.

For me (admittedly an oriental) such agnosticism (literally "I-do-not-
know-ness") is as much a foundation for true religiosity as effective
science

I.e. humility?
 
D

Dennis Lee Bieber

Look out your window. Is it daylight or night time? You may say it is
daylight or you may say it is night time. I would disagree that only
one of those conditions are true. Both conditions are true. Always. It
is only day (or night) for YOU. But the opposite DOES in fact exist on
the other side of the world at the same time.
And I would argue that by starting with "Look out your window..."
you have explicitly excluded the rest of the world from consideration in
answering; you have narrowed the focus to only the region visible from
"my window".
 
C

Chris Angelico

       And I would argue that by starting with "Look out your window..."
you have explicitly excluded the rest of the world from consideration in
answering; you have narrowed the focus to only the region visible from
"my window".

But what if I'm a great windowing magnate, owning windows all over the world?

(Is anyone else amused by this thread and its ridiculosity?)

ChrisA
 
R

rusi

But what if I'm a great windowing magnate, owning windows all over the world?

(Is anyone else amused by this thread and its ridiculosity?)

ChrisA

Not more ridiculous than people getting religious over not just about
silly (man-made) languages but even over the editors they use <wink>
 
C

Chris Angelico

May I suggest a[n] email client that can group mailing list threads?

Please do. Bonus points if it handles threading in a Gmail-like style.

May I suggest Gmail? It handles threading in a very Gmail-like style.

ChrisA
running and ducking
 
P

Prasad, Ramit

Please do. Bonus points if it handles threading in a Gmail-like style.
May I suggest Gmail? It handles threading in a very Gmail-like style.

Curses, foiled by my lack of specificity! I meant desktop client. Although...if another website does similar threading it would be good to know. Never know when I will want to start avoiding Gmail :)

Ramit


Ramit Prasad | JPMorganChase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy andcompleteness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
E

Ethan Furman

rusi said:
Not more ridiculous than people getting religious over not just about
silly (man-made) languages but even over the editors they use <wink>

No kidding! Vim is *obviously* the best one out there! *ducks and runs*

~Ethan~
 
P

Paul Rudin

Prasad said:
May I suggest a[n] email client that can group mailing list threads?

Please do. Bonus points if it handles threading in a Gmail-like style.

The answer to any news/mail client with feature X type question is
normally "gnus" - although I don't know what "Gmail-like style" is.
 
C

Chris Angelico

Curses, foiled by my lack of specificity! I meant desktop client. Although...if another website does similar threading it would be good to know. Never know when I will want to start avoiding Gmail :)

Ah, *desktop* client! Hm. I actually can't advise there; since I'm
constantly mobile, I use webmail for everything - installed Squirrel
Mail and RoundCube on my server for remote access. Neither does
threading though afaik; nor does PMMail (which is a desktop client).

ChrisA
 
N

Neil Cerutti

Prasad said:
May I suggest a[n] email client that can group mailing list threads?

Please do. Bonus points if it handles threading in a Gmail-like style.

The answer to any news/mail client with feature X type question is
normally "gnus" - although I don't know what "Gmail-like style" is.

slrn. Is good.
 
A

Alec Taylor

Maybe one Apache's Buzz?

Curses, foiled by my lack of specificity! I meant desktop client.
Although...if another website does similar threading it would be good to
know. Never know when I will want to start avoiding Gmail :)

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
P

Prasad, Ramit

May I suggest a[n] email client that can group mailing list threads?

The answer to any news/mail client with feature X type question is
normally "gnus" - although I don't know what "Gmail-like style" is.
Yeah

slrn. Is good.
Unless I am missing something, it does not do email.

Are you suggesting I run my own webserver to aggregate emails, stick them in wave, and then write something that will convert my wave post to email? I suppose it could work, but that is *usually* not what is considered a "desktop app".

Maybe one Apache's Buzz?
I think you will have to Google that one for me, as the first results I found were Apache Wicket and Apache Beehive...both which seem not related.


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, andlegal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
P

Prasad, Ramit

The answer to any news/mail client with feature X type question is

Gah, I got distracted mid-email and forgot to finish. What I wanted to say was, "Yeah, not knowing what 'Gmail-like style' makes a big difference ;)".

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423




This email is confidential and subject to important disclaimersand
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top