Find a flaw. If you do, name a language that does it better

Find a flaw. If you do, name a language that does it better.

Attached: python-logo.png (211x71, 44K)

Forced indentation of code.

Whitespace being a part of the language. Literally any language that doesn't is better. Also, no types.

threading.
Basically every other language.

If I enter a multi-line expression into the REPL then go up it goes line by line instead of the whole expression.

Attached: 1450053077726.png (279x301, 134K)

Performance. And "a language that does it better" could damn well be Python already but they're hamstrung by a broken C API they've decided they can never change. It's a fucking tragedy.

>name a language that does it better

Attached: rb.png (959x833, 89K)

it would be easier to list all the flaws than list a single benefit

Mutables are allowed as default parameters to a function. It brings all kinds of retardation and they should either be disallowed or a new instance should be used every execution. Even niggerscript does this well.
def f(x=[]):
x.append(1)
return x

f() # [1]
f() # [1, 1]
f() # [1, 1, 1]

function f(x=[]) {
x.push(1);
return x;
}

f(); // [1]
f(); // [1]
f(); // [1]


>no types
isinstance(1, int) # True
(1).__class__ == int # True
type(1) == int # True

>work for hours trying to troubleshoot a single line of code
>work for several more hours trying to get the damn thing to run

>>no types
Sorry, no type SAFETY

You can type annotate every function and variable if you want. You'll get just as many guarantees as in Java because generic types in it suffer from erasure.

It's slow as shit. Practically every other language is faster.

>You can type annotate every function and variable if you want.
Does anything actually check it? Documentation isn't safety.

mypy can read type annotations and check them.
It's still version 0.x but it has Guido's blessing and has plenty type stubs for known libraries.

def WTF(x: 4/2):
pass
spam.__annotations__
>>>{'x': '2.0'}
def spam (x: 4/0):
pass
spam.__annotations__
>>>{'x':'4 / 0'}

So basically Closure JavaScript. Face it, the language sucks. Too late to fix it. Languages that lack type safety are a mistake.

Slower less readable Ruby

Forced indentation is annoying. The "Pythonic" "ask for forgiveness not for permission" standard of using try/except to catch common errors is bad practice. If you can prevent an exception, you should.Python 3 should be syntactically compatible with Python 2.

You don't understand what safety means.
Type annotations are not a real type system, it's more like a contract system. Meaning that type annotations don't help the interpreter do anything (or compiler if this were a real language), they just enforce type checks.

Traceback (most recent call last):
File "", line 1, in
def spam (x: 4/0): pass
ZeroDivisionError: division by zero

senpai not a single language can protect your from yourself.
int main(void) {
void (*ebin)(void) = (void(*)())0;
ebin();
return 0;
}


Yeah sure, tell me when a mainstream type-safe language without the usual verbosity gets adopted.
Go is crippled, Java has awful type castings as a pattern and C# stopped being vendor locked-in only a couple of years ago.

I know what type safety is, hence I'm pointing out the fact that Java generics are not type safe.
In the end every flexible enough language can be broken. I can show you plenty of examples of Java or C++ code breaking the compiler type safety, which sends us back to the fact you should be not be hiring people that don't stick to conventions to help with your code.

not being ocaml/reasonml

yeah this is annoying as hell HOLY shit it pisses me off so much

>Find a flaw.
too easy


>batteries included
>use shitty autism os package-manger, dependency not there
>accidentally forget to use --user when pip installing, break system
>still have to manually tweak environment to use virtualenv correctly or use tools like pipenv.
>setup.py tier bullshit for packaging and distribution.
>dependency is recorded in something that isn't a fucking setup.py and not something as completely useless as requirements.txt

Im currently learning Django so I have to deal with this shit first hand, cant wait till I learn enough Django that I can move on to better language/framework


>If you do, name a language that does it better.
I wish I could say Ruby as Ruby is an overall better language than Python but block syntax rubs me the wrong way although adding Python-style comprehensions might fix that.

ES6 is has too much baggage from ES5 to make Javascript a contender for general purpose programming

We need new scripting language to replace Python, Ruby and Javascript so maybe Dart? Or these other bleeding edge languages like Nim or Pony

Why does the forced indentation rustle everyone?

/thread

>having to paste a code snippet into a 1000 line code file and then re-indent all those lines in the file for that code to fit in

How about you fork up the money for an actual IDE instead of a shitty text editor you fucking poorfag

A lot of things
C, C++ and Perl

