Does /gee/ like python?

...

Other urls found in this thread:

amberbit.com/blog/2014/6/12/calling-c-cpp-from-ruby/
youtube.com/watch?v=OSGv2VnC0go
twitter.com/AnonBabble

'hello world'

I have no formal training with python, so I don't know that much about python.
It is relatively fast for a scripting language and scripting languages allow for fast development, so I can see the need.

I often see python being recommended as a beginners language and I couldn't disagree more with this statement.
Beginners is better off using a compiled language where they would be beaten into submission by compiler warnings.

The only reason i believe in backend development.

>good career prospect
>easy
>can do almost anything, albeit not the best for anything
>i can do hobby game development in Godot engine because their language is so close to python
>goes well with linux jobs, which I have

I might never learn anything else, to be honest. I'm the kind of guy who wants to get the job done so he can be outside with his well earned loads-of-money and enjoy first world country lifestyle. Anyone arguing about language choice can do me a favour and take the discussion to someone who cares. I do IT for a living and happen to like it, not because I feel that it is the most crucial aspect of my life.

Python wasn't my first language, but it took no time at all learning it. It's a great starting language for beginners since it's so simplistic.

Personally, I found it a bit too simplistic to use myself. I would sometimes runs minor errors all over since I'm so used to programming with Java and C++.

I started with Python 2.3 or 2.4. Use it for stuff like crawlers, data cleaning, automation, etc. Works pretty well, is simple and fast. I like it

...

It literally says "than" right there in the highlighted section but the fucktard who made this still couldn't spell it.

""""""""""pythonic""""""""""

no

It's a great scripting language, with the ability to insert pieces of C if you need something a bit more raw.

How does that work exactly? Does python natively support importing C libraries?

Everything wrong with the IT industry,people.
I've never met you but damn, I already dislike you

Python is a great scripting language but should not be used for "real" programming. When I need a small script or tool to do something I'm happy if it's written in Python however as a Gentoo user it makes me reeeeeeeeee that my package manager is written in Python.

You need to specifically write the C so that python can understand it, so no.

This.

No

And once more:
Ruby is Python done right..

>amberbit.com/blog/2014/6/12/calling-c-cpp-from-ruby/

When will Pythonistard ever learn..

What makes you say that? What's the difference between a "scripting" and a "programming" language?

>I might never learn anything else, to be honest.
You see, you were making good points and then you fucked it up. Why would anyone ever even admit to this?

Traditionally, interpreter vs compiler, although that line tends to get blurry nowadays with languages like JS.

>P-Python's stupid and slow. I-it's not like I like it, or anything.
Sup Forums's so tsundere for Python it's embarrasing.

I like to spend time with your mom.

You can use the ctypes module to call a c library from python.

>end
>end
>end
>end

It's good until you need to make something larger than a script

He's an autistic moron if he's complaining about a package manager not being written in assembly.

Love it desu.

Slow as fuck and inconsistent API.

ofcourse Sup Forums likes it

>whitespace
>whitespace
>whitespace
>whitespace

I like Python a lot. At work we don't use it much outside of small scripts, because its dynamic typing makes it a massive pain to manage in a large project with lots of people. That said, in personal projects it's great, and a lot of my personal things are in Python.

>C code
>takes advantage of garbage collection
stopped reading there

It's ok but nowhere near as useful and beautiful as Bash..

>My thoughts are reasonable
>I am both plastic and totally fairweather. You'd be right in thinking me Summer and I have not the slightest problem with being the cancer that kills Sup Forums

Actually quite good b8

Perfect for small scripts.
Perfect as C/C++ wrapper for high level stuff.

What's not to love.

The sentence was "It takes advantage of pre compilation, better garbage collection or static typing."

If you read further, you will notice that they are discussing serveral methods, it's a difference to access C classes via an interface or embed C code.

Also I didn't want to advertise the writing skills of the website creator, I just wanted to show you how great Ruby is.


