• Welcome to League Of Reason Forums! Please read the rules before posting.
    If you are willing and able please consider making a donation to help with site overheads.
    Donations can be made via here

Python (Programming is Fun again!)

)O( Hytegia )O(

New Member
arg-fallbackName=")O( Hytegia )O("/>
I'm an old-fashioned hacker, and a typical one.
I started off as a kid with a wild-streak and a knack at numbers. That, combined with a bit of intrigue about the magic of computers, caused me to hop on it and play a bit.
I was mapping out networks and cracking WEP keys before half of the script-kiddie material they have now was even daydreamed!

But, I digress. Over the years, the fantasy had died. There is no more wonder in a raw hunk of metal, no matter how many games one has on it. C+? A+? I got those certs in my sleep. Perl? Been there, done that, and bought the T-Shirt. Minutes to hours of scripting away, myself knowing that each and every touch of the keyboard would send electrical signals down through the circuit, to be input as a series of 1s and 0s before being interpreted and sent back up to be displayed on my monitor...
Monotony.

But then, while I was browsing through my favorite XKCD comics, I came across this comic and was immediately curious. A different programming language? Worth a shot.
But Python - it is different. It is simple, and capable of playing on the same levels of complexity as the other methods. Soon I was writing complex mathematical algorithms - things that, to input, would have taken me a half hour on other languages - in MINUTES. I even managed to design myself a GUI-enhanced MineCraft counter to keep tack of various statistics (such as altitude, deaths, monsters killed, etc).

I now find myself back in amazement with computers - simply because, as the comic stated, simple programming is FUN programming!

What do you think of Python?
 
arg-fallbackName="Pulsar"/>
I absolutely love Python, you can program things in a fraction of the time required for e.g. C++. The only downside is that, since it doesn't generate compiled code, it can't be used for high-performance algorithms. Other than that, it's fantastic. You're right, it does make programming fun again. I think it should be taught to students as their first computer language.
 
arg-fallbackName="MineMineMine"/>
Pulsar said:
I absolutely love Python, you can program things in a fraction of the time required for e.g. C++. The only downside is that, since it doesn't generate compiled code, it can't be used for high-performance algorithms. Other than that, it's fantastic. You're right, it does make programming fun again. I think it should be taught to students as their first computer language.



HUH? you actually can compile python.
I don't know how fast/slow python code in general is.
 
arg-fallbackName="MineMineMine"/>
Pulsar said:
MineMineMine said:
HUH? you actually can compile python.
To bytecode, not full machine code. The difference in speed can be huge.

you actually can use stuff like ShedSkin to compile python native code.


And Ocaml bytecode itself is plenty fast so i wouldn't say that bytecode in general is bad thing or limiting speed
 
arg-fallbackName="Pulsar"/>
MineMineMine said:
you actually can use stuff like ShedSkin to compile python native code.
I've never used ShedSkin, but I'm aware of similar optimization applications like PyPy and Cython. They help in some cases, but they won't beat native C.
MineMineMine said:
And Ocaml bytecode itself is plenty fast so i wouldn't say that bytecode in general is bad thing or limiting speed
Indeed, that's what I said. Most of the time, bytecode is more than enough. I just pointed out that it's not always sufficient for very intensive numerical work, like astronomical N-body codes, monte carlo simulations, or modelling algorithms, which sometimes run for days. For those problems, we sometimes have to switch to more low-level languages, unfortunately.
 
arg-fallbackName="Case"/>
I've started to code in Matlab as I took a course at university (I coded a bit in C,C++,Pascal when I was very young) and continued because indeed, high-level programming is a lot of fun. I'm considering relearning C++ as I've run into some speed issues with hefty problem-solving algorithms, but I've already written more complete programs with Matlab than I have ever before in C/C++, I guess because it's so intuitive so bugfixing is a lot easier. I've taken a look at Python and it isn't that different, just didn't have the time to teach myself the syntax. I'm also considering looking into LISP as I read an article that makes it sound quite attractive for a lot of reasons.

Long article saying that as high-level programming languages evolve they'll get closer and closer to LISP:
 
arg-fallbackName="borrofburi"/>
Case said:
I've taken a look at Python and it isn't that different, just didn't have the time to teach myself the syntax.
I haven't done matlab in a while, but python is pretty different, unless I vastly mis-remember matlab.

Case said:
I'm also considering looking into LISP as I read an article that makes it sound quite attractive for a lot of reasons.

Long article saying that as high-level programming languages evolve they'll get closer and closer to LISP
PG really likes LISP and makes it sound pretty awesome**. I don't actually know, the only functional language I know is OCaml, but I will say this: functional languages are nothing like imperative/scripting languages such as C and matlab, and they are nothing like object oriented languages such as C++ and java. Learning to program and think functionally is difficult. Certainly, you can mangle OCaml (and probably even LISP) into a matlab-like style (I've certainly seen "learn OCaml" guides that explicitly try to relate it back to C), but in doing so you've missed the point.

Functional languages are all about closures, currying, lists, and lambda calculus. If you don't regularly use the first three and think in the fourth, then you're probably trying to make the functional language fit into an imperative paradigm, when you should be making your brain fit into a functional paradigm.


**Seriously, I read that article last night, and I read a similar one by him a long time ago... It makes me want to learn LISP instead of doing the work I actually very much MUST get done today. On the other hand I am a little cautious, he's a LISP evangelist, and while I'm certain some people really are right when they say "check this thing out it's great you'll love it", it sets off a lot of alarm bells in my head.
 
arg-fallbackName="Case"/>
An evangeLISP, tee hee hee.

I must admit my look at Python was pretty cursory, I should remember to use e-prime (not the programming language).

My programming skill is probably very very low anyway, so it's not like I expect big results anytime soon, no matter what language I code in.
While I'm at it:
Does anyone have an idea how I could phrase this differently?:
Code:
if numel(uniproxy)>1 && heuristic(N*N)==uniproxy(find(uniproxy==uniproxy(uniproxy==uni(find(uni==heuristic(N*N))))))

I don't even know what it does anymore :D
Well, I do, but I don't quite understand why it does what it's supposed to do. It's what happens when you try to cram everything into 1 expression, I guess.
 
arg-fallbackName=")O( Hytegia )O("/>
A kindergartner could learn Python. And the fact that it cuts out all the tediousness of it makes it beneficial.
Typical Hacker round 1 challenge:
"Hello World" in any programming language.

print "Hello World"
"Hello World"

I got bored and made a lady-friend of mine a program to flirt with her and then ask her to the movies - and it makes it 10 times easier when you don't have a "No Thanks" option for the movie question. :p
 
arg-fallbackName="drento"/>
Though it really is very easy to program using Python, I don't think that the curriculum should be changed to impart with new learners programming through Python.

It is very easy to program using it, and very efficient at that. I have been on it for a very long time already and loving it. There are some limits with it but you can find workarounds so that you can get what initially you can't contend with.
 
Back
Top