Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Comment Re:Too many languages - insanity (Score 1) 136

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?

Comment Re:Still doesn't answer "Why" (Score 1) 387

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.

Comment Re:Still doesn't answer "Why" (Score 1) 387

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.

Comment Re:Untyped Languages Are Ill-Suited for This (Score 4, Informative) 387

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.

Comment Re:Still doesn't answer "Why" (Score 1) 387

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.

Comment Re:Untyped Languages Are Ill-Suited for This (Score 3, Interesting) 387

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.

Comment Re:Too many languages - insanity (Score 1) 136

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?

Slashdot Top Deals

What the gods would destroy they first submit to an IEEE standards committee.

Working...