>Copy-pasting a huge snippet in deeply nested code
Holy fuck what an anti-pattern. Something like that should be a separate function with a source in the docstring. No matter the language if your code is nested more than 3 levels you are fucking up somehow.

Just because Java generics get type erased doesn't mean they aren't type safe. The identity of the type parameters are checked at compile time, meaning that violations are caught before the program finishes compiling, REGARDLESS of the fact that they end up erased to Object in the final JVM bytecode.

This is 95% of the truth, there are actual type unsafety problems in Java that are extreme edge cases of tricking the compiler using and null.

All sensible typed languages have "escape latches" that allow you to bypass the type system when you need to. These operations usually come with "proof obligations" that the programmer must satisfy to get defined behavior (e.g. I can coerce these types that I know have the same under-the-hood representation, but coercing the wrong types would result in a segfault or worse) . This doesn't necessarily violate type safety, since if the programmer does everything correctly in these circumstances, we are guarunteed to get defined behavior across the rest of the program.

no

not a flaw

>not a flaw
typical counter-argument of Python user

Attached: 1483502638753.png (769x733, 34K)

It doesn't have strong typing.
OOP is even shittier in Python.

Correct, threading in Python sucks.

This.

Forced indentation is not a bad thing, you should be indenting your code properly anyway so why not use all that whitespace as a syntactic element? If you honestly have a problem with this, it's probably because your code is an unreadable mess in other languages.

>if you can prevent an exception, you should
Exceptions are just that, exceptions. Things that shouldn't happen, but do. Many simply pop up because the user did something unexpected, which needs to be handled. So give him a notification that "i suck dick" isn't a valid integer and let him try again.
Unrelated, but in Pascal I use Exceptions to exit procedures early sometimes, when exit isn't appropriate (leads to problems if the procedure is running in a seperate thread).

>mutables as default parameters are references to the same object
Retarded, I didn't know about that yet.
Your second example doesn't work, push is not a method of the list class.

git gud

>pasting code snippets instead of writing a routine you can just call when you need it
Congratulations, you now have to fix every error several times.
>nesting your code deep enough for this to matter
Do you know what a function definition is?
>can't indent lines easily
(navigate to first line of thing to copypaste)
ko
(navigate to last line of thing to copypaste)
oy{
(navigate to line where you want to paste)
kpqq>}q
Now repeat @q until the thing you pasted is indented correctly.
dd}dd

In a graphical text editor just copypaste, select pasted text, press tab a couple of times. Wow.

>Perl

Lol get the fuck out

What's bad about forced indentation? It's a non-issue if you already write readable code, and forces good habits if you don't.

Broken inheritence

Can't think of a language that does this worse than python.

>What's bad about forced indentation? It's a non-issue if you already write readable code, and forces good habits if you don't.
these are all good points if you sit in your room at moms house and write code, some people need to make a living doing this

>uses whitespace as a language syntactic element
>no-nothing wrong with that you're just unorganized
that shit's retarded and you know it

are you saying that people in the industry don't need readability? I'd argue that forced readability is something that companies would want in a language. it makes the code much more reusable and extensable without having to draw up more style guide rules to force their employees to comply with. Saves company time and resources while maintaining a standard on their code.

Slow as shit. NO REAL CONCURRENCY, you should drop a language without this before you even begin to learn it. Even fucking C pthreads are a better concurrency experience than Python. Dynamic typing, enjoy your runtime exception 24 hours into a data processing script and don't even fucking try to bring up pylint. Adopted by failed academics who can't code for shit. Just go look at their 4000 line global scoped garbage they call ipython notebooks.

>are you saying that people in the industry don't need readability?
no I didnt say that, but if you feel the need to talk on issues I never brought up go right ahead

Attached: index.jpg (215x234, 10K)

What exactly are you saying then?

not him but I'm pretty sure he's saying that breaking your program because of formatting issues is a retarded way to enforce a code standard

Im saying your point that forced indentation is OK if you write readable code is childish and assumes you are only writing tiny scripts for some drag&drop game engine. If you write large amounts of code in a production environment then code gets changed/refactored constantly, so forced indentation is unacceptable

Perl is a better Java, you should try it out sometime. I do have to admit I've never been asked to use it at work or anything, but I do really prefer it over anything elss for personal/freelance projects. I wrote a cash register in Perl for €1000 to be used on an imac, using a loosely encrypted txt file as a database. It took me 4 days to complete and I am going to meet up with another client soon who is going to pay me €6000 to set up 5 imacs on different locations with the same software with some little UI changes.
Admittedly this can be done in any general purpose language but Perl is easy and faster than Java so I opted with that.

