Python


#21

I would if I wanted to stay in what I'm doing, but as I said: One big thing I want to do is de-couple myself from "web programming". :) Thanks though.

Amen brother. And since everyone has a nephew who says "yeah I know PHP" even though they know little more that basic stuff, so there's a glut of PHP "programmers" and the market pays less. The catch is that a company has to go through a half dozen people before they hire one who doesn't suck.

I want to avoid Java and C/C++/C# though because I don't want this as a career. I'm more or less satisfied in finance. This is just something I do on the side, my own little projects, making little games, etc.


#22

We've got a project at work that's using Django, and the people using it seem very happy with it.


#23

That's a marketing and positioning problem (worth a whole separate discussion in and of itself). There's a massive gulf between a guy that "knows" PHP -- someone like me -- and a true, honest-to-God expert at PHP. The market doesn't see the difference, so if you're a contractor then you need to show others that being a badass LAMP guy is worth a premium over a guy that knows it well enough to hack on WordPress or phpBB for minor fixes.

Shitty PHP programmers that "get the job done" get like $20/hour. Awesome PHP programmers that know how to write exploit-minimal code get significantly more.


#24

Yep, that's what I've heard. Minus the last sentence.

Basically, the only way to get the "non-shitty" rate is to find someone who knows what you're worth. Pretty damn hard. I am an uber LAMP guy, but I'd never attempt to find contract work doing it. Hell, the posting I saw the other day for a super qualified LAMP/AJAX/MySQL/Kitchen sink guy had a posted salary maxing out at 65k.


#25

Basically, the only way to get the "non-shitty" rate is to find someone who knows what you're worth.

Yes. And part of that is marketing yourself appropriately so that people understand the value add. It's work, but it pays off when big companies that don't NEED to fuck around on the low end know where to turn.

Big ad agencies that do Flash work -- something else that's reasonably commodity -- will bill $150+/hour routinely because there are always clients that want the best vs. the good enough.


#26

Forgive me for being forward, but bull-fucking-shit. It's a perception problem on the part of hiring managers. Extrmely few (like < 1%) HR people are going to hire a PHP expert at twice the going rate of a PHP doofus, especially when there are hundreds of doofuses lining up to fill the slot. Unless you're talking about going out and drumming up business (which is fine, but different), we are not covering the same bases here. I haven't been to the interview yet (full time or contract basis) where there was anything like that kind of premium for an expert. I've even seen them balk at $20 an hour. In California.


#27

It's not at all unheard of for good programmers to contract for $100+ an hour. You can disbelieve it if you like, I know people who've done it. A top end programmer can also get literally 10x as much work done as someone who's merely good, let alone a PHP scrub. This is what even getting into architectural talent, which most programmers simply can't do well.

If I'm looking to architect a serious project, I don't really care how many "doofuses" line up, it's worth it to get someone good.


#28

If I'm looking for people for a serious project, PHP isn't going to be in the running, and a PHP-oriented resume will be the kiss of death. Not so much because I've got it in for PHP (although I'm not fond of it), but because there's no good way for me to separate the wheat from the chaff of crappy PHP monkeys. HR just is going to send me an endless stream of "experts" who couldn't write "Hello, world" in without five bugs and a couple of remote root exploits.

Look for Python programmers, and at least the people I'll be getting aren't just engaging in flavor-of-the-month resume padding.


#29

That's precisely what I'm talking about. There's a huge difference between working at what "the market" deems you're worth, and working at what you tell the market you're worth. Most engineers do the former because they feel talent should speak for itself and I poo-poo things like marketing, positioning, and, God forbid, self-aggrandizement.

I know for a fact that high quality PHP coders routinely get $50-75/hour and true bad ass motherfuckers can get $100-150/hour. I say this as someone who has tried to find good quality talent and see about 90+% failure rate in the technical interview, and I suck at PHP.

If you're some monkey on RentACoder that "knows" PHP along with ASP.Net, J2EE, ASP, Python, RoR, CSS, MySQL, XHTML, blah blah blah -- i.e. someone that knows a lot of acronyms but doesn't do enough projects to really understand any single field in depth -- then expect $15-20/hour.

If you focus on one area exclusively and become a master of it -- the kind of guy that can write a good book on the subject -- then you can command a shit load more.

This is true of CSS as well -- and you think PHP is fucking commodity?! Any monkey can hack enough CSS to get things looking correctly on like that one version of IE6 on Win2K or whatever, but the real bad asses -- the Dan Cederholms and the like -- don't work for $50/hour.

But if you simply look for job offers and then apply, then you're dealing with HR monkeys and you will lose. I have a reasonably positive reputation as a game programmer, and the few times I've sent resumes to game companies that have posted job offers I typically won't get any interest because HR tossed my resume since I don't have a degree.

