Should I Learn Java or Python?

preview_player
Показать описание
Which computer programming system is better? Which one will help me get the best employment and jobs? Is one programming language more useful than the other?

I want to learn programming to be able to get a decent job. Should I learn Java or Python?

If you already know C++, Java is easy to learn. And if you know Java, you'll be able to pick up C++ and C# easily, which is used to write many mainframe applications.

I don't know C in any form.

Java is easy to understand. And Java has plenty of documentation and online forums to handle any question you may have.

Is Java easier to learn?

Python is often considered easier to learn from a coding perspective, but it is easier to understand the logic of someone else's Java code.

Why is that?

Java requires you to define variables up front, so later programmers know exactly what each variable represents. Python uses dynamic typing, allowing you to change variables, and even its variable type.

What is the market for Java programmers relative to Python programmers?

Java is used in far more applications than Python. Java is the standard language for Android apps.

I've heard of both languages being used in programming or building applications.

If someone has already written an application in C, Python can be used to build an interface. You can even invoke legacy C code from within Python.

What is used more often for writing new software applications?

Python is not as complex as Java. You can typically build new software applications more quickly in Python than you can in Java.

Why is that?

Python is good for rapid software development. Python applications are 20% to 30% of the length of a comparable Java application, so the code even runs faster.

It sounds like I should learn Python.

Java and Python are not mutually exclusive. JPype lets Python programs access to Java class libraries. Jython is a form of the Python programming language that is written in Java.

Could I just learn both?

Absolutely. Then you'll have twice as many opportunities than if you put yourself in a niche.
Рекомендации по теме
Комментарии
Автор

I came here, not to watch the video, but to just give my advice.
If you haven't programmed before, i would use Python 100% until you've become experienced in coding. start by making simple games like snake or something.

Python is much simpler than Java to understand at first. Java has things you wont understand why you need to add to your code. Python's syntax is just so efficient. Even if you learn Java/C++, Python is very handy to have to quickly solve things.
Python makes you understand programming so effortlessly. It handles all the more complex things itself so you don't have to worry. You can just do the pure programming with ultimate freedom.

I can write a program right here for example.


you = int(input('What is your age?'))
friend = int(input('What is your friends age?'))

if you > friend: print('You are older than your friend')
elif you < friend: print('You are younger than your friend')
else: print('You are the same age as your friend')


That is just an example to hopefully show how you simple the program is to use.
After i learned the basic syntax, i moved straight on to using Pygame which is for drawing on a window which you can make games with.

If you are ready to start learning how to program, here are the steps you should take:
2. Watch a video to get you started with how Python works.
3. Look at some short example programs to get you started.

When you know the basics, here is a site you can download everything Python has to offer.
You don't want to forget this link. You'll find anything you'll ever need which you may not find anywhere else with Google.

The package you should download is Pygame.
Download the latest version.


On the official Pygame website you can download other peoples programs which could be a game or app. You can also learn how to use Pygame from there and there are examples of how to use the code you learn too!

Here is a short blank program i just wrote to start you off making a game:


import pygame, sys

pygame.init()
Title")
screen = pygame.display.set_mode((300, 300))
white = (255, 255, 255)

while True:
    screen.fill(white)
    pygame.display.flip()
    pygame.time.Clock().tick(60)
    if pygame.quit(); sys.exit()


I think you can see how it works. it's practically pseudo code.

We create a window which is 300x300 and is filled with the RGB color white.

The code below the "while True" is what runs the game (program).
All it's doing is:
1. filling the screen white
2. updating the screen (you render an entire frame then upload the finished product to the display)
3. limiting the game loop to only run 60 times per second (60fps)
4. checking if the user clicks the red exit button on the window, then quits the game.

This is the main stuff, but then you can add code to draw shapes and sprites and after learning from other peoples code, you'll figure out how to make a game. The first game i made was pong.

All you need to do is draw paddles on each side of the screen and a block which bounces around.
And you will need to know how to get input from your keyboard to move the paddles.
Look on YouTube for a tutorial, or look for somebody else's code on the internet to learn how it works.

Once you just start, you'll enjoy doing this.
Reading all this may of been boring, but programming isn't. I'm sure that's why you're probably looking how to program.

DlcEnergy
Автор

"The [python] code is shorter so it runs faster". ROFL. What utter nonsense.

sylnsr
Автор

I'll be over here dying from "C Hash"

