Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,757 members, 7,824,172 topics. Date: Saturday, 11 May 2024 at 02:28 AM

Python Vs Java - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python Vs Java (19991 Views)

C++ Vs Java (hilarious Gif) / Python Vs Ruby? / Vb vs Java: Which Is Better For Mobile Applications? (2) (3) (4)

(1) (2) (3) (Reply) (Go Down)

Python Vs Java by Nobody: 8:26pm On Jun 23, 2011
A very serious question to all programmers in this forum. PYTHON and JAVA, which do you prefer? I know different languages are suited for different situations but judging from your experiences, which of these do you think is more flexible? Or more efficient? Your candid opinion, pls.
Re: Python Vs Java by Fayimora(m): 10:40pm On Jun 23, 2011
Well to say the truth it really depends on what you want to do. From my point of view as well as stats, Java is the way forward. Its the future,

1 Like

Re: Python Vs Java by Nobody: 12:21am On Jun 24, 2011
In my opinion, python is more flexible in the sense that the syntax and way of doing this is very neat and clear. Java, on the otherhand, is quite "big" in terms of huge libraries or APIs. It is standardised and largely regulated. But this from the industrial point of view. From the my perspective, python gets the job done a lot quicker than java. That being said, java remains the "lingua franca" of the programming colony.
Re: Python Vs Java by Fayimora(m): 2:48pm On Jun 24, 2011
I wouldn't say that because Java has one of the most easiest syntax I have come across. Its super straight forward. I doubt if python can do what Java would. Theres a lot more to Java than you have seen trust me. For me, Java is the best programming language.
Re: Python Vs Java by candylips(m): 5:45pm On Jun 24, 2011
Fayimora:

I wouldn't say that because Java has one of the most easiest syntax I have come across. Its super straight forward. I doubt if python can do what Java would. Theres a lot more to Java than you have seen trust me. For me, Java is the best programming language.

Try an experiment. Write a piece of code in Java and Python compare them and come back and tell us the result.

While Java is awesome(i code in it daily) it  is ageing.

You can do some pretty cool stuff in Python, Scala , Ruby these days . . which can be really painful to do in Java.

Like someone told me recently. Learn a langugue u don't need. It will shape your thinking and make u a better coder

2 Likes

Re: Python Vs Java by Pelumiv(m): 9:55pm On Jun 24, 2011
i think one can one the better language with what they can achieve; i mean their application. What are the applications of java and python? lets hear u
Re: Python Vs Java by Nobody: 10:17pm On Jun 24, 2011
Pelumiv:

i think one can one the better language with what they can achieve; i mean their application. What are the applications of java and python? lets hear u
They can do the same thing but in different ways and concepts. What can be done in java can definitely be done with python. As a matter of fact, python does it in a simpler and more intuitive pattern. Python is more fun than java. Java, on the otherhand, is very strict and strongly typed. For a first approach to programming, i will recommend python to anyone anyday.
Re: Python Vs Java by csharpjava(m): 11:40pm On Jun 24, 2011
Python is used more for web severs and the reason for this is that the codes are executed as you type.
Source: http://academicearth.org/lectures/introduction-to-programming-paradigms-course
Re: Python Vs Java by jacobadam: 7:20am On Jun 25, 2011
I heard about Python from my friend Tom, who is a software engineer. Its a open source programing language for developing applications. I would suggest JAVA, I have seen most of IT Professionals are using java programs for developing internet apps and machine level program.
Re: Python Vs Java by Fayimora(m): 3:01pm On Jun 25, 2011
Cant believe people are actually looking down on java, Hu said java is ageing? Have you seen he new JDK(JDK7), there''s no one like in in any language. It is currently the most widely-adapted programming language for commercial use, despite a sometimes questionable runtime performance. It offers the widest variety in platform choice and powers some of the internet's most pervasive and influential web applications.


