must take time....
The original reason i started writing this blog, was to keep track of stuff that i do. damnit...i have not been doing that lately. its odd that i can't find time to write a few sentences here, considering i spend every waking moment on my computer.
I have been learning python lately. from what i have seen of it, its a very cool language. I like languages like C and perl because of their cryptic syntax, so python is not appealing on that front. you can write some crazy looking stuff in python, but most of it seems to be written so that it is easy to read. This is probably a good thing...!
Python is more high level that C or perl, but for me is a nice middle ground between the two. C is a very strict langugae. If you know it well, then you can write quick little programs with no problem. but if you don't play with it very often, you can find yourself getting very frustrated at the complier for complaining about something that just does not seem wrong. perl on the other hand will let you do whatever you want basically. which is why a lot of hackers like it. it lets you get what you want done, done and there is not a lot of for play. python enforces a lot of the stuff that C enforces, but still gives you a lot of the flexibility of perl. i think it will take a little getting used to, but i believe it will lead to a more reliable program in the end.
things i like about python:
things i don't like about python, but prolly just need to get used to:
hopefully as i learn more, i will be able to speak more intelligently about python.
i will sign off with a code snippet i wrote today. I always like to write really complicated one liners. this is my first python complicated one liner
can you guess what it does?(its actually pretty simple)
I have been learning python lately. from what i have seen of it, its a very cool language. I like languages like C and perl because of their cryptic syntax, so python is not appealing on that front. you can write some crazy looking stuff in python, but most of it seems to be written so that it is easy to read. This is probably a good thing...!
Python is more high level that C or perl, but for me is a nice middle ground between the two. C is a very strict langugae. If you know it well, then you can write quick little programs with no problem. but if you don't play with it very often, you can find yourself getting very frustrated at the complier for complaining about something that just does not seem wrong. perl on the other hand will let you do whatever you want basically. which is why a lot of hackers like it. it lets you get what you want done, done and there is not a lot of for play. python enforces a lot of the stuff that C enforces, but still gives you a lot of the flexibility of perl. i think it will take a little getting used to, but i believe it will lead to a more reliable program in the end.
things i like about python:
- object oriented is good
- core language is simple -- all the complicated stuff is in module,which have their own namespace
- to my knowledge you have to specifically say
global somevarto get access to a variable global with respect to the module.i mention this in particular because i have had problems with perl when it comes to global variables, because of my laid back attitude with them. I want the interrpreter to bitch...
- list stuff (ie. looping,slicing...) it has cool list features and i still have more of them to learn
- the dir function. very useful for someone learning a language you have an object returned from something, and you don't know what it is just say
dir(someobj)and you get a list of all of its methods and properties
things i don't like about python, but prolly just need to get used to:
- I am not a huge fan of exceptions, but they do give you a little more info than a return value of 0
- no enclosing braces for functions. liked it at first, but its kind of throwing me off
- don't think it supports a ++ operator or ?: conditional. i do however think you can define one, but i'm not sure how
hopefully as i learn more, i will be able to speak more intelligently about python.
i will sign off with a code snippet i wrote today. I always like to write really complicated one liners. this is my first python complicated one liner
can you guess what it does?(its actually pretty simple)
''.join([''.join(list(p)) for p in [(str(x),str(chr(y))) for x,y in zip(random.sample(range(10000),50),random.sample(range(65,91)+range(97,123),50))]])




0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home