hondacivet
Автор

that nigga got all the info he wanted and just dipped 😂

EmXtraMoney
Автор

if you want a job in programming, you'll probably need to learn both for the same reason
you'll need to start grasping how the operating system works.
I think that they're both very easy to learn (relatively).
java and python are both quite 'distant' from the computer.

if you are really new to programming,
deciding on which one to learn first most likely depends on your personality,
I learned java in and from highschool, and I learned python a bit later.
if you are more strict on everything that relates to organization, java is probably nicer to begin with.
if you are more laid back and just want to see your computer does stuff he's told, after very short/quick code, you'll
like python.

The reasons for that, I think, are that python and java are fundamentally different in the way that,
java requires you to be specific on what you want to write,
while python strives to be as similar to the human language as possible, while providing
an easy to access interface.
, if you know both of those languages, then you probably understand what I'm talking about
but that's not all to consider when you want to start learning to code.

now, the things people do with those different languages are also fundamental,
1) java and c#
now, first let me say that from the perspective of someone who is new to programming, the differences
in java and c# look so small, that from knowing java, you can even without reading
any tutorial - directly write c# code.
c# was also, at it's beginning was practically called java.
java and c# are used for making game platforms, for one,
for mobile applications programming - creating apps (so if you really want to start
learning code by making apps or minecraft mods, you can)
and basically, building constructed and detailed stuff.
the reason people use those very similar languages for different thing, is
the same reason we have ios and android,
you can also almost 'see' the soul of a corporation within c#.

2)python and languages like ruby and javascript
(note: java doesn't equal to javascript, it's completely different)
now, there are a few differences between those, unlike
c# and java, but they feel the same, learning how to code with one is like learning with the
other, leaving small details.
javascript is only for web applications,
i didn't learn ruby, however, I started on it and got a first impression it's very similar.
python is also used for scientific calculations, etc.
basically, stuff that you don't run over and over again in the background and don't want to code them for
too of a long time.
the reason for that is that those languages basically ignore the need for quick
programs - which can only be achieved by giving more details about the roads the computer should take,
giving you, instead easy to write code, and easy to run.
(think about it, if you want to go from point A to point B, you can either detail the fastest road by examining
the specific situation, or by building some predefined path you'll use on every point A and B)
If you study physics or stuff like that, and you want to learn programming
because you think it'll just make life easier for you(coding) - go with python.
you can (and should) also build games with python, there are many tutorials over the internet that
help you to do so.
I also watched a guy building a backdoor for about half an hour, tool him not to long for a fully detailed backdoor.
If you don't think you'll work with python, it's anyways useful, because there
definitely are personal uses for it, I use it every time I want to simply code stuff.
Of course, you'll have advantages when trying to learn other programming languages,
and you also got to the one you liked to use more first.
You can also use python to tie things up together more conveniently.

3)languages that are 'close' to the computer
now, if you want to start doing stuff that are more related to hardware,
forcing you to 'get closer' to the computer,
or that you just want to start with a clearer understanding of how computers work,
learn c or c++, basic or even assembly (you should know this language if you
did something like electrical engineering)
while c and c++ are a bit harder to grasp, I found myself having a lot of difficulties understanding
the way the computer works, however , learning this language right off the bat will
prove a much larger challenge than if you'd lean something like java or python.
you should also learn c and c++ just for the fun of it.
notice that BASIC is almost outdated.

Last thing to consider, if you start programming and you want to get an understanding of the computer
notice, that while python simplifies things for you, it's also not revealing you to inner processes it makes to
operate, while java is a bit more opened in that perspective.
And those are basically (in my opinion) what you should think about when choosing which one to learn first.

deusvult
Автор

How to know that you should click off a tutorial: the person calls C# (c sharp) c hash.

awabqureshi
Автор

I'm using Java for 2 years and I find myself advanced user of Java. It's a very powerful language. Today I started to learn Python, and I was like This is easy peasy."

SilveraStarbreeze
Автор

Why would ANYONE wanna start learning programming with Java??
Public Static Int Void Main? Nope, ignore all that, first you gotta write stuff you don't understand to hopefully get to something you can understand one day.

Here is a program in Python:

print("Hello World")   

Exdus
Автор

Hello world in Java:
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
Hello world in Python:
print ("Hello World!")

Defining a variable in Java:
int blo = 2;

Defining a variable in Python:
blo = 2