Yes python is growing as well but lets face the fact. Java is portable and rapidly growing. When the JDK 8 comes out. I am just going to be feeling sorry for other languages. Today, here in the UK 80% schools use Java as the primary language in teaching programming while the other 20 percent is shared between C and C++. So where is python? A cousin in the US said most schools right now are switching from C/C++ to Java. Java has practically everything a developer can ever want, obviously apat from the 3d game development which still has its API's under construction. Web, software, apps everything. Might be a rumour but I heard apple is soon going to make room for Java apps on iOS, where's python? Android development, RIM development, they are all mostly done in Java. Where's python??

Syntax wise i still dont get why someone would prefer python. For me, the syntax for Java is just the best. Its so natural. All you need do is just know what you want to do and boom!!! you have it done.


The fact remains the same, Java is the present and the future. I wouldn't say python ain't no good language to learn but please if you are new in the developers world, start off with Java. If someone can list 10 significant applications of the python language today in the real world, then I would know it is better.
Re: Python Vs Java by Mobinga: 5:18pm On Jun 25, 2011
Java is the future. cool
Re: Python Vs Java by Fayimora(m): 5:24pm On Jun 25, 2011
Thanks for that!
Re: Python Vs Java by solomon201(m): 10:21pm On Jun 25, 2011
I bet Fayimora can swear by JAVA, if JAVA its d future what is d future of C#?? I'll like to know pls
Re: Python Vs Java by candylips(m): 10:34pm On Jun 25, 2011
Fayimora like i said i code daily in java so i am emotionally attached to it as you do.

but tell me which of this code is easier on the eye

Java
-------

public class HelloWorld
{
    public static void main (String[] args)
    {
        System.out.println("Hello, world!"wink;
    }
}


Python
---

print "Hello, world!"



Java
------
public class Employee
{
    private String myEmployeeName;
    private int    myTaxDeductions = 1;
    private String myMaritalStatus = "single";

    //--------- constructor #1 -------------
    public Employee(String EmployeName)
    {
        this(employeeName, 1);
    }