linear algebra matlab>>>>>>numpy
plotting matlab >>>>>>matplotlib

it's decent and well-rounded, not the best
only experience I had with it was my first project so I used it very poorly though
if I ever go back to it, I'll try to use more of it's features(and correctly too)

The only proper way to do OO is to go all out on OO. Why are len, map, filter, etc. all global functions instead of methods on collections?

>language that does it better
Ruby.

If you need to make a living, your code will have to be read even more often than the shit you write in your basement, and thus extra emphasis is placed on readability. This includes proper indentation. I'm using Delphi at work right now and indentation is one of the first things that is mentioned in the style guide. I've used Python professionally before my current gig and it's never been an issue.

You didn't provide a single argument besides "you called me bad names". Forced whitespace promotes good readability and clear code structure. There's my argument, let's hear yours.

If your program breaks when trying to format it correctly something is very, very wrong with your programming style and indentation is the least of your worries.

>code gets changed / refactored constantly
How does this affect indentation, exactly? How is changing the indentation level an issue, exactly? You literally press tab (maybe shift+tab to unindent) a few times. Just how deeply do you nest your code that this is an issue?

>If your program breaks when trying to format it correctly something is very, very wrong with your programming style and indentation is the least of your worries.
you either didn't understand my post or purposefully misunderstood it
FFS mixing cosmetics with the model is literally the opposite of any good coding pattern, why would it be good for a PROGRAMMING LANGUAGE

>How does this affect indentation, exactly? How is changing the indentation level an issue, exactly?
really, you dont understand how refactored thousands of lines of code could affect indentation?
>You literally press tab (maybe shift+tab to unindent) a few times. Just how deeply do you nest your code that this is an issue?
youre just being stupid-silly, like hitting tab will indent classes covering hundreds of lines of code?

I have to write in this shitty language for my algorithms class and I can tell you that this is the greatest piece of shit Ive ever worked with. Lets start from the fact that that this is not a properly dynamic programming language and that it is not possible to deallocate stacks for recursion. It has also badly designed OOP and basically it is good only for procedural shit. Moreover the threading fucking sucks. Another thing that I fucking hate is that python3 is not retrocompatible with python2.7 and I found myself submitting assignments that worked on python2.7 but the professor checked them with python3 and of course it didnt work. But the thing I hate the most is how the fuck doo I have to declare a stack size even for fucking tail recursion holy shit like this was a low level language. Lets not talk about the cancerous hipster userbase that literally dont know anything about the language beside "import". To conclude, python does not do better in what it is supposed to be better and it is literally the worse fucking piece of trash I have ever learnt.

-Not strongly typed
-Tab/spaced indentation
-slow

If you want a higher level language, use C# or Java

Significant whitespace and tabs having to be spaces is nigger tier

OK, so you don't know what refactoring is.
>like hitting tab will indent classes covering hundreds of lines of code?
Yes, that's exactly what any IDE or even a graphical text editor will do. And also: In what scenario would you need to indent class definitions, exactly?

Guido did not really invent Python, Python is just a cheap reserection of the ABC programming language to be a scripting language. All the good ideas in Python are taken from ABC which this code snippet shows:
HOW TO RETURN words document:
PUT {} IN collection
FOR line IN document:
FOR word IN split line:
IF word not.in collection:
INSERT word IN collection
RETURN collection


The fact that Python uses Tuples, Lists and Dicts is kind of weird as these container types are more for a functional language, you would expect just arrays and dicts in a scripting language.

Everything about Python is just a unix hack, the built in functions, the (((modules))), its a language designed by a sys admin guy, not a genius sys admin like Larry Wall but your run-of-the-mill bash script guy. Python is just a shit language, its unrepairable, we need to move on to something new.

lets stop here, Im not going to go back and forth with you on what it means to refactor code

It's slow

Literally every other language

You're playing both sides of the fence user. I like you.

too streamlined

Syntax: Ruby.

Really high overhead.

Every single lower level languages do this better.

I like Python, but that doesn't mean I'm blind to its shortcomings.

You still haven't given me an argument on why forced indentation is bad.

Overly dynamic semantics that degrade all kinds of performance, reliability and encourage monkeypatching.
Everything is a statement.
>If you do, name a language that does it better.
Basically everything that isn't ad hoc scripting shit. Hell, even some scripting languages like Wren do that better.