thegameplayer
Автор

This is a poor concept for a video. This is an apples to oranges comparison. Python is a scripting language and Java is a statically-typed language that runs in a VM. You can run Python in Java (Jython) and there are things you can do with one that would be extremely difficult to do in the other (works both ways). Really people should learn both based on the current jobs market, and to that note, this question is really answered by what kind of a Job one is looking for. I'm tired of hearing people ask about "programming jobs" when that refers to probably 100 different field applications.

rufuguru
Автор

As someone that started programming with python and then continued with java here is my opinion:
Python is really simple to start with and helps you with many things while java can be a pain to do the same job (Java core language uses "char" as primary character variable (only stores one character) which makes Strings hard to use which causes many problems in other areas like file management.
Here's how you open a file in Python and write "blah blah" in it:

outfile=open("file.txt", 'w')
outfile.write("blah blah")
outfile.close()

That's it! You can run it right now and find a text file named "file" next to the program with "blah blah" written in it.

And here is what you need to write in java to do the same...

import java.io.*;
public class Example
{
public static void main(String [] args)
{
PrintWriter outfile = null;
try
{
outfile = new PrintWriter(new FileWriter("out.txt"));
}
catch (IOException e)
{
System.out.println("Error opening the file out.txt"));
System.exit(-1);
}
outfile.println("blah blah");
outfile.close();
}
}

If you learn Java, BELIEVE ME this is not gonna look scary any more, but still it is more complex than it needs to be.


But java is really good when you start to use classes and create objects and packages (with Python I would never use classes because I find them really annoying).

Also java is really superior when it cames to giving your program to others because you don't have to compile your programs for every system (windows, mac etc). You compile it once and it runs on any system that has java installed. (In python compiling can be a pain and you can only compile for the οperating system you are using so you need a mac computer to compile for mac).

And last but not least, I find Java to have amazing capabilities python doesn't. For example using java I made a program that captures your screen and analyzes the color of each pixel allowing you to do crazy things compined with a transparent window like drawing things on your screen on top of colors you choose or making a program that auto-plays that google chrome offline game thingy with the dinosaur.


So my conclusion:
Python is an amazing language that makes life easier while still holding on some great programming power and I find python a must for editing files, working with strings. scraping information from websites and in general creating simple desktop applications where simplicity really helps. But I think java is still #1 programming language to this date for a reasson (meh if it still is).

So my advise would be to use the language that you think is better for the particular job (I switch between the 2 all the time) and if you want to start programming I believe you should start with python 100% because you learn the basics in the beginning and not everything at once, while avoiding unneeded difficulties.

Wish you the best and if you really want to learn programming I assure you it is fun and you will love creating. Just give yourself some time to learn and you will do great!

charimuvilla
Автор

Everyone here knows a quality software engineer never stops learning, building and developing their skill and work. So, with this in mind it is only obvious to learn the language that gets your foot into the door of the programming world first. Second, always have a side project and/or education to develop yourself into a respected talent. Learn C, C++ and assembly language. Learn the hard bits of electronics that many software engineers avoid. But for Gods sake, learn them on the side. Develop a livelihood alongside a career. The livelihood is developed through the most popular, the career through the most unpopular yet useful. If you are a python developer that knows assembly language, I'm more than sure you're a unicorn in most of the job market. Just my 2 cents. 

christopherdavis
Автор

Swap integers without additional variable?

CHALLENGE ACCEPTED

C----
a=a+b;
b=a-b;
a=a-b;

PYTHON-Bitch Please :)
a, b=b, a

ananananify
Автор

As weird as this seems, I actually learned a lot from this... Thanks man!

lucretiaxx
Автор

It's not called "C Hash." It's "C sharp."

eop
Автор

oh can i learn both?

sure

and can i learn all languages?

sure do it

Mundm
Автор

'I don't know C in any form' *Grins terrifyingly*

OttosTheName
Автор

This is really a horrible video. It doesn't really explain the important differences -- the ones that matter in the long run. Also, saying that python runs faster because it has less lines is absolutely silly. 

JustinSmith
Автор

input = raw_input("Was this video good?")
if input == "yes":
    print "You think this video is good?"
elif input == "no":
    print "You think this video is bad?"
else:
    print "Fuck you"

HugoIetsGaming
Автор

If the guy in blue learns Python he will grow pants. If he learns Java he will grow a neck.

illmagnetic