Now I could bitch that that's unfair and fucked and resign myself to taking whatever shitty job comes my way...or I take the strengths I have, realize that the system in place isn't going to give me what I want, and change how I approach the system to my benefit.

Stuff like this is talked about over at http://www.gamingmercenaries.com (currently ugly, sorry -- stock WP theme)


#30

I admit, I really have trouble believing that any PHP programmers have made $100 an hour post-dot.com collapse working in PHP. Doesn't mean it doesn't happen, but I have my sincere doubts.

Well, fair enough then. I was speaking more about working in a day to day job environment.


#31

Doesn't mean it doesn't happen, but I have my sincere doubts.

I personally know several, and I've also had multiple programmers quote me rates higher than that. All were very good. I've also hired mediocre ones for $15/hour off of RentaCoder or ODesk.

Part of it is choosing your clientele and whom you want to target -- just because you can't get the rates doesn't mean others can't or won't. I have friends that make $300+/hour in the game industry -- other friends simply can't believe it, mostly because they're thinking "If it was possible, well, sheesh, I would be making that much, right?"


#32

It's great, but precisely because it is less popular there are far more widgets/plugins. For example, with TG to validate forms you need to either use a form widget which is inflexible, or formvalidate separately, which almost doubles the amount of code and makes the templates more verbose.

For the OP: since it's clear you don't want to be learning python/ruby for web programming, I would just go with python. It's more php-like than ruby (blocks? closures! oh my), the forced whitespace make code a lot more easier to read, and because its in more widespread use than ruby you will find more non-web libraries for it.


#33

The availability of libraries for Python is great (one of the strengths of Perl as well, but I think Python scales to larger programs and teams much better). My wife wanted to make some Pokemon bingo cards for my oldest son, so I hacked a 36 line Python program that takes a set of different pokemon images, randomly shuffles them into 5 columns (fire, water, electric, psychic, grass) based on type, creates an image, scales it, then displays it.

took about 30 minutes to write, and I didn't have any experience with PIL (Python Image Library) at the time.


#34

Ok, now this is a neat python workout:

The Python Challenge


#35

Arise!

I have a Python question if anybody has a moment to help. Total newbie by the way.

I don’t quite understand how you can make one function access an object that was created in another function.

Here’s my code. I have a character class named Dude and an instance named Joe. (Discourse doesn’t like indentation but it’s in the original code.)

class Dude():
hit_points = 1

def MakeDude():
Joe = Dude()

def PrintDude():
print(Joe.hit_points)

MakeDude()
PrintDude()

If I run the code I get a NameError telling me that ‘Joe’ is not defined.

Do I have to create the instance globally, outside of a function? Is there a way I can pass Joe into PrintDude()?

Thanks in advance for taking the time to answer what is probably a painfully stupid question…


#36

Yes there is a way to pass a parameter in. Quick samples since I’m on my phone

def MakeDude():
  return Dude()

def printDude(player):
  print(player.hit_points)

Joe = MakeDude()
printDude(Joe)

#37

Thanks!


#38

I freakin’ love Python, have been programming my project on it the last year or so. To me it’s even better than C++ . . . and the libraries! There are free libraries out there for just about anything complicated you want to do, that people have thought of. Many of these are included in the next release of Python. So like programming something to parse a .csv is a minor PITA, but just “import csv” and there you go, just study the syntax and you are ready to go. It’s like that for lots of useful functions, just poke around and typically you can find one. That’s like the number one answer on stackoverflow: “Have you tried this library?”

This plus the fact the scientific and academic communities have fully embraced it and you get a great language. Other languages are of course better at doing specific things, but eventually some clever genius will come along and replicate that in python.

The last thing is, I kind of like the indents and syntax and the way it looks. It’s nice and easy to follow code in Python for me, something I sometimes struggle with in other languages. I can’t explain it exactly without thinking about it more deeply, but it’s just easier to follow flow control with it because of the indentation/whitespace layout. Curlieques (that’s what I always call them, they are actually called braces or curly brackets) just aren’t the same!


#39

Python gurus, help!

I’m trying to build a roguelikey sort of thing, and working on the map generation stuff.

Here is a very simple class describing a room (pasting an image because Discourse doesn’t print the correct formatting):

If I make two rooms one after the other, they end up with identical init values.
For example, suppose I type:

room1=dungeonRoom()
room2=dungeonRoom()
print(room1.origin)
print(room2.origin)

I will get the same number both times.

I can work around this by explicitly passing in the random.randint arguments when I create each room instance. But why do I have to do that? Why doesn’t init create a distinct set of random values for each new instance? Why does it do the randomization once, and then simply copy the exact same values in the second instance?

/confused


#40

How and where are you calling random.seed()?