    //--------- constructor #2 -------------
    public Employee(String EmployeName, int taxDeductions)
    {
       this(employeeName, taxDeductions, "single"wink;
    }

    //--------- constructor #3 -------------
    public Employee(String EmployeName,
           int taxDeductions,
           String maritalStatus)
    {
       this.employeeName    = employeeName;
       this.taxDeductions   = taxDeductions;
       this.maritalStatus   = maritalStatus;
    }


Python
-------

class Employee():

    def __init__(self,
        employeeName
        , taxDeductions=1
        , maritalStatus="single"
        ):

        self.employeeName    = employeeName
        self.taxDeductions   = taxDeductions
        self.maritalStatus   = maritalStatus
Re: Python Vs Java by solomon201(m): 10:37pm On Jun 25, 2011
I love Python syntax, its easy to read n understand
Re: Python Vs Java by Nobody: 11:13pm On Jun 25, 2011
From the inventor of Python, Guido van Rossum

Python programs are generally expected to run slower than Java programs, but they also take much less time to develop. Python programs are typically 3-5 times shorter than equivalent Java programs. This difference can be attributed to Python's built-in high-level data types and its dynamic typing. For example, a Python programmer wastes no time declaring the types of arguments or variables, and Python's powerful polymorphic list and dictionary types, for which rich syntactic support is built straight into the language, find a use in almost every Python program. Because of the run-time typing, Python's run time must work harder than Java's. For example, when evaluating the expression a+b, it must first inspect the objects a and b to find out their type, which is not known at compile time. It then invokes the appropriate addition operation, which may be an overloaded user-defined method. Java, on the other hand, can perform an efficient integer or floating point addition, but requires variable declarations for a and b, and does not allow overloading of the + operator for instances of user-defined classes.

For these reasons, Python is much better suited as a "glue" language, while Java is better characterized as a low-level implementation language. In fact, the two together make an excellent combination. Components can be developed in Java and combined to form applications in Python; Python can also be used to prototype components until their design can be "hardened" in a Java implementation. To support this type of development, a Python implementation written in Java is under development, which allows calling Python code from Java and vice versa. In this implementation, Python source code is translated to Java bytecode (with help from a run-time library to support Python's dynamic semantics).


Source: http://www.python.org/doc/essays/comparisons.html

So, I'd like to ask any of you, if you are writing a software for some consumers, do you choose the one that looks the most beautiful, or the most efficient? And also, what software have you written in either of these two languages that can serve as evidence that your choice is justified?

Re: Python Vs Java by Fayimora(m): 12:03am On Jun 26, 2011
This article does not in any way say that Python is better than Java. To be honest, Nairaland is the only place where I have seen this argument, seen bout 2 on stack but nairaland stands out. Now you are talking about syntax length, that was not my argument. My argument was the simplicity. Java's syntax is FULLY based on real english. Read the convention and you would see what I am talking about. My question still stands, I want a list of 10 top applications of  python in the real world, i.e, something that is widely used.

what software have you written in either of these two languages that can serve as evidence that your choice is justified?
huh?? Can't see the relevance of this question.
Re: Python Vs Java by Fayimora(m): 12:11am On Jun 26, 2011
@candylips, c'mmon you intentionally made that code longer, For your first example you could have just written the println on a line. You went into the scripting part of python, I can also replace it all with <%="Hello World!" %> which is still javatongue , For the second one, might end up being shorter(which i really dnt care about) but y do u have 3 constructors?, lol, Yall shud just accept the fact, Java is still unbeatable,

OFFTOPIC: @candlips you tried JDK7?? Mehn the new Classes and Packages for UI is superb,
Re: Python Vs Java by Nobody: 1:53am On Jun 26, 2011
@ Fayimora
You need to stop jumping to conclusions. I never said Python was better than Java. The article wasn't even meant to say one was better than than the order, it was a comparison that emphasizes the strengths of both languages. For my purposes, I use C++ which is considerably faster than Python and Java. I tend to use Python when I am testing a new algorithm which, in most, if not all, cases, is always faster(not speed of code, but time of implementation) than in C++ or Java. You can't see the relevance of my question, yet, you also asked folks to show you the top 10 top applications of Python. The most useful desktop applications are, arguably, written in C++. Here are some popular programs written in C++.Forgive my sloppiness, but by C++, I mean both C/C++(it is almost impossible to find a pure-C or pure-C++ program, as most developers freely intersperse their codes with C-Style Strings, new, malloc, C++-Style IO, and all other constructs from both languages all in one program)

[list]
[li]Browsers
Mozilla Firefox(C++)
Chrome(C++)
Internet Explorer(C++)
Safari(Obj-C)

[/li]
[li]3D Animation Rendering Suite and Image Manipulation Software
Blender(C++)
Maya(C++)
3DStudio(C++)
Adobe Photoshop(C++)
GIMP(All in C++; plugins can be written in Python, Perl, and Scheme)

[/li]

[li]Operating Systems
GNU/Linux(Mostly C++, some assembly, and some scripting).
Windows(C++, some assembly),
OSX(Obj-C, some assembly)

[/li]

[li]Servers:
World's most popular and used server: Apache(C++)
IIS(C++)
nginx(C++) one of the fastest, lightweight servers in the world. It powers Youtube, and even, Nairaland grin

[/li]

[li]Compilers
C++ (C++) Yes C++ was written in C++(however, the first iterations were written in C, and subsequent versions were written in C++(bootstrapping). Look up any textbook on compiler construction to understand language bootstrapping.)
Python (The most used version CPython was written in C++)
Java Virtua Machine (C/C++),
The Java Compiler(C++? No, javac was written in java)
PHP(C++)
Perl(C++)
. . . . . . .
Most languages were actually written in C++, so the point is moot.

[/li]

[li]Video Games:
I can write a 200-page article on this.
Xbox, Xbox 360, Playstation, Playstation 3's development kits are all written in C++. You can also write games for the 360 using C# and the XNA Development kit from Microsoft. However, you are limited in what you can do.
Android OS, Java is the king and it is mostly used to write all the games. I am trying not to go into too much theory here, but if you are a serious game developer, you will never go near a language that does automatic garbage collector since it is of utmost importance that you manage memory yourself; otherwise, the technologies you can implement will be limited. Of course, if you are looking to create AAA games, your best best is always PC, PS3, 360, and the upcoming Wii-U, which I completely detest. I hope I haven't derailed this thread with my ramblings.

[/li]

[/list]

All notable video editing software are also written in C++. I am not saying that C++ is the best language but as a GNU/Linux user and as an aspiring game developer, I spend most of my time using a lot of these applications(which I have the source code to, except for the Apple and Windows ones, of course grin) and C++ is king on the desktop. If you do not believe me, compare all the software---written in Java or Python or some other language---that you use to the ones written in C++ and you'd be surprised. Now when it comes to web applications, my knowledge is severely limited; however, I concede that C++ is not significantly, if at all it is, in use in that aspect, so I'll leave it to others to show us what their language(s) can do(lest I make a fool out of myself), especially by showing us the programs(written in these languages) that they use. Remember, this is not a declaration of war on your language!
Re: Python Vs Java by Fayimora(m): 2:23am On Jun 26, 2011
Hahaha i like your reply,  Jumping into conclusions, errm yeah i  would say am sometimes a victim of that(when i start enjoying the conversation). However, you left python to backup C/C++, lolzz.those languages are old so almost everything was built with them, JVM inclusive. Sad enough I havent had time to perfect ma skills in c/c++ but am brilliant with obj-c(only cause i had to for ios). OK to end the funny discussion and not confuse the OP, do you agree that java is the future?

btw you forgot the almighty UDK  wink

P.S,
OFFTOPIC: HOw do you survive GUI with c++? Isin't it stressful?sad
also i just pm'd you
Re: Python Vs Java by Fayimora(m): 2:36am On Jun 26, 2011
I think most people tend to dive into flash/flex development for web-apps. Some still use asp.NET and also Java again. For java you can do it in 2 different ways. Its either you do it the JSP way or you write an applet. Nice isin't it?.lol Would populate a list(God knows wen) and send it to you,

However i think it depends on the type of application you want to develop and also your previous skills(what language you already know how to use)
Re: Python Vs Java by Nobody: 3:03am On Jun 26, 2011
Oh yeah. I just saw your PM. I tried to reply but I don't think that I can. Maybe I just don't know how. I am usually on Linux, so I had to switch to Windows to add you and just as I was about to, your previously visible yahoo ID vanished. Anyways, my ID is omo_to_dun@yahoo.com.

Yes, the almighty Unreal Development Kit! The creator---Tim Sweeney---is a motherf**king beast. The guy gave a talk at Princeton some months ago, and all my doubts as to whether some folks are really that good or all hype(you know folks like Stallman, Torvalds, Carmack etc) were forever allayed and I was completely blown away. That man is on another level!

GUI with C++  grin
My brother, in most cases, we don't have a choice. I took a course last year named Contemporary Graphics Research where we had to implement current Graphics technologies in C++ and demonstrate our results in a GUI. These technologies were mostly in the form of theses written by PhD Students and Professors. On average, it took me about three days to understand one page(no exaggeration). This papers were condense, coarse, and filled with mathematical jargon of the highest order. Then since we were forced to use Linux, you had to use GTK+ or Qt. These packages are fast, extremely fast, but the learning curve is not only steep, you can barely write a fully functional program without crashing something. Our professor was always laughing his [i]a[/i]ss off whenever someone was giving a presentation and BAM 'segmentation error" or my favorite: "dumping memory core at 0xFF456466 to /dev/null"  grin. Since I plan to specialize in Graphics, I cannot escape from C++. All, yes all, our graphics textbook assume you are a C++ guru and they just jump straight to templates, virtual memory, caching, smart pointers and the rest. So I guess after a while, you get used to it.
Re: Python Vs Java by Fayimora(m): 3:22am On Jun 26, 2011
Hahahhaa yeah I know,  UDK is a beast but I dont use it cause I mainly use a mac. Tired of windows and Unity is super good, c++ built i think aswell. Just bout 3 steps behind UDK,  Am currently undergoing some tuts and mehn when am done, hahaha, reserve ma comments,

GUI with c++ is hell,  To be honest thats the reason I stopped c++ so am just on intermediate level in c++. I bet you cant do something like this in c++ except you have your brain death warrant signed, lmao. I built this in about 4-5 days in java. Spent 2-3 hours everyday so in total 10-11hrs.
Re: Python Vs Java by netghost: 2:54pm On Jun 26, 2011
@Fayimora, u never seize to amuse me grin grin

@Poster, stop all this pointless language comparism and settle for the one your brain can carry,the only question i can ask you is .WHAT DO YOU WANT TO DO WITH THE LANGUAGE?
If python works, then go with it, if its java go ahead, get books and start reading, spend more time asking for solutions to programming problems than language comparism, cos it will take you no where ?
lipsrsealed
Re: Python Vs Java by Nobody: 5:04pm On Jun 26, 2011
netghost:

@Fayimora, u never seize to amuse me grin grin

@Poster, stop all this pointless language comparism and settle for the one your brain can carry,the only question i can ask you is .WHAT DO YOU WANT TO DO WITH THE LANGUAGE?
If python works, then go with it, if its java go ahead, get books and start reading, spend more time asking for solutions to programming problems than language comparism, cos it will take you no where ?
lipsrsealed
If you read the post correctly, I said different languages are suited for different situations. What is wrong in knowing if my next app will scale in Java than Python? I don't intend to cause a language war. As a matter of fact, I use Python framework called Django for web applications and Java for anything else. Thanks.
Re: Python Vs Java by Fayimora(m): 5:19pm On Jun 26, 2011
netghost:

@Fayimora, u never seize to amuse me grin grin

lolzz wah dd i do this time around, ?
Re: Python Vs Java by netghost: 8:27pm On Jun 26, 2011
Fayimora:

I bet you cant do something like this in c++ except you have your brain death warrant signed,

ROTFLMAO
Re: Python Vs Java by Fayimora(m): 8:31pm On Jun 26, 2011
netghost:

ROTFLMAO

LMAOOO, yeah its the truth, Most c/c++ programmers run away from creating GUI's not to talk about graphics and motion, quite fast for a lang, nice way to manage memory but you just end up with text based UI's, lolzz
Re: Python Vs Java by netghost: 8:39pm On Jun 26, 2011
i have never been a big fan of c++
Re: Python Vs Java by csharpjava(m): 8:51pm On Jun 26, 2011
How many of you here saying Java is best for games development is a Computer games programming lecturer in a UK University? All the universities I know in the UK are using C++ to tech games programming and at every stage in the development of the course these universities do consult with industry to ensure they develop the students with skills the industry needs for games development.
Companies like Sony will not employ someone that has learnt games programming from a book rather they will employ a games programming graduate from a UK university or similar universities in the world.
I'm tired of reading baby stuff on this forum.
Re: Python Vs Java by Fayimora(m): 9:11pm On Jun 26, 2011
csharpjava:

How many of you here saying Java is best for games development
Errm that would be no one!

csharpjava:

at every stage in the development of the course these universities do consult with industry to ensure they develop the students with skills the industry needs for games development.
Errm doesn't make sense! All they teach you is how to program, analyze, design and not how to develop games. That part is up to you and there are specific courses/modules for that,
csharpjava:

Companies like Sony will not employ someone that has learnt games programming from a book rather they will employ a games programming graduate from a UK university or similar university in the world.
Totally disagree. I knw a second year student, CS, and has done nothing related to game programming before and he is working with UBISoft presently,  :p DOn't forget that you must not have experience in game programming to be able to develop one. Fragments of sooo many other things make up the game.

csharpjava:

I'm tired of ready baby stuff on this forum.
Haha if i actually understand what you mean by that then i wonder why you are on the forum itself.
Re: Python Vs Java by csharpjava(m): 9:24pm On Jun 26, 2011
Haha if i actually understand what you mean by that then i wonder why you are on the forum itself.
You are right I'm on the wrong forum. Well I have completed my own forum, where I will now be devoting all the time I have been spending here grin

(1) (2) (3) (Reply)

Few Questions About Aptech Computer Institute??? / Let's Stop Talking About Password Strength / Is It Late To Start Learning Programming @ 28 Years?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 81
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.