The number one thing that programmers need to learn, and from what I have seen, don't at University, is how to read documentation and apply the learnt concept to their code. The easiest way to learn to do that is to learn by doing. Programming is probably the easiest thing in the world that requires a fair amount of knowledge to do without formal education - the resources are vast and great. A mixture of a good language (personally, a huge fan of Python, and it's often considered a good language to learn, but really, anything with a large standard library will do), it's documentation, Google and StackOverflow will be enough.
Seriously? Sphinx makes beautiful documentation that is easy to find your way around. Compared to the ugly-ass JavaDocs that are painful to browse through, I wouldn't even give it a second thought.
Yeah, the issue is that Python is pretty hard to sandbox, being the hugely dynamic language it is. I imagine it would take a lot to get the browsers to stop working on their JavaScript implementations that they have sunk insane amounts of time and effort into, and start something brand new.
Trust me, I'd love to see it happen, but I don't think it will.
The GIL is an overblown issue. Threading is designed to get around issues with accessing slow resources, not for serious parallel computing. Just use multiprocessing if you want to do lots of computing in parallel, problem solved.
You defining lambdas as something else doesn't make them more powerful, it's just something you are saying. I will ask again, and if it's so obvious then you shouldn't have a problem answering, in what situation do I need a lambda (or even want one, just to make something simpler or whatever) instead of a function?
Automatic type conversion, NaN is a number, NaN doesn't equal itself, leave off a 'var' and you start creating globals, "0" == false but "false" != false, parseInt assumes that anything beginning with a 0 is octal, anonymous functions everywhere (which discourages code reuse), there is nothing that even approaches a decent looping structure, etc..., etc... - I'm no expert, I fully admit, but what I have used of JavaScript makes it quite clear that there are huge problems there.
Really, I'd be happy to take another look if someone could show me why everyone loves it - but even without the mess of DOM and HTML (which I agree, are half the pain of web dev with JS), I don't see it.
I've just... never had a problem with it. It seems so natural to me, and I've never had any issues at all. I don't get why anyone would have a problem with it. I can't believe emacs is doing anything so terrible.
Except is that really what's best? Sure, lots of developers know it. And? We all know raw numbers of applications don't matter. Using a better language would result in better quality when it came to applications, and a better experience for the developers doing it. Some people might have to learn to use another language - that's not the end of the world.
As to it being a good language to use, show me that. I've seen a million things trying to show me how great it is, and they all just seem to be spending half the time talking about how amazing it is they can do this thing that would be trivial to do in any other language, but in JavaScript requires a ton of boilerplate crap to make it possible.
Re:Untyped Languages Are Ill-Suited for This
on
Gnome Goes JavaScript
·
· Score: 4, Informative
It's mainly a product of the weak typing - doing [] + {} gives you an object, while {} + [] gives you 0. That's not useful when you have a problem you are trying to debug. Python follows the idea that things should fail loudly so that bugs are made clear. The indentation thing is overstated - text editors are not that terrible, and if they are, use a different one. It makes the code far nicer to work with and read.
Firstly, don't blame the language for the programmer - anyone can be a rubbish programmer in any language. As to your examples, I find it funny you manage to pick an incredibly hard thing to do in Python - if you open a file and iterate over it, the default method (without any special work from the programmer) is to do so lazily, so there is not a massive file read into memory. The whole Python core library is built around the iterator interface, which means most data is processed lazily without having to even think about it.
As to your last comment, Really? PHP has a host of problems - mainly due to the way they update the language without removing old stuff, and add features haphazardly. This leaves you with twenty different ways to access a database, etc..., etc... Python, on the other hand, has specifically avoided this. 3.x has gone back and fixed core language problems where they existed, and made the experience much more consistent. This is a sign the language is being curated and nurtured, not hacked on like JavaScript or PHP.
Really? JavaScript has too many fatal flaws, as much as libraries try to hide them, even with something like CoffeeScript patching the holes, it's still missing a ton of stuff that makes Python so powerful and effective.
It's popular on the mobile side because it's cross-platform. That's it. JavaScript isn't easy to use, it's a mess of a language that has been hacked into something vaguely usable because it's the only option there.
And yeah, who wants to actually write relevant code? Let's spend all our time re-implementing the wheel, because that's effective. Python has excellent design behind it, and it's perfect for this kind of thing. Small to medium sized applications that need to be made fast, while remaining maintainable and work in as many places as possible.
Re:Untyped Languages Are Ill-Suited for This
on
Gnome Goes JavaScript
·
· Score: 3, Interesting
Comparing Python to Javascript and saying they are both the same is just wrong - for one, Python is strongly typed, but dynamic, not weakly typed like JavaScript.
While I agree static typing makes maintaining complex applications easier, Python does a lot to reduce the issue. The language and culture are built around code being readable and maintainable, it's strongly typed, it follows the idea that nothing should ever fail silently, which greatly reduces the chance of issues cropping up. This makes Python completely usable for a wide range of applications. Yes, in some cases, a statically typed language will be easier to manage, but that's not the case in 'anything beyond the comfort zone of a script'.
JavaScript, on the other hand, is full of awkward stuff that makes it hard to program in. Things fail and return random values, stuff like that. Add to that a poor syntax for readability and JavaScript is pretty hard to maintain.
Less powerful? Python functions are objects like any other, instead of focusing on a particular way of making a function (lambda), just make one with `def` and use it - all the power you want. lambda is just a little thing to make it easier to put really simple functions in quickly.
I literally have no idea how you think indentation messes with printing to debug. I'm not sure what you think the issue is here.
As to moving files and getting indentation messed up, what? What systems do you use that mess with whitespace in files so significantly? That's clearly a fault with whatever you are using. Why should any tool for moving a file mess with the number of tabs/spaces at the start of individual lines in the file?
What? What editor do you know that just messes with the amount of whitespace in files? It's clearly not designed for programming with. The only common change that is done is to change the width of a tab character, which doesn't affect the code at all, just how it's displayed. It'll run fine either way. I don't understand how you would break a Python program in this way, and if you did, it would be the editor doing something insane.
That is not considered a bad design choice by the PSF (or me, for that matter). It's a great idea that increases readability by decreasing excess clutter in your code. I simply don't understand how people can not like it.
I haven't seen that shift of programmers at all, and I completely disagree. They fixed a lot of core issues such as print being a statement rather than a function, loads of the core types returning lists rather than generators, division being float by default, annotations, extended iterable unpacking, nonlocal, and much more. Unicode was a big one and it's excellent - modern languages need to work with Unicode, it's crazy that the kind of built in support that 3.x has isn't standard across the board.
Please, tell me what 'really poor' design decisions were not fixed with 3.x?
Python breaking compatibility with version 3 was a brilliant idea. It meant they could fix the (few) poor design decisions they made early on. This means instead of getting yet another language or having to deal with annoying stuff, instead it's just a small move to 3.x, which is excellent.
If they emit warnings, that annoys the rest of the users who don't need them. Why does every distro have to suit everyone? No, Arch is not designed to be user friendly, but that's the point - it expects you to know what is going on and deal with it, that way it can be simpler and more efficient for those users who are happy with that. If you don't like that, use a different distro - that's not being lazy or rude, it's just making the operating system that certain people want, not yet another one aimed at the average user. There is nothing wrong with doing that, but it's not what Arch does.
As to your examples, it's entirely possible that the first case could have broken stuff, I guess. I'm no expert, although the second case doesn't make sense as Arch doesn't ship with any audio system by default, so 'switching' doesn't make sense.
The number one thing that programmers need to learn, and from what I have seen, don't at University, is how to read documentation and apply the learnt concept to their code. The easiest way to learn to do that is to learn by doing. Programming is probably the easiest thing in the world that requires a fair amount of knowledge to do without formal education - the resources are vast and great. A mixture of a good language (personally, a huge fan of Python, and it's often considered a good language to learn, but really, anything with a large standard library will do), it's documentation, Google and StackOverflow will be enough.
PyPy isn't there yet.
Seriously? Sphinx makes beautiful documentation that is easy to find your way around. Compared to the ugly-ass JavaDocs that are painful to browse through, I wouldn't even give it a second thought.
Yeah, the issue is that Python is pretty hard to sandbox, being the hugely dynamic language it is. I imagine it would take a lot to get the browsers to stop working on their JavaScript implementations that they have sunk insane amounts of time and effort into, and start something brand new.
Trust me, I'd love to see it happen, but I don't think it will.
Oh, and Python without a GIL exists, it's called Jython.
The GIL is an overblown issue. Threading is designed to get around issues with accessing slow resources, not for serious parallel computing. Just use multiprocessing if you want to do lots of computing in parallel, problem solved.
You defining lambdas as something else doesn't make them more powerful, it's just something you are saying. I will ask again, and if it's so obvious then you shouldn't have a problem answering, in what situation do I need a lambda (or even want one, just to make something simpler or whatever) instead of a function?
Automatic type conversion, NaN is a number, NaN doesn't equal itself, leave off a 'var' and you start creating globals, "0" == false but "false" != false, parseInt assumes that anything beginning with a 0 is octal, anonymous functions everywhere (which discourages code reuse), there is nothing that even approaches a decent looping structure, etc..., etc... - I'm no expert, I fully admit, but what I have used of JavaScript makes it quite clear that there are huge problems there.
Really, I'd be happy to take another look if someone could show me why everyone loves it - but even without the mess of DOM and HTML (which I agree, are half the pain of web dev with JS), I don't see it.
Please give me an example of something that you can do in Language X using lambdas that you can't do in Python with a normal function.
I've just... never had a problem with it. It seems so natural to me, and I've never had any issues at all. I don't get why anyone would have a problem with it. I can't believe emacs is doing anything so terrible.
They have broken backwards compatibility once, when they released 3.x.
Yes, and all that power is available from a normal function in Python. They can be defined and used in all the context lambdas can.
Except is that really what's best? Sure, lots of developers know it. And? We all know raw numbers of applications don't matter. Using a better language would result in better quality when it came to applications, and a better experience for the developers doing it. Some people might have to learn to use another language - that's not the end of the world.
As to it being a good language to use, show me that. I've seen a million things trying to show me how great it is, and they all just seem to be spending half the time talking about how amazing it is they can do this thing that would be trivial to do in any other language, but in JavaScript requires a ton of boilerplate crap to make it possible.
It's mainly a product of the weak typing - doing [] + {} gives you an object, while {} + [] gives you 0. That's not useful when you have a problem you are trying to debug. Python follows the idea that things should fail loudly so that bugs are made clear. The indentation thing is overstated - text editors are not that terrible, and if they are, use a different one. It makes the code far nicer to work with and read.
Firstly, don't blame the language for the programmer - anyone can be a rubbish programmer in any language. As to your examples, I find it funny you manage to pick an incredibly hard thing to do in Python - if you open a file and iterate over it, the default method (without any special work from the programmer) is to do so lazily, so there is not a massive file read into memory. The whole Python core library is built around the iterator interface, which means most data is processed lazily without having to even think about it.
As to your last comment, Really? PHP has a host of problems - mainly due to the way they update the language without removing old stuff, and add features haphazardly. This leaves you with twenty different ways to access a database, etc..., etc... Python, on the other hand, has specifically avoided this. 3.x has gone back and fixed core language problems where they existed, and made the experience much more consistent. This is a sign the language is being curated and nurtured, not hacked on like JavaScript or PHP.
it's better and faster than C
That's such a non-statement. Better in what way? Faster in what sense? In what situations?
Really? JavaScript has too many fatal flaws, as much as libraries try to hide them, even with something like CoffeeScript patching the holes, it's still missing a ton of stuff that makes Python so powerful and effective.
It's popular on the mobile side because it's cross-platform. That's it. JavaScript isn't easy to use, it's a mess of a language that has been hacked into something vaguely usable because it's the only option there.
And yeah, who wants to actually write relevant code? Let's spend all our time re-implementing the wheel, because that's effective. Python has excellent design behind it, and it's perfect for this kind of thing. Small to medium sized applications that need to be made fast, while remaining maintainable and work in as many places as possible.
Comparing Python to Javascript and saying they are both the same is just wrong - for one, Python is strongly typed, but dynamic, not weakly typed like JavaScript.
While I agree static typing makes maintaining complex applications easier, Python does a lot to reduce the issue. The language and culture are built around code being readable and maintainable, it's strongly typed, it follows the idea that nothing should ever fail silently, which greatly reduces the chance of issues cropping up. This makes Python completely usable for a wide range of applications. Yes, in some cases, a statically typed language will be easier to manage, but that's not the case in 'anything beyond the comfort zone of a script'.
JavaScript, on the other hand, is full of awkward stuff that makes it hard to program in. Things fail and return random values, stuff like that. Add to that a poor syntax for readability and JavaScript is pretty hard to maintain.
I'll believe that when I see it - it might be happening in small numbers, but I don't see the appeal of Go over Python.
Less powerful? Python functions are objects like any other, instead of focusing on a particular way of making a function (lambda), just make one with `def` and use it - all the power you want. lambda is just a little thing to make it easier to put really simple functions in quickly.
I literally have no idea how you think indentation messes with printing to debug. I'm not sure what you think the issue is here.
As to moving files and getting indentation messed up, what? What systems do you use that mess with whitespace in files so significantly? That's clearly a fault with whatever you are using. Why should any tool for moving a file mess with the number of tabs/spaces at the start of individual lines in the file?
What? What editor do you know that just messes with the amount of whitespace in files? It's clearly not designed for programming with. The only common change that is done is to change the width of a tab character, which doesn't affect the code at all, just how it's displayed. It'll run fine either way. I don't understand how you would break a Python program in this way, and if you did, it would be the editor doing something insane.
That is not considered a bad design choice by the PSF (or me, for that matter). It's a great idea that increases readability by decreasing excess clutter in your code. I simply don't understand how people can not like it.
I haven't seen that shift of programmers at all, and I completely disagree. They fixed a lot of core issues such as print being a statement rather than a function, loads of the core types returning lists rather than generators, division being float by default, annotations, extended iterable unpacking, nonlocal, and much more. Unicode was a big one and it's excellent - modern languages need to work with Unicode, it's crazy that the kind of built in support that 3.x has isn't standard across the board.
Please, tell me what 'really poor' design decisions were not fixed with 3.x?
Python breaking compatibility with version 3 was a brilliant idea. It meant they could fix the (few) poor design decisions they made early on. This means instead of getting yet another language or having to deal with annoying stuff, instead it's just a small move to 3.x, which is excellent.
If they emit warnings, that annoys the rest of the users who don't need them. Why does every distro have to suit everyone? No, Arch is not designed to be user friendly, but that's the point - it expects you to know what is going on and deal with it, that way it can be simpler and more efficient for those users who are happy with that. If you don't like that, use a different distro - that's not being lazy or rude, it's just making the operating system that certain people want, not yet another one aimed at the average user. There is nothing wrong with doing that, but it's not what Arch does.
As to your examples, it's entirely possible that the first case could have broken stuff, I guess. I'm no expert, although the second case doesn't make sense as Arch doesn't ship with any audio system by default, so 'switching' doesn't make sense.