Funfact:
Python was written as replacement for bash.

not an argument

There are a lot of problems with Python, but overall it's a solid language that can get simple tasks done. What a lot of people use as an argument for Python is "X library is available for Python and not [other language]", which is a completely invalid argument which says nothing about the language itself.

So, ignoring the libraries, how is Python? Not great.
The OO system really just shouldn't have been added. It's a complete mess. Double underscore names like __init__ are just cancerous. Passing self into functions is utterly stupid and needless. Member declarations happening on the fly is just asking for hard-to-track errors. Double underscore prefixes for private members is laughable.
Variable declarations need to be distinguishable from assignments.
Forced indentation only works for teaching beginners to make their code not look like ass, but it becomes an aggravation when you want to make something look nicer using multiple lines.
Regular expressions could be much more well-integrated, considering it's a scripting language. Look at Perl. As it stands, there's a lot of unnecessary code just to do simple regex tasks.
It's fast enough for many applications but you will see performance degrade as you try to scale it up too much.

Basically, if you want to learn it to use the libraries, go ahead. If you want to learn it as your first language, go ahead (but don't let too much stick). Otherwise, move on to another language more suitable for your own specialization.

Python would be incredibly shitty replacement for a Bash shell..

Agree, it was the first language I learnt and although I enjoy using it on the whole, little things like you mentioned start to stack up after continued use. After my current project is done I'll be looking for something else to learn most likely.

what's the matter user don't you love this smug fuck

youtube.com/watch?v=OSGv2VnC0go

Xx__init__xX

Hey bro I heard you like self don't worry I got you

self.response.update(self.query_database(self.message))

I actually like the simplified but yet powerful OO side of Python.
Of course, not fully and strongly OO, but it's nice to have that "infrastructure" to play with.

But yeah, fuck 'self'

Python fans.

I totally disagree with python being simplistic or lacking power. It's syntax superficially reads like natural in some respects, but in this respect python is a wolf in sheep's clothing.

In reality, the language has an extremely sophisticated object model and is highly customizable and powerful. However, accessing these features requires a fairly good understanding of the language, and many python users only ever learn the basics, since those are good enough to get you up and running.

The only real problem with python is that it's too easy to learn a small part of it and live on completely ignorant of the underlying power.

Also, I guess some people don't like the available complexity, like this guy:

My point was I don't want any "real" programs written in an interpreted language. If a language is interpreted then it's only good for scripting in my view.

That's fair if you really need the performance of a compiled language. Keep in mind though, that many server applications have no problems running via a python interpreter, and python is often incorporated into high-performance programs as a scripting language (the civilization games use it, for example).

I'm not really sure I know what you mean by "real" programs but I hope this clears up my opinion

you can compile python

1. Forced whitespace is good for readability
2. If you're not already tabbing out your code properly, you should probably kill yourself.

In practice, it isn't really a replacement for it, but it's something you can use over the top of it to do more things more easily.

can I make bideo games with python?

yes

>The OO system really just shouldn't have been added.
The ignorance and stupidity of this statement is incredible. Everything is an object in python. Saying that the language shouldn't be object oriented would literally remove the whole language.

Then you read beyond it and it's mostly just intellectually bereft shit like "I don't like double underscores", "let me write shitty looking code without indentation" etc

>good career prospect
kek'd

It's the retarded child of Visual BASIC, a dumb language for noobs.

I love the simplicity of python. Its easy for my dumb monkey brain to understand.

this

python works for 95% of my web projects and the libs mate, the libs

I do Java on the side to make myself employable but damn I don't see the point

I absolutely despise this argument. A programming language should never incorporate indentation as part of syntax. ridiculous insanity.

>2. If you're not already tabbing out your code properly, you should probably kill yourself.
> properly

so python gets to decide "properly"? My code is clean, neat, and indented the way i like it. Fuck python for no other reason than the forced indentation.

The language could easily work without objects. Plenty of other languages have gotten by just fine without objects. Maybe it would make more sense if user-defined classes were not so cancerous. Hell, it'd be better if user-defined objects just didn't exist and the OO was "use but not write"

No it couldn't because everything is an object. Are you too fucking dumb to understand that simple concept. It's fundamental to the language's design.

>Maybe it would make more sense if user-defined classes were not so cancerous
How exactly are they "cancerous"? And don't say "I don't like having to type self or init with some underscores". Those aren't valid criticisms.

>A programming language should never incorporate indentation as part of syntax.
Explain why, beyond arguing that you just don't like it.

No one used Ruby in a production setting.

Ahem.

theoretically you can do anything written in anything

Ruby is dying and disappear once rails is finally dead. Python is only growing in popularity.

What do you is the most suitable editor for python?

>ridiculous insanity.
why?

>can't override methods
>can't overload methods
>EVERYTHING about objects is implicit EXCEPT for constructors/inheritance for some fucking reason

Yeah that's a pretty shoddy implementation of OOP. It's basically my only complaint about python. Other than that it is god-tier.

I use eclipse but it doesn't work as smooth as it does for Java. Often can't even find methods of imports for whatever reason

PyCharm or bust

how would you override a method without differentiating the types of arguments supplied?

You're not exactly thinking there, are ya, bud?
What he's saying is the language could have been done without making everything an object. Of course it wouldn't make sense to just remove everything object-oriented, but it can all be replaced.

*overload

I work in datashit and Python is okay. It's a just werks language for me.
I actually prefer R for pure data analysis and I really like Ruby's syntax, but I at work we usually end up using Python because it's kind of a middle road. Ruby has literallywho data libraries and R sometimes doesn't have as well-supported APIs (e.g. elasticsearch).

It's usable (for an interpreted language), but there are so many annoying things about it.
>self everywhere
>__fucking_why__
>no way to define class instance fields except in __init__
>meaningful whitespace sometimes forces you to write things that look bad
>the colon is required everywhere, even though it's meaningless
>no multiline lambdas as a "design choice", because a dynamic language apparently should have shittier lambdas than fucking C++
>no way of distinguishing declaration from assignment, so typos may produce really hard to find errors
>apparently nobody who makes python libraries heard of enums, so pretty much all of them, even the most prominent ones, use strings instead (which forces you to look at the documentation every time you forget the exact spelling and is prone to typos) - this one is not really the language's fault, but it attracts morons
>the whole python 2 vs python 3, and also nothing in the scripts clearly indicates python version
>pip is a fucking piece of shit and like half of the time I try to install a library with it, it throws billion errors and I have to install some older version with conda
>no way to easily just include all dependencies, so everyone who wants to run your program has to install all those libraries in the exact version that you used, or pray that the script won't shit itself because of version incompatibility

PTVS

It's not the most powerful language tho.

Python is worth learning for scikit learn alone

It would involve ripping out the innards of how it's designed and replacing everything from the ground up. It would have little benefit, and cripple what the language is capable of.

>no way to define class instance fields except the way you're supposed to define class instance fields
ok, junior.

Most of what I do at work, either day-to-day or operation kind of stuff is in python, so, yes.

>no way to define class instance fields except in __init__
What? You can do that from any method within your instantiated object.

There are some valid criticisms of Python, but the ones in this thread are downright retarded.

Care to elaborate?

>programming language is literally pseudocode
What's not to like ?

>putting spaces between the words you type

Ishouldbeable to ty pehoweveri likefuckeng lish and forced spaces

Self as a reference to the class communicates to the reader what's being used by each method and staticmethods can be defined if there are no references. Double underscores aren't bad, but the lack of proper private methods is frustrating personally.

Lambdas, map and filter are rarely encouraged in python.

Declaration/assignment can be an issue although a good linter will pick up on it.

Could you explain how libraries using your args (I assume) in an enum would make things easier? I agree python doesn't teach enums particularly well though.

Agree with 2v3 and pip can be frustrating at times. It can install from file so if you have a virtual environment you can pip freeze > requirements.txt, else manually populate the file.

Aside from the fact that it lacks switch/case it's not that bad.

Okay
>The OO system really just shouldn't have been added.
OO is fundamental to Python and has been since the very beginning.
>Double underscore names like __init__ are just cancerous... Double underscore prefixes for private members is laughable.
They're _very_ useful as a form of namespacing. They may seem ugly, but in the absence of true private methods they actually help code readability by providing a visual marker for object 'internals'.
As for why Python doesn't support true privacy, it's a matter of principle ("we're all consenting adults").
>Passing self into functions is utterly stupid and needless.
The explicitness is good for readability, it makes decorators possible and allows you to assign functions to an instance and have them instantly work as a method.
>Member declarations happening on the fly is just asking for hard-to-track errors.
Nature of a dynamic language, and very useful.
>Variable declarations need to be distinguishable from assignments.
Again, nature of dynamic language. There's little point declaring a variable without a type.
>Forced indentation only works for teaching beginners to make their code not look like ass, but it becomes an aggravation when you want to make something look nicer using multiple lines.
The former vastly outweighs the latter, and it applies to people of all skills. Uniform indentation across the whole language base makes it all much more readable. Also, you can indent more freely than you think, you're probably not aware of how often there is implicit line continuation.
>It's fast enough for many applications but you will see performance degrade as you try to scale it up too much.
This is probably the most valid complaint for pure Python applications, but it's generally easy to drop to C for bottlenecks, or use a faster language (e.g. Go) for specific tasks.
>My code is clean, neat, and indented the way i like it.
You're not the only one who has to read your code.

>can't override methods
Yes you can...
>>can't overload methods
How do you overload functions in a dynamic language anyway?
>>EVERYTHING about objects is implicit EXCEPT for constructors/inheritance for some fucking reason
What?
>>no way to define class instance fields except in __init__
Plain wrong.
>the colon is required everywhere, even though it's meaningless
It's meaningful to the interpreter.
>no multiline lambdas as a "design choice", because a dynamic language apparently should have shittier lambdas than fucking C++
Fair, I disagree with Guido on this one.
>the whole python 2 vs python 3, and also nothing in the scripts clearly indicates python version
It's the fault of the Python 2 community, Python 3 is far better.
>pip is a fucking piece of shit and like half of the time I try to install a library with it, it throws billion errors and I have to install some older version with conda
I've never had issue with it.
>no way to easily just include all dependencies, so everyone who wants to run your program has to install all those libraries in the exact version that you used, or pray that the script won't shit itself because of version incompatibility
Wheels.

>the lack of proper private methods is frustrating personally.
How come?
Most (but certainly not all) use cases can be achieved more nicely with a dict

...

"There is preferably one (and only one) way to do it."

poop = "pythonic"

print(f"Is my code {poop}, senpai?")
print("Is my code {poop}, senpai?".format(**locals()))
print("Is my code {}, senpai?".format(poop))
print("Is my code {poop}, senpai?".format(poop=poop))
print("Is my code %s, senpai?" % (poop, ))
print("Is my code %(poop)s, senpai?" % {"poop": poop})

>How come?
Mostly if it's a public API and I want to communicate what methods can and can't be called. I know you can make it more difficult by using double underscores but it would be nice if you could wrap it in a proper private decorator or something.

I also love using dicts as switches although it's not quite the same.

mfw

But the whole point of _attr/__attr is that, since the original code writer can't guarantee that the attribute/method isn't of some use to somebody in the future, why not allow them access if they _really_ want it?

what a douchebag normie

While it's true, that all of the lines are giving the same result, it's like saying that if 2+2=4 and 2*2=4, then one of them is obsolete.
Each of the methods has its own use cases and pros and cons.

this
too bad you can't actually get employed in Lua