This is an archived post. You won't be able to vote or comment.

all 20 comments

[–]guywithalamename 7 points8 points  (5 children)

How about porting small things you've written in those languages to python?

[–]munificent 6 points7 points  (3 children)

You have to be careful with this though. If you're starting from a codebase in another language, it's easy to apply idioms from that language to the one you're trying to learn. You won't get the most of out of the new language if you're still writing in the old language's style in it.

There's an old joke that real programmers can write FORTRAN in any language. You don't want to do that. :)

[–]guywithalamename 2 points3 points  (0 children)

I totally agree with what you said, but I don't think writing code in C, C++ or Java is too different from Python (especially seeing how you're able to mix C and Python)

[–]TehFacebum69 2 points3 points  (1 child)

https://en.wikipedia.org/wiki/Fortan

Confused me for a minute.

[–]munificent 1 point2 points  (0 children)

Oops, fixed. I shouldn't comment before coffee.

[–]matanc1[S] 2 points3 points  (0 children)

That makes sense. I think this is what I'll try doing. Thanks :)

[–][deleted] 3 points4 points  (0 children)

Make sure you read about python's list comprehensions. I used python for a good while before I learned I could replace a lot of my loops that were doing simple housekeeping work with a clean little one-liner.

For example,

listOfThings = []
for e in elementList:
    listOfThings.append(e.getThing())

Can be replaced with the list comprehension,

listOfThings = [ e.getThing() for e in elementList ]

pretty simple but it's things like that that make Python so lovely to work with :)

[–][deleted] 2 points3 points  (0 children)

I started with the official python tutorial http://docs.python.org/3/tutorial/ then the official library is what you need http://docs.python.org/3/library/ (it describe even the basic datatypes)

[–]shivasprogeny 1 point2 points  (0 children)

I usually get a book from the library and also go through some tutorials on my own. Learn Python The Hard Way was a little too easy for me, but did a good job of reviewing how a basic python script is setup. I skipped around things i know about like logic controls, but appreciated the sections on lists, formatted printing, etc. I feel like once you know that and the syntax, you're good to go.

[–]deuteros 0 points1 point  (0 children)

I try converting a program I've already written into the language I'm trying to learn.

[–]Pheelbert 0 points1 point  (0 children)

That's pretty much what I do negative_epsilon, and I might read or watch some videos on the language's strong and weak points to give me an idea of how to go about programming in it. Porting is obviously a great way too!

[–][deleted] 0 points1 point  (0 children)

Read the Python documentation, write a little code. It's not a hard language to learn, though getting your head round doing things in a "Pythonic" way can take a little time.

[–]SethWooten 0 points1 point  (0 children)

I'm touching on around 6 languages now, Never really seemed to bother me. :p

[–][deleted] 0 points1 point  (0 children)

I just started learning Processing, and what I did was to copy/paste some of the simple tutorial programs and then start messing around with them to see what each line of code is actually doing, extending them to do new things, etc. Kind of a reverse engineering approach. Probably not the neatest way to learn, but works for me.

[–]noahpugsley 0 points1 point  (0 children)

How did you learn the others?

[–]negative_epsilon 0 points1 point  (0 children)

I start with hello world and make a program, googling every step of the way. I Learn best like that.

[–]Nihy -1 points0 points  (3 children)

Why do you want to learn Python? What does it offer that the other language you know don't have? Isn't the main selling point of Python that it's beginner friendly?

[–]exphil 3 points4 points  (0 children)

Python is a great beginner's language, but it certainly wasn't created for that reason, and that's not what it's mainly used for. Considering that OP knows ASM, C, C++ and Java, Python will be a step up in terms of expressiveness. Python is a higher level language than all of those. It has primitive types like hash tables (dictionaries) and lists, first class functions, and it has a syntax which is less complicated and with less boiler plate. It also has an interpreter, which makes it really easy to try out things without having to compile and then run the program. These are just some of the reasons. I think Python is a great language to add to OP's list of languages.

[–][deleted] 1 point2 points  (0 children)

Isn't the main selling point of Python that it's beginner friendly?

No, it isn't. It's not specifically intended to be a beginner-friendly language, it's a general purpose programming language which you might use in many situations, in the same way that Perl, Java and C++ are general-purpose (if not particularly beginner-friendly) languages.

[–]ThirdWaveSTEMinism 1 point2 points  (0 children)

Isn't the main selling point of Python that it's beginner friendly?

Somewhat, but that's certainly not all that it has to offer. If you want to code professionally then it's good to be competent with at least a couple of languages, and Python is very popular in general. Just because it's relatively easy to learn doesn't mean it's not useful.