Python - What's the point
This is mainly aimed at Richohealey, but anyone else can respond
What is the point in Python, it doesn't really have a target audience, I mean their website says
"Python is a dynamic object-oriented programming language that can be used for many kinds of software development.
But what kind of software development can it be used for?
mozzer wrote: This is mainly aimed at Richohealey, but anyone else can respond
What is the point in Python, it doesn't really have a target audience, I mean their website says
"Python is a dynamic object-oriented programming language that can be used for many kinds of software development.
But what kind of software development can it be used for?
C++ is more powerful then python, but I think python is a bit easier to learn.
(I think)
python is usefull at base level, it can be used in the same context as PERL for shell scripting.
it's portable, the same piece of code will run on windows, linux, mac, BSD. (windows they do need to install the interpreter though).
It can be ported, there is py2exe which makes exe's, jython to java iron python to vb, any number more.
it can be used in place of PHP to generate dynamic webpages, and in the course of the playing with it i've done, it seems to be more secure, but i can't really speak on that as yet, cuz i don't really know.
The google algorithm is written in python, so that probably gives you some scope as the speed and power of the language.
There are things i've missed, i'm happy to discuss this anytime
richohealey wrote: python is usefull at base level, it can be used in the same context as PERL for shell scripting. So its for teaching?
it's portable, the same piece of code will run on windows, linux, mac, BSD. (windows they do need to install the interpreter though). So are alot of languages coughjavacough, what makes python better?
It can be ported, there is py2exe which makes exe's, jython to java iron python to vb, any number more. Wouldn't it be better to learn something which is designed to be compiled?
it can be used in place of PHP to generate dynamic webpages, and in the course of the playing with it i've done, it seems to be more secure, but i can't really speak on that as yet, cuz i don't really know. So PHP PWNS PYTHON… FACT! On the security side, it is less secure than PHP, just the coders who use PHP are less inclined toward coding securly
The google algorithm is written in python, so that probably gives you some scope as the speed and power of the language. Which algorithm? Not their search one, that is coded in ASM
There are things i've missed, i'm happy to discuss this anytime
BTW - This isn't just me looking for a chance to slag Python off, I really am interested
Mozzer. Python is built primarily around making code that's easy to read, easy to write and easy to run. The primary niche it has found is in rapid application development. Because of it's very helpful standard library and very light syntax, it is often the quickest way to produce a serious piece of software.
The point of python: Give almost any project to equal teams of equally skilled and funded teams of python and c/c++ programmers. The python project will finish first, 99% of the time.
I think python gets labeled as a 'kid' language because people assume that if something isn't sh*t backwards and hard as hell to learn, it's not worth it. It also gets a bad rep because it's interpreted, while low level compiled languages have always been seen as the 'big kids' of application development.
Google does use a lot of python. Many big names do. An algorithm isn't in any language, it is implemented in a language, and I don't know what language(s) google uses for theirs. There are many new projects with great ideas, coming along nicely, based in python. Zope and Django are two great open source examples.
ya i figured you're not just having a dig at it. check out http://www.python.org/about/quotes/ there are MANY reasons for using python over PHP.
and what i was trying to say (badly) was that python seemed to be more secure. I was trying to code a challenge for this site, and was really struggling to write a script that was vulnerable, apart from just having LFI, RFI which would have been vulnerable in exactly the same way as PHP.
There are plenty of downsides to compiled languages, consider why every application you get for linux comes as source doe that you then compile for your machine? This makes it very difficult to write code for morons. I realise that i'm walking into some comment comparing python users to morons, but hey, 98% of computer users are.
The perl comparison, was pretty much my way of saying that python can aptly replace perl for shell scripting purposes, since it does it just as well, (if not better in some cases) plus the added bonuses of the rest of python.
The final advantage of python, is that anything you can do in C you can do in python. Literally, since you can import a C object and interact with it directly through python, while still operating at C's compiled speed. as they point out on python.org you can code a web server in 3 lines, it's the ability to do things in tiuny amounts of code that is python's beauty,
I'm still learning PHP (well, i'm still learning python in a sense… but you know) atm so i can't comare them, since i don't know all of it's ins and outs.
Jump on MSN if you want,
Given that RoR (ruby on rails) is a framework and not a language, it's not a meaningful question. Comparing Django to RoR would almost make more sense, and I'd have to go with RoR
Comparing plain old ruby to python, in terms of application development time, it'd be really close. I'd highly recommend ruby as a great alternative to python, but personally, I find it's syntax hard to work with.
RoR is a really exciting piece of work though. It's shear speed and power are jaw dropping. Almost enough in itself to entice me to learn ruby.
digitalchameleon wrote: Given that RoR (ruby on rails) is a framework and not a language, it's not a meaningful question. Comparing Django to RoR would almost make more sense, and I'd have to go with RoR
Comparing plain old ruby to python, in terms of application development time, it'd be really close. I'd highly recommend ruby as a great alternative to python, but personally, I find it's syntax hard to work with.
RoR is a really exciting piece of work though. It's shear speed and power are jaw dropping. Almost enough in itself to entice me to learn ruby.
Its syntax is hard? Its as easy as speaking… have you read poignant ruby?
's what I said. Personally, I find it's syntax hard to work with. And yeah I read whys poignent ruby, liked it less than the syntax. Horribly confused document, reads like a bad joke.
Amazingly funny, for you to be such a huge fan of ruby but not of python. They fit in so many of the same places.
Every language has ups and downs, you'll learn that. It's a matter of finding one that works for what you're trying to do.
If you like ruby, and are comfortable with it, I wouldn't recommend that you learn python (blasphemy, rich, I know) You might as well put the effort into learning more ruby since they fit (mostly) the same programming niche anyway.
mozzer wrote: The only problem I have with Python is thinking of ideas for things to code… In PHP I can code loads of webby things and stuff like that… with python whatever I think of I'll code in C
Pardon me for pointing this out, but that's not a problem with python. In PHP, you are limited to writing ONLY webby things and stuff like that. You can do that in python too, just look at apache docs. And why would you ever take something you could do in python and do it instead in c. Assuming you're equally skilled in both, I can't imagine the reasoning.
mozzer wrote: The only problem I have with Python is thinking of ideas for things to code… In PHP I can code loads of webby things and stuff like that… with python whatever I think of I'll code in C
digitalchameleon wrote: Pardon me for pointing this out, but that's not a problem with python. In PHP, you are limited to writing ONLY webby things and stuff like that. You can do that in python too, just look at apache docs. And why would you ever take something you could do in python and do it instead in c. Assuming you're equally skilled in both, I can't imagine the reasoning.
PHP you can only code webby things…. I beg to differ
Why would I take something I can do in python and do it in C? Because normally those kind of things will be complex mathematics sieves where speed is most important C OWNS python for speed
mozzer wrote: Why would I take something I can do in python and do it in C? Because normally those kind of things will be complex mathematics sieves where speed is most important C OWNS python for speed Then doing complex math sieves quickly isn't something you can do in python. What type of math are you doing anyway?
If you're doing really serious math, you'll probably want to do (or at least review) it in ASM.
Python can replace php on apache, very well: http://www.modpython.org/
It can prevent you from having to embed your own script language. http://www.python.org/doc/ext/embedding.html Blender is a good example of this. You write blender scripts in python.
The main use of python, in my opinion is rapid application development. Taking things quickly from idea to prototype to release.
I know you can do non-webby stuff in PHP.
I dunno, but Python's versatility is what does it for me.
I can build a dynamic webpage, create a GUI application, code a server, all without having to change syntax. In FACT it means i can copy and paste code between projects. That can be extended further and share functions and classes just by importing modules i've written. If you want to use something that you wrote in C in a PHP script you need to rewrite it. The hilarious irony is that I can import the C objects and play with them.
richohealey wrote: I know you can do non-webby stuff in PHP.
I dunno, but Python's versatility is what does it for me.
I can build a dynamic webpage, create a GUI application, code a server, all without having to change syntax.
So can I
@digitalchamelean (or however you spell it) - Number one, I do maths not math, and Number 2) I thought about it but ASM takes too long to learn
[edit] Fixed your quote tags ;) [/edit]
ok but how many other peoples machines are the GUI applicatiion going to run on? how many people have a PHP interpreter runnning natively on their machine?
admittedly not a lot of people have the python interpreter on windows, but i'm betting that less people have the PHP one.
oh, and i can write games for new nokia phones ;)
@spyware - Lost? Lost what? I am just trying to find the niche which Python fills
mozzer wrote: @spyware - Lost? Lost what? I am just trying to find the niche which Python fills
You needed two languages (java & c++) to "outpower" python. This itself is enough evidence to tell you that python does fulfill a role in between.
@Spyware: I wasn't seeing this as a win-lose type thing.
@Mozzer: I agree that languages are an each to his own thing. i happen to love Python, it suits my needs and my style very well, if it doesn't work for you then i'm glad you've found something that does. I do still do stuff in other languages, but for hte most part i can do anything i need to with Python.
spyware wrote: Erh, yea. You can use it online, for APPS on pc's (with a GUI), it's usable on some mobile phones and it's pretty much portable. So yea. mozzer wrote: So basically for every task Python performs there is another language which does it better?
No. For easy (quick/small) apps python is god. If you want fast performance you are better off using another language.
richohealey wrote: @Spyware: I wasn't seeing this as a win-lose type thing.
I ment "quit naming other languages that make python useless cause it doesn't work."
Sorry if I confused you ;)
mozzer: Math(s) in ASM isn't hard to learn at all. :| Honestly, your main question in this thread is like any other "language vs language" argument (at least that's what it's been turned into) and there is no definitive answer, but if you're just looking for a list of pros and cons than you would be better off googling for debates on actual programming forums with professional developers. :) If you want an indepth answer however, I suggest you talk to nneonneo over at CS.net since he is a Python coder as well as several other languages (C is just one other example, so he might be able to provide some insight for you as to why you should use Python over C etc.). Good luck with your adventure for knowledge. :p
-Nirucesis
spyware wrote: Erh, yea. You can use it online, for APPS on pc's (with a GUI), it's usable on some mobile phones and it's pretty much portable.
So yea.
mozzer wrote: So basically for every task Python performs there is another language which does it better?
Yeah but I think the point is that you only have to use 1 language to get a fairly decent thing running, as long as it doesn't need to be super-fast or super-specialised.
richohealey wrote: Really? How stable is the compiler? the Python one is certainly functional, but has known to be glitchy at times.
Also how does PHP create GUI's calls to Tk? Yeah, I don't know why it's not well known, it's been around since 2001 and has been used in a fair few projects such as: KateOS, the Package Manager is entirely php-gtk2 You may of heard of the PHP IDE Tulip Editor? that's based on php-gtk And NovaP2P (open source Gnutella client) php-gtk
So far I've not come across any problems with the compilers, the few being Priado, BCompiler and BamBalam For creating GUI's you use the extension PHP-GTK 2, this extension implements language bindings for GTK2 and gives an ooi to GTK2 functions & classes. This makes writing client-side cross-platform GUI applications easier. It has a wrapper for libglade, which allows Glade UI builder to be used in making the php-gtk apps.
Take a look at http://gtk.php.net/ if you're interested.
.|Mals