It was about time we started reaping the benefits of pushing a language designed for kids to learn into industrial use. Because hey, if it's good for kids at school it's good for us too, right?
Thanks Google, Python is the de facto language for everything. Every day I dream about the day I can leave the software industry.
Having worked in a bunch of different significant languages before coming to Python I have to say there's no way I'm going back. It's an incredibly pleasant and effective language to work in.
As for the whitespace, at least when I find example code online I know it's always going to be indented correctly :)
Identifiers, whitespace and comments; these are the ways other developers lie to me about what the code really does.
I think this is correct: Python is pleasant and effective compared to a lot of languages. In the same way that having all your fingers broken is pleasant compared to being disembowelled. Where I work the two languages used are Python and Fortran: I think this tells you all you need to know.
You have the effect backwards: Python's use in education came because it turned out that things which conserved professional developers’ attention were even more beneficial for students. Every newer language has learned from that – e.g. Google is pushing Go a lot these days and things like having a standard formatter came out of the realization that readability matters even more than we used to think, and that the “it's supposed to be hard, only manly men can do it” attitude wasn't doing more than hold back the field.
My dream, -an LISP(ed)-cons(ed)-alist-array model of my/the UML(ed)_SDN_NBI transistor-laser-LED(ed) PSM(protocol_state_machine), while the northbound api of the Software-Defined-Network has not been implemented, and getting Jamie his DHCP logon ... while keeping it all on ICE ... -https://www.infinera.com/technology/engine/- ... somebody stop me ...
I was rehashing the story of Taligent and IBM's "pay by line of code" era to someone to explain why Rhapsody never happened last night and if there's one thing developers are good at it's creating job security.
I might know the guy who coined that "UNIX arts and crafts movement" line. But it turns out you need that kind of biodiversity in the current security jungle so at least everyone now has an excuse.
I have recently been recruited to work on a large pile of Python code. I find very little I like about the language. The whitespace is disturbing at best. The real kicker is the lack of any sort of declaration machinery. I hope I never have to touch this language again. And I used to write 6502 assembly language!
Sorry I've been using the same editor for over 20 years. If a language requires that I change editors then that language is broken (or APL).
As for a lint tool it's like programming in C was in the 70's. I don't want a time machine language that looses the productivity gains of variable declaration. It's bad enough without static typing.
If you think static typing saves time outside of inner loops where scripting/4GL languages aren't generally supposed to be, and I while skeptical amd willing to concede it might for many people, then strict PEP 526 is for you. I have no idea how to turn that on, thought.
Sorry for the typos. What you really want is pyflakes clearance to run, and tailor the flags to your blood pressure. You may find things you want to know about more than type mismatch errors, but flagging them for the variables you take the time to declare as per PEP 526 is the way to get formally strong typing.
For those not actually reading the code: That is not Python. That is some Java code mangled into a monstrosity pretending to be Python. I believe the point was expressed by Russ Nelson: “if you want to program in Python, for God's sake program in Python.” https://mobile.twitter.com/russnelson/status/788780062946590720
ABC was designed as a teaching language for college kids. Python was designed as a system administration language for the Amoeba operating system. Python is more like the HP BASIC of ABC.
Can someone unpack this a little for me? Python doesn't use curly braces
for code blocks, yes? So what are we looking at over on the right? Is this some annotated version, not the raw code?
PEP-8 applied to something other than Python. I think that there's a Rule for that: "If you can think it, someone's on the internet has applied PEP-8 to it".
Oh ok. The code is maybe Java or similar, but the coder liked Python so much that they made it look like Python by moving the punctuation over to column 80. Got it.
Not just angry fruit salad. It's an editor (Sublime Text 2) which was created in the 21st fucking century which somehow insists that the display width of an ASCII TAB must obviously be identical to your indent width.
Because basic features that even vi got right 40 years ago are mysteries of the universe or something to JavaScript brogrammers.
The sad thing? It's not the only "modern" editor to be this incredibly brain dead. "sort-lines" is apparently such a fundamental feature that it absolutely needs to take up a full unmodified function key (F9). But farking sane tab rules? Black magic.
In keeping with named brace styles like the "K&R" and "Allman" brace styles, I have officially designated this brace style the "Dear God No" brace style.
If you love Python syntax but you still want to use some other language, a good way is to write a converter. Here's an example I started which is designed to allow C programming with Pythonesque whitespace.
It was about time we started reaping the benefits of pushing a language designed for kids to learn into industrial use. Because hey, if it's good for kids at school it's good for us too, right?
Thanks Google, Python is the de facto language for everything. Every day I dream about the day I can leave the software industry.
Having worked in a bunch of different significant languages before coming to Python I have to say there's no way I'm going back. It's an incredibly pleasant and effective language to work in.
As for the whitespace, at least when I find example code online I know it's always going to be indented correctly :)
Identifiers,
whitespaceand comments; these are the ways other developers lie to me about what the code really does.I think this is correct: Python is pleasant and effective compared to a lot of languages. In the same way that having all your fingers broken is pleasant compared to being disembowelled. Where I work the two languages used are Python and Fortran: I think this tells you all you need to know.
Today's NSCP price is $__._; your total unsold shares are worth $____. You are __._% vested, for a total of ____ vested unsold shares ($____). But if you quit today, you will walk away from $____.
Hang in there, little trooper! Only _ years __ months __ days to go!
You have the effect backwards: Python's use in education came because it turned out that things which conserved professional developers’ attention were even more beneficial for students. Every newer language has learned from that – e.g. Google is pushing Go a lot these days and things like having a standard formatter came out of the realization that readability matters even more than we used to think, and that the “it's supposed to be hard, only manly men can do it” attitude wasn't doing more than hold back the field.
My dream, -an LISP(ed)-cons(ed)-alist-array model of my/the UML(ed)_SDN_NBI transistor-laser-LED(ed) PSM(protocol_state_machine), while the northbound api of the Software-Defined-Network has not been implemented, and getting Jamie his DHCP logon ... while keeping it all on ICE ... -https://www.infinera.com/technology/engine/- ... somebody stop me ...
If only! All the APIs I have to use are in JavaScript now and it's at least twice the spaghetti even when making a careful effort to avoid it.
I was rehashing the story of Taligent and IBM's "pay by line of code" era to someone to explain why Rhapsody never happened last night and if there's one thing developers are good at it's creating job security.
I might know the guy who coined that "UNIX arts and crafts movement" line. But it turns out you need that kind of biodiversity in the current security jungle so at least everyone now has an excuse.
I have recently been recruited to work on a large pile of Python code. I find very little I like about the language. The whitespace is disturbing at best. The real kicker is the lack of any sort of declaration machinery. I hope I never have to touch this language again. And I used to write 6502 assembly language!
You probably don't actually want declarations as per PEP 526, but you probably do want a linting editor like pycharm or a linter like pyflakes.
Sorry I've been using the same editor for over 20 years. If a language requires that I change editors then that language is broken (or APL).
As for a lint tool it's like programming in C was in the 70's. I don't want a time machine language that looses the productivity gains of variable declaration. It's bad enough without static typing.
Python is an assault on my sensibility.
If you think static typing saves time outside of inner loops where scripting/4GL languages aren't generally supposed to be, and I while skeptical amd willing to concede it might for many people, then strict PEP 526 is for you. I have no idea how to turn that on, thought.
Sorry for the typos. What you really want is pyflakes clearance to run, and tailor the flags to your blood pressure. You may find things you want to know about more than type mismatch errors, but flagging them for the variables you take the time to declare as per PEP 526 is the way to get formally strong typing.
P.S. You can also play with implicit type checking. That seems like it could be very decent.
Type annotations have existed for a while and are a standard language feature in 2.7 and 3.5+. The latter is better, of course.
It's not static typing, but it is static type analysis via a type checker (e.g. mypy).
For those not actually reading the code: That is not Python. That is some Java code mangled into a monstrosity pretending to be Python. I believe the point was expressed by Russ Nelson: “if you want to program in Python, for God's sake program in Python.” https://mobile.twitter.com/russnelson/status/788780062946590720
Well, that's novel.
Reminds me of Bourne Shell. Which was written in an Algol-C hybrid using some clever macros.
I love Bourne's work and think that code is incredibly clean, except for the sadly inscrutable identifier names.
Jesus Christ. I saw that style once before, but I thought it was a joke...
ABC was designed as a teaching language for college kids. Python was designed as a system administration language for the Amoeba operating system. Python is more like the HP BASIC of ABC.
It turns out you can get Angry Fruit Salad for english text too! http://www.beelinereader.com/
(Mmmmmm.... fruit salad...)
I couldn't figure out what language it was and then I looked on the right side and... the horror. The fucking horror. Why? Why do that?
Can someone unpack this a little for me? Python doesn't use curly braces
for code blocks, yes? So what are we looking at over on the right? Is this some annotated version, not the raw code?
PEP-8 applied to something other than Python. I think that there's a Rule for that: "If you can think it, someone's on the internet has applied PEP-8 to it".
K3n.
Oh ok. The code is maybe Java or similar, but the coder liked Python so much that they made it look like Python by moving the punctuation over to column 80. Got it.
The Farm.
Not just angry fruit salad. It's an editor (Sublime Text 2) which was created in the 21st fucking century which somehow insists that the display width of an ASCII TAB must obviously be identical to your indent width.
Because basic features that even vi got right 40 years ago are mysteries of the universe or something to JavaScript brogrammers.
The sad thing? It's not the only "modern" editor to be this incredibly brain dead. "sort-lines" is apparently such a fundamental feature that it absolutely needs to take up a full unmodified function key (F9). But farking sane tab rules? Black magic.
I gave up on function keys in 2002.
In keeping with named brace styles like the "K&R" and "Allman" brace styles, I have officially designated this brace style the "Dear God No" brace style.
If you love Python syntax but you still want to use some other language, a good way is to write a converter. Here's an example I started which is designed to allow C programming with Pythonesque whitespace.
http://xed.ch/b/2015/0901.html
Impressive. Now do the semicolons. :D