Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #105938 > unrolled thread
| Started by | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| First post | 2016-03-29 11:44 +1100 |
| Last post | 2016-03-30 12:23 +0200 |
| Articles | 20 on this page of 23 — 13 participants |
Back to article view | Back to comp.lang.python
Learning Python (or Haskell) makes you a worse programmer Steven D'Aprano <steve@pearwood.info> - 2016-03-29 11:44 +1100
Re: Learning Python (or Haskell) makes you a worse programmer Ethan Furman <ethan@stoneleaf.us> - 2016-03-28 21:05 -0700
Re: Learning Python (or Haskell) makes you a worse programmer Michael Torrie <torriem@gmail.com> - 2016-03-28 22:13 -0600
[OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer Peter Otten <__peter__@web.de> - 2016-03-29 11:39 +0200
Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-29 12:05 +0200
Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-29 12:18 +0200
Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-29 17:41 +0200
Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer Peter Otten <__peter__@web.de> - 2016-03-29 18:05 +0200
Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-29 18:11 +0200
Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer Vito De Tullio <vito.detullio@gmail.com> - 2016-03-29 23:36 +0200
Re: Learning Python (or Haskell) makes you a worse programmer "Eric S. Johansson" <esj@harvee.org> - 2016-03-29 19:29 -0400
Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-30 12:07 +0200
Re: Learning Python (or Haskell) makes you a worse programmer BartC <bc@freeuk.com> - 2016-03-30 11:21 +0100
Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-30 13:43 +0200
Re: Learning Python (or Haskell) makes you a worse programmer "Eric S. Johansson" <esj@harvee.org> - 2016-03-30 09:06 -0400
Re: Learning Python (or Haskell) makes you a worse programmer Chris Angelico <rosuav@gmail.com> - 2016-03-31 00:09 +1100
Re: Learning Python (or Haskell) makes you a worse programmer "Eric S. Johansson" <esj@harvee.org> - 2016-03-30 09:37 -0400
Re: Learning Python (or Haskell) makes you a worse programmer Tim Golden <mail@timgolden.me.uk> - 2016-03-30 11:14 +0100
Re: Learning Python (or Haskell) makes you a worse programmer Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-03-31 10:36 +1300
Re: Learning Python (or Haskell) makes you a worse programmer Travis Griggs <travisgriggs@gmail.com> - 2016-03-31 09:30 -0700
Re: Learning Python (or Haskell) makes you a worse programmer Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-31 10:34 -0600
Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-31 18:44 +0200
Re: Learning Python (or Haskell) makes you a worse programmer "Sven R. Kunze" <srkunze@mail.de> - 2016-03-30 12:23 +0200
Page 1 of 2 [1] 2 Next page →
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2016-03-29 11:44 +1100 |
| Subject | Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <56f9cffb$0$1614$c3e8da3$5496439d@news.astraweb.com> |
http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ -- Steven
[toc] | [next] | [standalone]
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2016-03-28 21:05 -0700 |
| Message-ID | <mailman.126.1459224272.28225.python-list@python.org> |
| In reply to | #105938 |
On 03/28/2016 05:44 PM, Steven D'Aprano wrote: > http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ Beautiful. And my deepest sympathies for the OP. -- ~Ethan~
[toc] | [prev] | [next] | [standalone]
| From | Michael Torrie <torriem@gmail.com> |
|---|---|
| Date | 2016-03-28 22:13 -0600 |
| Message-ID | <mailman.127.1459224824.28225.python-list@python.org> |
| In reply to | #105938 |
On 03/28/2016 06:44 PM, Steven D'Aprano wrote: > http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ I have the same problem as the writer. Working in Python makes me really dislike working in any other language!
[toc] | [prev] | [next] | [standalone]
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2016-03-29 11:39 +0200 |
| Subject | [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.141.1459244875.28225.python-list@python.org> |
| In reply to | #105938 |
Steven D'Aprano wrote:
> http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/
I was about to post that in a few years' time C# will acquire enough
features to make code that follows the functional paradigm feasible in that
language.
Then I noted that this was the 10th anniversary repost ;)
My question to those who know a bit of C#: what is the state-of-the-art
equivalent to
"\n".join(foo.description() for foo in mylist
if foo.description() != "")
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-29 12:05 +0200 |
| Message-ID | <mailman.142.1459245958.28225.python-list@python.org> |
| In reply to | #105938 |
On 29.03.2016 06:13, Michael Torrie wrote: > On 03/28/2016 06:44 PM, Steven D'Aprano wrote: >> http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ > I have the same problem as the writer. Working in Python makes me > really dislike working in any other language! > Python = English :)
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-29 12:18 +0200 |
| Subject | Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.143.1459246689.28225.python-list@python.org> |
| In reply to | #105938 |
On 29.03.2016 11:39, Peter Otten wrote: > My question to those who know a bit of C#: what is the state-of-the-art > equivalent to > > "\n".join(foo.description() for foo in mylist > if foo.description() != "") > Using LINQ, I suppose: https://en.wikipedia.org/wiki/Language_Integrated_Query
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-29 17:41 +0200 |
| Subject | Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.156.1459266104.28225.python-list@python.org> |
| In reply to | #105938 |
On 29.03.2016 12:18, Sven R. Kunze wrote:
> On 29.03.2016 11:39, Peter Otten wrote:
>> My question to those who know a bit of C#: what is the state-of-the-art
>> equivalent to
>>
>> "\n".join(foo.description() for foo in mylist
>> if foo.description() != "")
>>
>
> Using LINQ, I suppose:
> https://en.wikipedia.org/wiki/Language_Integrated_Query
Friend of mine told me something like this:
String.Join("\n", mylist.Where(foo =>
!String.IsNullOrEmpty(foo.description)).Select(foo => foo.description))
[untested, but from what I know of quite correct]
Best,
Sven
[toc] | [prev] | [next] | [standalone]
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2016-03-29 18:05 +0200 |
| Subject | Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.159.1459267581.28225.python-list@python.org> |
| In reply to | #105938 |
Sven R. Kunze wrote:
> On 29.03.2016 12:18, Sven R. Kunze wrote:
>> On 29.03.2016 11:39, Peter Otten wrote:
>>> My question to those who know a bit of C#: what is the state-of-the-art
>>> equivalent to
>>>
>>> "\n".join(foo.description() for foo in mylist
>>> if foo.description() != "")
>>>
>>
>> Using LINQ, I suppose:
>> https://en.wikipedia.org/wiki/Language_Integrated_Query
>
> Friend of mine told me something like this:
>
> String.Join("\n", mylist.Where(foo =>
> !String.IsNullOrEmpty(foo.description)).Select(foo => foo.description))
>
> [untested, but from what I know of quite correct]
Reformatting it a bit
String.Join(
"\n",
mylist.Where(
foo => !String.IsNullOrEmpty(foo.description)
).Select(
foo => foo.description))
this looks like a variant of Python's
str.join(
"\n",
map(lambda foo: foo.description,
filter(lambda foo: foo.description, mylist)))
Assuming it's type-safe and can perhaps reshuffle the where and select part
into something optimised there is definitely progress.
But still, Python's generator expressions are cool..
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-29 18:11 +0200 |
| Subject | Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.160.1459267899.28225.python-list@python.org> |
| In reply to | #105938 |
On 29.03.2016 18:05, Peter Otten wrote: > Reformatting it a bit > > String.Join( > "\n", > mylist.Where( > foo => !String.IsNullOrEmpty(foo.description) > ).Select( > foo => foo.description)) > > this looks like a variant of Python's > > str.join( > "\n", > map(lambda foo: foo.description, > filter(lambda foo: foo.description, mylist))) > > Assuming it's type-safe and can perhaps reshuffle the where and select part > into something optimised there is definitely progress. > > But still, Python's generator expressions are cool.. Haha, sure. But don't get stuck there. Learn something new from time to time; even a new language. Best, Sven
[toc] | [prev] | [next] | [standalone]
| From | Vito De Tullio <vito.detullio@gmail.com> |
|---|---|
| Date | 2016-03-29 23:36 +0200 |
| Subject | Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer |
| Message-ID | <mailman.168.1459287378.28225.python-list@python.org> |
| In reply to | #105938 |
Sven R. Kunze wrote:
>>> My question to those who know a bit of C#: what is the state-of-the-art
>>> equivalent to
>>>
>>> "\n".join(foo.description() for foo in mylist
>>> if foo.description() != "")
> Friend of mine told me something like this:
>
> String.Join("\n", mylist.Where(foo =>
> !String.IsNullOrEmpty(foo.description)).Select(foo => foo.description))
I don't know if is "better" or not, but I find more readable using the
"sql"-like syntax
string.Join("\n", from foo in mylist
where !string.IsNullOrEmpty(foo.description())
select foo.description());
which is relatively similar to the python's comprehension.
--
By ZeD
[toc] | [prev] | [next] | [standalone]
| From | "Eric S. Johansson" <esj@harvee.org> |
|---|---|
| Date | 2016-03-29 19:29 -0400 |
| Message-ID | <mailman.172.1459294518.28225.python-list@python.org> |
| In reply to | #105938 |
On 3/29/2016 6:05 AM, Sven R. Kunze wrote: > > Python = English > As someone who writes English text and code using speech recognition, I can assure you that Python is not English. :-)
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-30 12:07 +0200 |
| Message-ID | <mailman.187.1459332474.28225.python-list@python.org> |
| In reply to | #105938 |
On 30.03.2016 01:29, Eric S. Johansson wrote: > > > On 3/29/2016 6:05 AM, Sven R. Kunze wrote: >> >> Python = English >> > As someone who writes English text and code using speech recognition, > I can assure you that Python is not English. :-) :D Interesting. Never thought of how Python sounds when spoken. Btw. the equivalence was more meant in the context of this thread. ;) Best, Sven
[toc] | [prev] | [next] | [standalone]
| From | BartC <bc@freeuk.com> |
|---|---|
| Date | 2016-03-30 11:21 +0100 |
| Message-ID | <ndg94g$m0d$2@dont-email.me> |
| In reply to | #106038 |
On 30/03/2016 11:07, Sven R. Kunze wrote: > On 30.03.2016 01:29, Eric S. Johansson wrote: >> >> >> On 3/29/2016 6:05 AM, Sven R. Kunze wrote: >>> >>> Python = English >>> >> As someone who writes English text and code using speech recognition, >> I can assure you that Python is not English. :-) > > :D Interesting. Never thought of how Python sounds when spoken. Among other things, it becomes case insensitive... -- Bartc
[toc] | [prev] | [next] | [standalone]
| From | "Sven R. Kunze" <srkunze@mail.de> |
|---|---|
| Date | 2016-03-30 13:43 +0200 |
| Message-ID | <mailman.195.1459338217.28225.python-list@python.org> |
| In reply to | #106042 |
On 30.03.2016 12:21, BartC wrote: > On 30/03/2016 11:07, Sven R. Kunze wrote: >> On 30.03.2016 01:29, Eric S. Johansson wrote: >>> >>> >>> On 3/29/2016 6:05 AM, Sven R. Kunze wrote: >>>> >>>> Python = English >>>> >>> As someone who writes English text and code using speech recognition, >>> I can assure you that Python is not English. :-) >> >> :D Interesting. Never thought of how Python sounds when spoken. > > Among other things, it becomes case insensitive... > Now that you mention it... ;) You do coding with speech recognition, too?
[toc] | [prev] | [next] | [standalone]
| From | "Eric S. Johansson" <esj@harvee.org> |
|---|---|
| Date | 2016-03-30 09:06 -0400 |
| Message-ID | <mailman.200.1459343176.28225.python-list@python.org> |
| In reply to | #106042 |
On 3/30/2016 6:21 AM, BartC wrote: > On 30/03/2016 11:07, Sven R. Kunze wrote: >> On 30.03.2016 01:29, Eric S. Johansson wrote: >>> >>> >>> On 3/29/2016 6:05 AM, Sven R. Kunze wrote: >>>> >>>> Python = English >>>> >>> As someone who writes English text and code using speech recognition, >>> I can assure you that Python is not English. :-) >> >> :D Interesting. Never thought of how Python sounds when spoken. > > Among other things, it becomes case insensitive... Which makes complying with Pep 8 quite the bitch. Fortunately, I have a workaround (togglename) which lets me dictate what I need to say and preserve the spoken to code for mapping for later translation. (I.e. this thing is that thing mapping). I need a co-conspirator with better hands than mine to get through the next stage which is some form of an AST smart editor that operates on larger chunks such as idioms or snippets in a speech friendly way. Ideally I'd like to see a bidirectional transform between the spoken form and a code form so that you can edit the spoken form and regenerate the code. Just one example of what I am thinking of is when you say the string name of a previously defined class instance, you get a dialogue of all available methods and string names. When you are at the point of speaking the argument list, it gives you an abstract form of the argument list that is filled in with a minimal set of speech commands. I'm too lazy to create the full description right now what if anybody wants to know more, ask and I'll fill in the blanks. It's important to remember though that using simple or accelerated methods for creating code is the easy part of the problem. It's editing existing code that is hard because you've lost a lot of the information necessary for speech user interface. This is where I think an AST based editor will come in quite handy. So far, I haven't found any.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2016-03-31 00:09 +1100 |
| Message-ID | <mailman.201.1459343408.28225.python-list@python.org> |
| In reply to | #106042 |
On Thu, Mar 31, 2016 at 12:06 AM, Eric S. Johansson <esj@harvee.org> wrote: > I need a co-conspirator with better hands than mine to get through the next > stage which is some form of an AST smart editor that operates on larger > chunks such as idioms or snippets in a speech friendly way. Ideally I'd like > to see a bidirectional transform between the spoken form and a code form so > that you can edit the spoken form and regenerate the code. Sounds to me like what you want is a variant language, a speech-friendly programming language that compiles to Python. You effectively store the spoken version, and translate it (one way) to Python for execution. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | "Eric S. Johansson" <esj@harvee.org> |
|---|---|
| Date | 2016-03-30 09:37 -0400 |
| Message-ID | <mailman.208.1459345028.28225.python-list@python.org> |
| In reply to | #106042 |
On 3/30/2016 9:09 AM, Chris Angelico wrote: > On Thu, Mar 31, 2016 at 12:06 AM, Eric S. Johansson <esj@harvee.org> wrote: >> I need a co-conspirator with better hands than mine to get through the next >> stage which is some form of an AST smart editor that operates on larger >> chunks such as idioms or snippets in a speech friendly way. Ideally I'd like >> to see a bidirectional transform between the spoken form and a code form so >> that you can edit the spoken form and regenerate the code. > Sounds to me like what you want is a variant language, a > speech-friendly programming language that compiles to Python. You > effectively store the spoken version, and translate it (one way) to > Python for execution. That would be ideal but the problem comes with working with the team. I can't expect the other members the team to learn the system. I need to be able to work according to the teams rules (coding style etc.) for proper integration into an effort. Maybe I should be looking at machine learning for identifying patterns in the code and translation back to a spoken form. It be interesting to see what people could come up with though for a speech friendly Python model. I've been wrestling with the problem so long, I probably have tons of blind spots.
[toc] | [prev] | [next] | [standalone]
| From | Tim Golden <mail@timgolden.me.uk> |
|---|---|
| Date | 2016-03-30 11:14 +0100 |
| Message-ID | <mailman.188.1459332893.28225.python-list@python.org> |
| In reply to | #105938 |
On 30/03/2016 11:07, Sven R. Kunze wrote: > On 30.03.2016 01:29, Eric S. Johansson wrote: >> >> >> On 3/29/2016 6:05 AM, Sven R. Kunze wrote: >>> >>> Python = English >>> >> As someone who writes English text and code using speech recognition, >> I can assure you that Python is not English. :-) > > :D Interesting. Never thought of how Python sounds when spoken. Not that you quite meant this, but I'm always amused (and still a little startled) when I listen to talks recorded from, say, PyCon and hear people with American accents pronouncing Python with the stress on the slightly longer second syllable. (I don't know how other English-speaking groups say the word, but in England the first syllable is stressed and the second is the conventional short "uh" sound). TJG
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2016-03-31 10:36 +1300 |
| Message-ID | <dm2v6pFk0qoU1@mid.individual.net> |
| In reply to | #106039 |
Tim Golden wrote: > (I don't know how other English-speaking groups say the word, but in > England the first syllable is stressed and the second is the > conventional short "uh" sound). I can attest that New Zealand follows the UK on this. I was surprised when I first heard an American pronounce it too. The curious can hear the difference on these pages: British: http://www.oxforddictionaries.com/definition/english/python American: http://www.dictionary.com/browse/python?s=t -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Travis Griggs <travisgriggs@gmail.com> |
|---|---|
| Date | 2016-03-31 09:30 -0700 |
| Message-ID | <mailman.269.1459441864.28225.python-list@python.org> |
| In reply to | #106114 |
> On Mar 30, 2016, at 2:36 PM, Gregory Ewing <greg.ewing@canterbury.ac.nz> wrote: > > Tim Golden wrote: > >> (I don't know how other English-speaking groups say the word, but in >> England the first syllable is stressed and the second is the >> conventional short "uh" sound). > > I can attest that New Zealand follows the UK on this. I was > surprised when I first heard an American pronounce it too. > > The curious can hear the difference on these pages: > > British: http://www.oxforddictionaries.com/definition/english/python > American: http://www.dictionary.com/browse/python?s=t That does it. If I ever make some sort of open source module for pythun/pythawn I’ll be sure to call it either tuhmayto/tomawto. Or maybe I’ll call it puhtayto/potawto.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.python
csiph-web