>Your second example doesn't work, push is not a method of the list class.
That was JavaScript, showing how even that junk language can get it right.

Oh I see.

Benefit: noobs can use it without having to know about programming.
Related flaw: programming will never really make sense to noobs, because Python doesn't make sense.

>I like Python, but that doesn't mean I'm blind to its shortcomings.
That's why I like you user. Keep on keepin' on.

>Find a flaw.
having a minimal amount of performance for example

> name a language that does it better.
every other language ever for example

>Overly dynamic semantics that degrade all kinds of performance, reliability and encourage monkeypatching.
If so many people want static typing in a scripting language, why dont more people try Dart? Are people not aware Dart can run in its own VM and not just transpile to JS?

So you would rather have your refactor leave you with code that has fucked up indentation? If your refactors are causing you that issue, the language might not be the problem.

Logistic Regression.
R and Sas

>scripting languages

Idc niggers

MATLAB, is a better language for everything except strings.

>ambiguous dynamically typed language
>used primarily as a teaching language

Learning python will make you a scrub.

Well, user. Ruby is basically Python but better.

Only reason why I dislike it is it's speed. That just means I don't use it where speed matters. Other than that it gets the job done and is simple enough.

Stop.

what's wrong with mutables as default parameters? Is it just that it's easy to forget it's there?

>If so many people want static typing in a scripting language, why dont more people try Dart?
I can think of many reasons, to name some:
- there is an ever-deprecating web advertisement company behind it (although you could argue that at least the team is far more competent than the golang team)
- static typechecking makes a language much bigger in terms of concepts you have to learn before you can get started; unfortunately, it's often not professional software devs in charge but some sillybillys that do use it peripheric at most
- there is an invisible rift between people that use scripting languages and people that embed them. harsh truth is, most host languages (eg. C, C++) are absolutely shit tier in terms of metaprogramming, making it really hard to embed statically type-checked interpreters compared to a Lua or JS interpreter and once you are willing to take the effort you might as well create a proper native or ipc plugin interface or at least embed the JVM or CLR, because they at least have proper IDE support
>Are people not aware Dart can run in its own VM and not just transpile to JS?
Also, this.

As in, where it causes problems?
Search some more on the web, you will find some kinds of initialization checks etc.
Other than that, it's sloppy language/implementation design.

>python has no types

Attached: 1505319529158.jpg (120x125, 3K)

>python doesn't have strong typing
Dynamic typing != weak typing, user.

Python is a good choice to get shit up and running quickly and to "glue" together software written in other languages where performance matters. Of course it's not great for everything, you're literally retarded if you think any single language can be the go-to choice for every single use case.

Not the guy you are responding to, but you could also argue that Python has weak typing due to duck-typing. Basic type conversion checks don't mean everything in a multi-paradigm language, even if it's half-assed.

can't read a fucking TAB must have 4 spacebars...ffs.

>Python is a good choice to get shit up and running quickly and to "glue" together software written in other languages where performance matters.
The problem is that this is equally well possible in an actually well engineered scripting language.

...such as?

I wouldn't call duck typing "weak typing", it's a whole different thing. Duck typing is an inherently dynamic property, you could see it as the dynamically typed equivalent of structural typing (the object you're using is good to use as long as it provides the required fields and methods).
The epitome of static, but weak typing is C: pretty much every field can be manipulated as a number, as long as you place casts where appropriate.

That should be the standard, you moron

Wren, Julia or Lily. But for the actual problem is that Python occupies two or three usage domains half-assed. For some, if not most, you want a fast compiler instead.
I know all that Jazz, but still call duck typing weak typing, because it can be a source of errors and what Python does is the we-tried tier subset of strong typing.
Related to that, structural typing is possibly ambigious (or whatever that fuckretarded word is spelled) typing and shouldn't exist, because everything should be static and explicit and only typelets and writelets disagree.

Pretty much everything.
C, Java, Rust, C#, Scala, Clojure and even Go and C++ are all better

>Flaws
Standard library, language features, development process and tools, performance, language evolution speed
>Language that does these better
C#

The way it does classes and constructors still feels weird and gross years later.

Um, it's slow as fuck compared to lower level langs...

Attached: computer science.jpg (2592x1936, 610K)

>Well, user. shit language is basically shit language but better.

and it comes pre-installed

This is the obvious answer.
Ruby is Python done right.