Author Topic: Anyone use Python?  (Read 15801 times)

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Anyone use Python?
« Reply #45 on: December 03, 2012, 12:09:42 PM »
Java is the same way.  I fucking hate dealing with dates in Java.

on a somewhat unrelated note, I was getting really annoyed with Javascript for a project recently that had a LOT of date formatting so I made a function that works just like the PHP Date function that I know and love.

https://gist.github.com/4120120

kinda off topic, but just thought I'd share
Since I almost always have jquery and jqueryui loaded: http://api.jqueryui.com/datepicker/#option-dateFormat

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Anyone use Python?
« Reply #46 on: December 03, 2012, 02:22:33 PM »
In the Java world, use joda time library for dates. Much better.
This signature intentionally left blank.

JaWiB

  • definitelys definately no MacGyver
  • Jackass V
  • Posts: 1443
  • Karma: +57/-4
Re: Anyone use Python?
« Reply #47 on: December 04, 2012, 09:54:39 PM »
So what's the deal with Python 3? Should I be using that instead of 2.whatever? Everything seems to use python 2...

Perspective

  • badfish
  • Jackass In Charge
  • Posts: 4635
  • Karma: +64/-22
    • http://jeff.bagu.org
Re: Anyone use Python?
« Reply #48 on: December 05, 2012, 10:48:52 AM »
Python 3 broke backwards compatibility which could affect your ability to use existing libraries. I'm still sticking with 2.x for everything I do.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Anyone use Python?
« Reply #49 on: December 05, 2012, 08:31:08 PM »
Python 2.x is still what's mostly supported everywhere. Python 3 is the new hotness bit looks like it might take a while for it to be the default unless you're running your own server.

I'm using 2.x for my stuff, but from what I gather you can code in a py3 manner to make the code work in both.
This signature intentionally left blank.

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Anyone use Python?
« Reply #50 on: December 23, 2012, 05:57:12 PM »
I'd like to take a moment during this holiday season to say:  I'm sorry, I was wrong about Python.  It is a pretty damn nice language.

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Anyone use Python?
« Reply #51 on: December 23, 2012, 06:00:35 PM »
You may be tempted to start writing

from ls331 import *

This is generally frowned about. Python people have a hard-on for explicit imports.

At work we just went through that discussion.  We had something like:
Code: [Select]
from handlers import (user_routes, quest_routes, etc etc etc,
                                   more routes, even more routes, routes,
                                   yet even more routes)
Once it got to three lines I put in a PR request to just change it to
Code: [Select]
from handlers import *
The only real downside is that flake8 can't tell us if we fucked up one of the handler names now.  But unit tests handle most of that.

JaWiB

  • definitelys definately no MacGyver
  • Jackass V
  • Posts: 1443
  • Karma: +57/-4
Re: Anyone use Python?
« Reply #52 on: December 24, 2012, 12:25:03 AM »
Funny, I was just thinking that your import statements could get ridiculously long in certain cases and wondering at what point I should break that rule.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Anyone use Python?
« Reply #53 on: December 24, 2012, 10:03:00 AM »
That kind of problem also make me wonder if that module might be responsible for too much stuff. Sometimes it might be appropriate but I think the explicit import method makes you think a bit more.
This signature intentionally left blank.

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Anyone use Python?
« Reply #54 on: December 24, 2012, 10:12:37 AM »
That kind of problem also make me wonder if that module might be responsible for too much stuff. Sometimes it might be appropriate but I think the explicit import method makes you think a bit more.
In our case I don't think it is responsible for too much.  Our other options would be to use fewer handler files or to do
Code: [Select]
import handlers

handlers.user_routes.bleh
which would be more specific.

Mike

  • Jackass In Charge
  • Posts: 11248
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Anyone use Python?
« Reply #55 on: February 13, 2013, 01:56:45 AM »
So the last week or so I've been doing some JS and been getting annoyed with having to use {} instead of just indenting it.  Oh how things change :D