Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 358 359 [360] 361 362 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 886623 times)

Maklak

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5385 on: January 25, 2014, 02:22:27 am »

Interestingly, my friend who programs in Python reacted to seeing DF RAWs by trying to convert them to JSON, then being unhappy about tabs not having any meaning :) His reaction to my hand-written Perl code reading some DF tags (and skipping others) was that this language is weird and DF should use JSON instead, so the RAWs can be easily read into a nested hash with one command. My answer was that I'd still need to manually walk that hash (and know it's structure) to do anything useful with it.

He can write in Python one-liners that are pretty obfuscated. For example this code to compute xor from 0 to n:
def rozwiazanie_najszybsze(t):
     n=len(t)+1
    return reduce(int.__xor__,t,0)^[0,n^1,1,n][n&3] 

In my second job, the boss loved perl and some of his subordinates strongly preferred Python. My conclusion was that the languages are pretty equivalent and the choice between them is mostly a matter of having more experience in one or the other.

Personally I use Perl, but constantly bump into some gotchas or just do things by trial, error and print until they work. The lack of { } in Python is a deal-breaker for me, but I sometimes wonder if the grass is greener on the Ruby side of things.
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5386 on: January 25, 2014, 03:12:27 am »

* da_nang reads latest replies.
* da_nang is hugging GSON tightly.

Spoiler: JsonSerializer (click to show/hide)
Spoiler: JsonIO (click to show/hide)

Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5387 on: January 25, 2014, 10:57:17 am »

The lack of { } in Python is a deal-breaker for me, but I sometimes wonder if the grass is greener on the Ruby side of things.

I like python, but using indents to denote scope was the dumbest idea ever.  I'm pretty sure its the reason why there are no multiline lambda's in python, and why the web frameworks don't let you embed python into html.  Whenever I use python instead of ruby the one thing I really miss having is multiline lambdas.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #5388 on: January 25, 2014, 06:35:20 pm »

PTW because going to school to become a programmer.
Logged

MrWillsauce

  • Bay Watcher
  • Has an ass that won't quit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5389 on: January 25, 2014, 06:38:41 pm »

Am I the only person who decided to learn python because of Hulk Hogan?
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5390 on: January 25, 2014, 06:43:47 pm »

Why would you learn Python because of Hulk Hogan?
Logged

MrWillsauce

  • Bay Watcher
  • Has an ass that won't quit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5391 on: January 25, 2014, 06:49:16 pm »

Because of his 24-inch pythons.

Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #5392 on: January 25, 2014, 06:57:24 pm »

Duh.
Logged

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #5393 on: January 26, 2014, 10:46:30 am »

Spoiler (click to show/hide)
Why do I do this to myself? I get the brilliant idea of making a program to save myself time, then realize 5 hours into fiddling with linker settings and mashing ui bugs that I've wasted more time making the program than I'll ever save by using it.

C++ makes you a masochist I guess.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5394 on: January 26, 2014, 10:53:33 am »

Congrats, you're a programmer!
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5395 on: January 26, 2014, 11:08:54 am »

Like most things, xkcd has a comic about it:
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5396 on: January 26, 2014, 11:18:22 am »

Spoiler (click to show/hide)
Why do I do this to myself? I get the brilliant idea of making a program to save myself time, then realize 5 hours into fiddling with linker settings and mashing ui bugs that I've wasted more time making the program than I'll ever save by using it.

C++ makes you a masochist I guess.
Distribute the project, save the time of a lot of people?
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5397 on: January 26, 2014, 11:42:07 am »

I'm pretty sure xkcd has at least five comics about exactly this topic, including two graphs and a table.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5398 on: January 26, 2014, 11:45:05 am »

I'm pretty sure xkcd has at least five comics about exactly this topic, including two graphs and a table.
Isn't that true about everything?
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #5399 on: January 26, 2014, 11:56:15 am »

Distribute the project, save the time of a lot of people?
I was thinking about doing that. It depends on how useful it ends up being. The only reason I'm making it is because I couldn't find anything like it on the internet. It's a sprite animation editor; there are plenty of programs that call themselves that, but they're also bloated with features and are trying to be paint programs.

I didn't want a pixel art paint program, I just wanted a quick and intuitive sprite animation editor. What this program does is load and save a tiny binary file format I made to interface with a sprite animation class (which I also made). It's just a quick way to take an image file, specify an animation from it, and display it onscreen after loading it in another program. Without a huge bloated framework I have to graft onto my existing codebase.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU
Pages: 1 ... 358 359 [360] 361 362 ... 796