What currently turns me off to Python is the big divide between v2 and v3 and the splits in the community and libraries w/r/t which is the one to use. Everyone should be moving to v3 (teh new shinies!), but it broke conventions/behavior from v2 and some people seem really angry about that.
It seems like if I want to use any 3rd party libraries I want to use v2, but if I'm just writing for myself I should use v3. It's confusing and infuriating at the same time. :rotate:
Seriously, though, Ruby is also awesome. To me, aside from specific library or framework wants/needs, the decision between the two comes down to which syntax you prefer. Although significant whitespace and the stupid self thing in Python can be annoying, I still prefer the syntax over Ruby.
GnomeTankWhat the what?Portland, OregonRegistered Userregular
But...significant white space and needing self for instance methods is the biggest difference in their syntax. Seriously. They both use self, they both use def...their syntaxes are amazingly alike except for the two things you hate. So much so what you said doesn't even make sense.
I don't like so many curly braces and the block syntax for stuff and typing "end" (I'd rather use a curly brace) and the lack of list comprehensions (although you can get the same result by chaining some functions together, I just prefer the Python syntax for doing it). Plus symbols. wtf. They're an immutable "string" and an int at the same time, yet are also neither. It wouldn't make me quit or avoid taking a job if that's what some employer wanted me to use, it just makes it not my first choice.
The significant whitespace doesn't annoy me often, it's just really annoying on the rare occasion that it does do so.
The other thing with Python that irritates me is the need to specify self as the first arg of an instance method. If it's an instance methods and instance methods ALWAYS get self passed as the first argument, why do I need to tell you it's going to be there? It's not a huge deal, but it really seems to go against the values of a language that prides itself on being very clean and clear while also minimizing code length.
Fortunately before this I wrote Perl full time and Perl's OO stuff is based on Python's, so it's second nature to put it there unless I've been doing a lot of work recently in a language that doesn't do that. If I had spent most of my time writing Java or C++ or anything else before this, I guarantee I'd forget it every damn time, though.
This is another reason why I like IDEs. PyDev automatically plops "self" in there for me as soon as I type first parenthesis after the method name. It'll do the same thing for class methods too.
The other thing with Python that irritates me is the need to specify self as the first arg of an instance method. If it's an instance methods and instance methods ALWAYS get self passed as the first argument, why do I need to tell you it's going to be there? It's not a huge deal, but it really seems to go against the values of a language that prides itself on being very clean and clear while also minimizing code length.
Fortunately before this I wrote Perl full time and Perl's OO stuff is based on Python's, so it's second nature to put it there unless I've been doing a lot of work recently in a language that doesn't do that. If I had spent most of my time writing Java or C++ or anything else before this, I guarantee I'd forget it every damn time, though.
This is another reason why I like IDEs. PyDev automatically plops "self" in there for me as soon as I type first parenthesis after the method name. It'll do the same thing for class methods too.
I'm so used to typing it now that my first week or two working with an IDE that auto fills it I constantly end up with
So, I spent 10minutes yesterday scratching my head trying to figure out why my Python code wouldn't compile.
for eachItem in itemList:
print(eachItem)
didn't work. But, that's ok, cause I fixed it. I did this instead
for eachItem in itemList:
print(eachItem)
....see the difference? no? I didn't either, until I highlighted all and Sublime showed it was actually
for eachItem in itemList:
.....print(eachItem)
instead of
for eachItem in itemList:
---print(eachItem)
sigh Were brackets that bad? And with brackets exactly saying what should be in what scope, you can highlight everything in Eclipse in ctrl+shift+i and it indents everything correctly. Boom, everythings in pretty. Now, if I copy and paste and shit doesn't paste well, I have to go in and tab everything to where it belongs. I know Python is god's work around here, but man, I miss JAVA. [twirl] [/twirl]
I've had this type of problem with different languages, and something that's helped me is adopting the following axiom:
If I'm writing in a language, I will strictly adhere to the style guide of that language. The style guide is one of the first things I investigate upon adopting/learning a new programming language. And it's especially important in dynamic languages, IMO.
In Python, the almost-universally accepted style guide is PEP 8. The highlights of which are:
- Intendations should always be made with exactly four spaces (not a tab)
- Functions and variable names should be all lowercase, with underscores separating discrete words: i.e., each_item instead of eachItem
- Class names should use CapWords
In your case, I'm not sure what the difference is between periods and hyphens before the call to print() -- but whatever they are, I'm sure that both are incorrect in PEP-8...
The other thing with Python that irritates me is the need to specify self as the first arg of an instance method. If it's an instance methods and instance methods ALWAYS get self passed as the first argument, why do I need to tell you it's going to be there? It's not a huge deal, but it really seems to go against the values of a language that prides itself on being very clean and clear while also minimizing code length.
This is my largest complaint with Python. I don't mind the whitespace / no brackets (I tend to find brackets annoying and don't mind that it forces me to format code nicely).
I need to spend some more time with Ruby / rails. Especially since I have a project in mind this time around... maybe that's what I will do with my day off tomorrow.
I find the different opinions here about dynamic languages to be quite interesting...
Personally, what I like most about Python is its clean look -- so I like the whitespace requirement.
I started thinking about trying to make my own programming language that kept all the things I like about Python, while addressing the big thing I don't like.
In fact.. I've sort of been playing with the idea of making a programming language that looks like Python, except requires type indication. And access level indicators around class variables. And no dynamic classes (that is, no adding new attributes to a class at runtime).
Is there any language like that already?
0
GnomeTankWhat the what?Portland, OregonRegistered Userregular
No dynamic types? You've gone mad. That's half the power of Ruby and Python, run time meta programming. I would never use such a language. If I wanted static typing, I'd just use C# or C++.
Sort of Python story.
When I was first learning Python I had picked up the O'Reilly book named, appropriately enough, Learning Python when my wife and I were visiting Dallas for her Spring Break. I get back to work and my lunch break starts so I crack open the book. I'm reading the introduction, and I was like, oh yeah, gotta install in the language and all that jazz. So I type in python.com and keep reading while I wait for the page to load. I get a bit absorbed and look up about 5 minutes later.
Turns out python.com was not where I wanted to go. I'd just been sitting at my desk with pretty graphic porn just sitting there in full screen. I almost fell out of my chair I was so startled and closed the window as quickly as I could. Thankfully the two ladies in accounts recievable who I sat between were also out at lunch because not only would they have been shocked, people were constantly coming to talk to them about stuff, including the head of HR, and all 3 owners of the company.
I guess what I was imaging was something like this:
- no curly braces, no semicolons
- exactly four spaces indicates a block of code (anything else raises a compile time error)
- prefacing "_" for an attribute name disallows that variable from being accessed by anything other than inside that class or its subclasses
- all cap variable names (LIKE_THIS) == constant, can't change the value
- all lower case variable names are variables
- some super concise way of indicating the type of a variable (maybe something like foo~bool = True because tildes are adorable)
e: So basically I'd just codify the existing PEP-8 standard, is what I'm saying.
Anyway I'd only really do it as just a learning adventure someday, I wouldn't really expect anyone to actually use it. (And I'd rather develop my skills on actual programming languages.)
Sort of Python story.
When I was first learning Python I had picked up the O'Reilly book named, appropriately enough, Learning Python when my wife and I were visiting Dallas for her Spring Break. I get back to work and my lunch break starts so I crack open the book. I'm reading the introduction, and I was like, oh yeah, gotta install in the language and all that jazz. So I type in python.com and keep reading while I wait for the page to load. I get a bit absorbed and look up about 5 minutes later.
Turns out python.com was not where I wanted to go. I'd just been sitting at my desk with pretty graphic porn just sitting there in full screen. I almost fell out of my chair I was so startled and closed the window as quickly as I could. Thankfully the two ladies in accounts recievable who I sat between were also out at lunch because not only would they have been shocked, people were constantly coming to talk to them about stuff, including the head of HR, and all 3 owners of the company.
Haha, that is awesome.
Of course now that means I'll have to try and go there.
So, now they apparently want to keep using the platform I designed and built at least through the end of the year... but don't want to pay me. Instead, they still want to let me go at the end of March and want me to commit to being available to contract for support if something were to break. Because, you know, with a baby, school, and a different full time job I'm sure I'll be able to drop what I'm doing and fix shit 6 months down the road.
Given that there's been no downtime or serious bugs since launch (knock on wood), it IS tempting to say I'll do it for a $500 or $1000/month retainer. Don't think I will, though. I don't want to get stuck fixing shit that I don't want to and don't have time for... eventually something is going to go wrong.
$8500 ((~$50/hr x 40 x 52) / 12) a month retainer. Break the camel's back.
Oh you want to support the platform? Well you pay for it.
Trust me, they'll call you over something like "oh my printer isn't working with this platform you built." And yes, their printer will be out of paper.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
If they were to call me about a printer I'd cut them.
But yeah, there's a good chance I'd get called about all kinds of stupid shit because there's so much that I'm the only person who knows anything about it. Asynchronous shit going with Celery and RabbitMQ, SMS messaging, etc.
I'll be nice about it, probably. They can feel free to contact me if there's some sort of major issue, but I'm not promising now I'll be available to fix anything in 6 months. If I somehow don't land a new full time job, I'll want the money, so I don't want to totally burn the bridge. They've already fucked things up for me though, so I'll help if it's convenient for me and won't if it's not. They definitely won't go for paying me a full time wage like that... that's more than I'm getting now (well, not sure how it balances out with benefits, but it's more in take home cash).
My absolute biggest issue with it is that once an app has been used in a migration, even if you're not using that app anymore, you can't remove it from your INSTALLED_APPS/system since if you do, the next time you run through a full migration - setting up a new server/dev env, running tests, etc. it will fail due to referencing an app that doesn't exist. Fuck that.
I've also found that it's way easier than I'd like to write migrations that don't always work... it works when there's data in the table but not if the table is empty, etc.
You have to be very careful when working with teams of multiple developers to not create conflicting migrations, especially if multiple people are working on the same app or apps that make use of each other somehow.
Less importantly, it's easy to end up with a shitload of migration cruft if you start making migrations too early.
I also feel like it at times provides a false sense of security with it's ability to roll back, etc. I've got way more migrations than I'm happy about that can't roll back, which kills one of the big advantages of using South.
If they were to call me about a printer I'd cut them.
But yeah, there's a good chance I'd get called about all kinds of stupid shit because there's so much that I'm the only person who knows anything about it. Asynchronous shit going with Celery and RabbitMQ, SMS messaging, etc.
I'll be nice about it, probably. They can feel free to contact me if there's some sort of major issue, but I'm not promising now I'll be available to fix anything in 6 months. If I somehow don't land a new full time job, I'll want the money, so I don't want to totally burn the bridge. They've already fucked things up for me though, so I'll help if it's convenient for me and won't if it's not. They definitely won't go for paying me a full time wage like that... that's more than I'm getting now (well, not sure how it balances out with benefits, but it's more in take home cash).
This is what employees and contractors are for. Just because I built the system doesn't mean beans. You want me to fix your products? Pay me. That's the relationship. Just because it's my baby doesn't mean I'll help you out of a pinch if you're a dick to me.
I've been in that situation.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Cool. Yeah, one of my ground rules for using South on our project here is that we should be able to migrate all the way back to zero. And if you have a migration that would necessarily not be roll-backable, just migrate to zero and start a fresh migration with the current state of the model.
Also, my other two project members work in branches. I work in the trunk. My team members are pretty good about not merging in conflicts.
Also, wow, I stumbled what is probably the least understandable piece of code in Django that I've seen so far...
new_class.add_to_class('MultipleObjectsReturned', subclass_exception('MultipleObjectsReturned',
tuple(x.MultipleObjectsReturned
for x in parents if hasattr(x, '_meta') and not x._meta.abstract)
or (MultipleObjectsReturned,), module))
So, now they apparently want to keep using the platform I designed and built at least through the end of the year... but don't want to pay me. Instead, they still want to let me go at the end of March and want me to commit to being available to contract for support if something were to break. Because, you know, with a baby, school, and a different full time job I'm sure I'll be able to drop what I'm doing and fix shit 6 months down the road.
Given that there's been no downtime or serious bugs since launch (knock on wood), it IS tempting to say I'll do it for a $500 or $1000/month retainer. Don't think I will, though. I don't want to get stuck fixing shit that I don't want to and don't have time for... eventually something is going to go wrong.
just tell them: "sure, I'll come in for contract work later. My contract rate is $150/hr"
If they were to call me about a printer I'd cut them.
But yeah, there's a good chance I'd get called about all kinds of stupid shit because there's so much that I'm the only person who knows anything about it. Asynchronous shit going with Celery and RabbitMQ, SMS messaging, etc.
I'll be nice about it, probably. They can feel free to contact me if there's some sort of major issue, but I'm not promising now I'll be available to fix anything in 6 months. If I somehow don't land a new full time job, I'll want the money, so I don't want to totally burn the bridge. They've already fucked things up for me though, so I'll help if it's convenient for me and won't if it's not. They definitely won't go for paying me a full time wage like that... that's more than I'm getting now (well, not sure how it balances out with benefits, but it's more in take home cash).
This is what employees and contractors are for. Just because I built the system doesn't mean beans. You want me to fix your products? Pay me. That's the relationship. Just because it's my baby doesn't mean I'll help you out of a pinch if you're a dick to me.
I've been in that situation.
So far I've chosen to leave all my jobs, so I make myself available by email to answer questions, but not to do any actual work.
But if they fired me, didn't renew my contract, etc. they can figure it out themselves!
If they were to call me about a printer I'd cut them.
But yeah, there's a good chance I'd get called about all kinds of stupid shit because there's so much that I'm the only person who knows anything about it. Asynchronous shit going with Celery and RabbitMQ, SMS messaging, etc.
I'll be nice about it, probably. They can feel free to contact me if there's some sort of major issue, but I'm not promising now I'll be available to fix anything in 6 months. If I somehow don't land a new full time job, I'll want the money, so I don't want to totally burn the bridge. They've already fucked things up for me though, so I'll help if it's convenient for me and won't if it's not. They definitely won't go for paying me a full time wage like that... that's more than I'm getting now (well, not sure how it balances out with benefits, but it's more in take home cash).
This is what employees and contractors are for. Just because I built the system doesn't mean beans. You want me to fix your products? Pay me. That's the relationship. Just because it's my baby doesn't mean I'll help you out of a pinch if you're a dick to me.
I've been in that situation.
So far I've chosen to leave all my jobs, so I make myself available by email to answer questions, but not to do any actual work.
But if they fired me, didn't renew my contract, etc. they can figure it out themselves!
Yeah. This is more not burning a bridge in case I do need the contract work.
I've had 3 interviews this week, 2nd interviews lined up for Friday and Monday. Hopefully I won't need their contract work if it comes up.
just tell them: "sure, I'll come in for contract work later. My contract rate is $150/hr"
I've got a 3 month old baby at home, am going to school while working full time, and will have a job which is currently unknown and so with and unknown workload, expectations, etc. I'm not promising a damned thing for any amount of money unless it's guaranteed money and enough to allow me to not have a separate job, which if they were going to pay that, they just wouldn't let me go in the first place.
Contract work typically comes at triple your hourly wage because you have to factor in paying your own payroll and SSI taxes which effectively doubles the amount of income tax you pay. Someone contracting for $20,000 makes less than minimum wage, for instance. Like $4 an hour.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Yeah, that's not what they want to do, though. What they want me to do is say that I'll be available so that if something breaks, then they can call me and pay me $X/hr to come fix it, but otherwise not be paying me. I'm not burning the bridge, because if I somehow don't land something, I'll want the money if/when it's offered. There's not a chance in hell I'm going to promise I'll have the free time to do it, though.
That's still contract work and you should still get a 1099-MISC IIRC. You'll still have to file quarterly to not get dinged.
Legally speaking. I'm trying to help you cover your bases there. If you're going to make the obligation to help them, you need to not fuck yourself in the ass. Saying you'll take $30 an hour means you're taking $17~ an hour. So to speak.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Don't sell yourself short because it's going to be you, not them, the IRS comes after. Basically. It's alluring, but dangerous.
One of the many things I am learning about as I own my part time business, that SE tax is insane if you don't account for it. Especially if you don't have a job.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Posts
It seems like if I want to use any 3rd party libraries I want to use v2, but if I'm just writing for myself I should use v3. It's confusing and infuriating at the same time. :rotate:
Seriously, though, Ruby is also awesome. To me, aside from specific library or framework wants/needs, the decision between the two comes down to which syntax you prefer. Although significant whitespace and the stupid self thing in Python can be annoying, I still prefer the syntax over Ruby.
The significant whitespace doesn't annoy me often, it's just really annoying on the rare occasion that it does do so.
They are names. That's what symbols are. They are names. They bridge the gap between string literals and lexical identifiers.
This is another reason why I like IDEs. PyDev automatically plops "self" in there for me as soon as I type first parenthesis after the method name. It'll do the same thing for class methods too.
I've had this type of problem with different languages, and something that's helped me is adopting the following axiom:
If I'm writing in a language, I will strictly adhere to the style guide of that language. The style guide is one of the first things I investigate upon adopting/learning a new programming language. And it's especially important in dynamic languages, IMO.
In Python, the almost-universally accepted style guide is PEP 8. The highlights of which are:
- Intendations should always be made with exactly four spaces (not a tab)
- Functions and variable names should be all lowercase, with underscores separating discrete words: i.e., each_item instead of eachItem
- Class names should use CapWords
In your case, I'm not sure what the difference is between periods and hyphens before the call to print() -- but whatever they are, I'm sure that both are incorrect in PEP-8...
It took me a fair bit to finally understand symbols. They're great to just use as immutable labels for stuff like big hashes.
This is my largest complaint with Python. I don't mind the whitespace / no brackets (I tend to find brackets annoying and don't mind that it forces me to format code nicely).
I need to spend some more time with Ruby / rails. Especially since I have a project in mind this time around... maybe that's what I will do with my day off tomorrow.
Personally, what I like most about Python is its clean look -- so I like the whitespace requirement.
I started thinking about trying to make my own programming language that kept all the things I like about Python, while addressing the big thing I don't like.
In fact.. I've sort of been playing with the idea of making a programming language that looks like Python, except requires type indication. And access level indicators around class variables. And no dynamic classes (that is, no adding new attributes to a class at runtime).
Is there any language like that already?
When I was first learning Python I had picked up the O'Reilly book named, appropriately enough, Learning Python when my wife and I were visiting Dallas for her Spring Break. I get back to work and my lunch break starts so I crack open the book. I'm reading the introduction, and I was like, oh yeah, gotta install in the language and all that jazz. So I type in python.com and keep reading while I wait for the page to load. I get a bit absorbed and look up about 5 minutes later.
Turns out python.com was not where I wanted to go. I'd just been sitting at my desk with pretty graphic porn just sitting there in full screen. I almost fell out of my chair I was so startled and closed the window as quickly as I could. Thankfully the two ladies in accounts recievable who I sat between were also out at lunch because not only would they have been shocked, people were constantly coming to talk to them about stuff, including the head of HR, and all 3 owners of the company.
- no curly braces, no semicolons
- exactly four spaces indicates a block of code (anything else raises a compile time error)
- prefacing "_" for an attribute name disallows that variable from being accessed by anything other than inside that class or its subclasses
- all cap variable names (LIKE_THIS) == constant, can't change the value
- all lower case variable names are variables
- some super concise way of indicating the type of a variable (maybe something like foo~bool = True because tildes are adorable)
e: So basically I'd just codify the existing PEP-8 standard, is what I'm saying.
Anyway I'd only really do it as just a learning adventure someday, I wouldn't really expect anyone to actually use it. (And I'd rather develop my skills on actual programming languages.)
Haha, that is awesome.
Of course now that means I'll have to try and go there.
It's interesting for sure, but is taking my mind a bit to adjust to. Anyone have some good online resources for it?
So, now they apparently want to keep using the platform I designed and built at least through the end of the year... but don't want to pay me. Instead, they still want to let me go at the end of March and want me to commit to being available to contract for support if something were to break. Because, you know, with a baby, school, and a different full time job I'm sure I'll be able to drop what I'm doing and fix shit 6 months down the road.
Given that there's been no downtime or serious bugs since launch (knock on wood), it IS tempting to say I'll do it for a $500 or $1000/month retainer. Don't think I will, though. I don't want to get stuck fixing shit that I don't want to and don't have time for... eventually something is going to go wrong.
Oh you want to support the platform? Well you pay for it.
Trust me, they'll call you over something like "oh my printer isn't working with this platform you built." And yes, their printer will be out of paper.
But yeah, there's a good chance I'd get called about all kinds of stupid shit because there's so much that I'm the only person who knows anything about it. Asynchronous shit going with Celery and RabbitMQ, SMS messaging, etc.
I'll be nice about it, probably. They can feel free to contact me if there's some sort of major issue, but I'm not promising now I'll be available to fix anything in 6 months. If I somehow don't land a new full time job, I'll want the money, so I don't want to totally burn the bridge. They've already fucked things up for me though, so I'll help if it's convenient for me and won't if it's not. They definitely won't go for paying me a full time wage like that... that's more than I'm getting now (well, not sure how it balances out with benefits, but it's more in take home cash).
I've also found that it's way easier than I'd like to write migrations that don't always work... it works when there's data in the table but not if the table is empty, etc.
You have to be very careful when working with teams of multiple developers to not create conflicting migrations, especially if multiple people are working on the same app or apps that make use of each other somehow.
Less importantly, it's easy to end up with a shitload of migration cruft if you start making migrations too early.
I also feel like it at times provides a false sense of security with it's ability to roll back, etc. I've got way more migrations than I'm happy about that can't roll back, which kills one of the big advantages of using South.
Not that this isn't making me want to attack someone, but it's pretty neat.
This is what employees and contractors are for. Just because I built the system doesn't mean beans. You want me to fix your products? Pay me. That's the relationship. Just because it's my baby doesn't mean I'll help you out of a pinch if you're a dick to me.
I've been in that situation.
Also, my other two project members work in branches. I work in the trunk. My team members are pretty good about not merging in conflicts.
new_class.add_to_class('MultipleObjectsReturned', subclass_exception('MultipleObjectsReturned', tuple(x.MultipleObjectsReturned for x in parents if hasattr(x, '_meta') and not x._meta.abstract) or (MultipleObjectsReturned,), module))God damn
just tell them: "sure, I'll come in for contract work later. My contract rate is $150/hr"
So far I've chosen to leave all my jobs, so I make myself available by email to answer questions, but not to do any actual work.
But if they fired me, didn't renew my contract, etc. they can figure it out themselves!
I've had 3 interviews this week, 2nd interviews lined up for Friday and Monday. Hopefully I won't need their contract work if it comes up.
I've got a 3 month old baby at home, am going to school while working full time, and will have a job which is currently unknown and so with and unknown workload, expectations, etc. I'm not promising a damned thing for any amount of money unless it's guaranteed money and enough to allow me to not have a separate job, which if they were going to pay that, they just wouldn't let me go in the first place.
Legally speaking. I'm trying to help you cover your bases there. If you're going to make the obligation to help them, you need to not fuck yourself in the ass. Saying you'll take $30 an hour means you're taking $17~ an hour. So to speak.
One of the many things I am learning about as I own my part time business, that SE tax is insane if you don't account for it. Especially if you don't have a job.