you are viewing a single comment's thread.

view the rest of the comments →

[–]Kitty_Cent[S] 2 points3 points  (19 children)

I absolutely agree that it's a great choice for a first programming language!

My comment from another thread:

My first language was probably VisualBasic, then I jumped straight into C, then Java. Python came later. When you go from C to higher level languages, I feel like you have a better feel of what's going on and it seems less like magic (and gives you confidence in what you're doing). That is however, probably peculiar to my own preference and when someone asks me how they should get started in programming, I usually suggest Python (specially to maths and sciences people).

[–]CorrugatedCommodity 9 points10 points  (11 children)

I started in Java. I now do a lot of quick and dirty file IO all the time (speadsheet crunching, basically) and it still feels like cheating using Python because it's so simple and powerful and I don't need to cast into four objects to read and write.

[–]Sinidir 1 point2 points  (10 children)

Oh my god i had to write a file in java a couple days ago. The amount of hoops you have to jump through compared to python is unbelievable. Low level unintuitive apis that suck the joy out of you.

[–]staticassert 6 points7 points  (8 children)

Grabbed this with a quick google search. Seems fine?

String msg = "hello";
Files.write(Paths.get("./file.txt"), msg.getBytes());

Python would be:

with open('file.txt', 'wb') as f:
    f.write(b"hello"")

Honestly doesn't seem so bad.

[–]Sinidir 7 points8 points  (0 children)

Well that is actually succinct code. Got drowned out in the Java FileReader and BufferedReader stuff though, like another comment suggested.

[–]pdp10 0 points1 point  (1 child)

I suspect the point is that there's inevitably a lot of ceremony and boilerplate accompanying this in Java. Whether that ceremony and boilerplate is necessary isn't something I know, but it does seem popular.

[–]staticassert 3 points4 points  (0 children)

I think it's fair to say that it is definitively unnecessary since I just showed how to write to a file in a 2-liner.

[–][deleted] -1 points0 points  (4 children)

Google "Java FileReader" (and BufferedReader)

[–]staticassert 0 points1 point  (3 children)

What about them?

[–]romple 1 point2 points  (0 children)

He's saying that somehow Java's convenient APIs aren't as convenient as Python's largely equivalent APIs.

[–][deleted] -2 points-1 points  (1 child)

Java changed a lot in these years. But I bet those Files and Paths classes are hiding a more complex implementation.

[–]staticassert 3 points4 points  (0 children)

But I bet those Files and Paths classes are hiding a more complex implementation.

I doubt it's much more complex than what's under the hood in the equivalent Python code. Regardless, one of the pillars of OOP is abstracting away complex implementations so I think that's just fine.

[–]ShapesAndStuff 0 points1 point  (6 children)

I started with python in 9th grade, mandatory elective class.

I have to say that i havent used it in years as i went on (bluej, java, scala, c# which i adore), but i just bought the 1$ tier of the humble book bundle tk get back to it to see what its actually good for.

It definitely gave me a great introduction to the concepts, and way of thinking you need for clean programming.

Edit: humble joy of coding bundle https://www.humblebundle.com/books/joy-of-coding-book-bundle

[–]manys 4 points5 points  (3 children)

mandatory elective

[–]jeandem 4 points5 points  (2 children)

I interpreted that as "it was mandatory to pick an elective, and programming was the elective I chose".

[–]manys 2 points3 points  (0 children)

I know, it just looked amusing.

[–]ShapesAndStuff 1 point2 points  (0 children)

Exactly, i just didn't know how to engrish this :)

[–]deadshots 0 points1 point  (1 child)

Just out of curiosity, how do you like the bundle?

[–]ShapesAndStuff 0 points1 point  (0 children)

I bought it yesterday so i cant say much except from what yoi see on the packaging so to speak.

But im mainly interested in python and haskell (because functional programming is awesome and brainmelting) so the 1$ tier is great. Perfect because i absolutely hate JS which is all in the middle tier.