Bay 12 Games Forum

Please login or register.

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

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

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5355 on: January 23, 2014, 12:31:44 pm »

Do you have access to the error logs?  I can't think of anything to suggest right now, but sometimes the error log can contain surprises when this sort of thing crops up.
Logged
Through pain, I find wisdom.

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5356 on: January 23, 2014, 12:40:06 pm »

Might just be me mis-guessing what you are trying to do, but if you are trying to set the cookie when its null, then you should be using == instead of !=.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5357 on: January 23, 2014, 01:52:20 pm »

Tabs ftw. I don't see hwo anyone would prefer hitting space 4 times over hitting tab once. Tabs are just so much easier to count.
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.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5358 on: January 23, 2014, 02:02:40 pm »

Tabs ftw. I don't see hwo anyone would prefer hitting space 4 times over hitting tab once. Tabs are just so much easier to count.

If anyone hits space multiple times, they're not doing it right. Any decent editor will allow you to set it up so that one press of tab will insert X spaces and pressing backspace at certain levels will delete those same X spaces.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5359 on: January 23, 2014, 02:03:36 pm »

Tabs ftw. I don't see hwo anyone would prefer hitting space 4 times over hitting tab once. Tabs are just so much easier to count.

If anyone hits space multiple times, they're not doing it right. Any decent editor will allow you to set it up so that one press of tab will insert X spaces and pressing backspace at certain levels will delete those same X spaces.
This is obviously a good solution too :P
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.

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #5360 on: January 23, 2014, 02:39:30 pm »

In theory, an ideal solution would be to use the tab character to denote indentation and then spaces to denote alignment inside scope (e.g when parameters are spread over multiple lines). In practice, I've not seen any IDEs that allow for this with any ease...

Personally I do try and do this though.
« Last Edit: January 23, 2014, 02:50:55 pm by MorleyDev »
Logged

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5361 on: January 23, 2014, 02:42:01 pm »

Best solution:  Only use 1 space for indentation, then tabs and spaces are equivilent.   :P


(Just kidding,  I use two space sized tabs.)
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

freeformschooler

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5362 on: January 23, 2014, 02:51:13 pm »

Might just be me mis-guessing what you are trying to do, but if you are trying to set the cookie when its null, then you should be using == instead of !=.

This was actually the problem. It worked on a local server because the cookie was previously set elsewhere. Sometimes the mistake is so dumb you don't think to look.
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #5363 on: January 23, 2014, 02:52:05 pm »

I use two space sized tabs.

2-space indentation gives me a migraine. I go for 4-spaces, since with 2 everything's too cluttered together, for me it's a similar experience to reading a giant wall of text without proper paragraphs: Unapproachable and painful. It actually does give me a headache, unfortunately.
Logged

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5364 on: January 23, 2014, 02:57:39 pm »

My wife and I were actually doing a join project and had issues with indentation. My tabs were equivalent to 4 spaces, hers were equivalent to 5.

Naturally, due to gender roles*, I changed for her.


*not really
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5365 on: January 23, 2014, 03:52:04 pm »

I use two space sized tabs.

2-space indentation gives me a migraine. I go for 4-spaces, since with 2 everything's too cluttered together, for me it's a similar experience to reading a giant wall of text without proper paragraphs: Unapproachable and painful. It actually does give me a headache, unfortunately.

Yeah, I hear that now and again.  I actually would prefer 3 spaces, but I can't stand the idea of having an odd number of spaces for some reason, and 4 feels like I'm wasting space on my screen.  I think I'm just kinda weird that way.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5366 on: January 23, 2014, 03:53:17 pm »

[double post]
« Last Edit: January 23, 2014, 03:55:45 pm by Levi »
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5367 on: January 23, 2014, 06:40:52 pm »

Depends. I have 4 in PHP, 2 in C++, and perl is just a mess.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5368 on: January 23, 2014, 06:54:13 pm »

I believe I usually go for tabs formatted as 4 spaces.  If my current editor bungles the formatting I just don't mess with it.

Really though, I just format things as much as I can so that even though I use tabs it doesn't mess things up much if two editors use different spacings for them.  I rarely use comments tab-aligned beside lines of code for example.

I don't think anything short of my boss mandating spaces instead of tabs will get me to change.  It just bothers the heck out of me when I run into spaces instead of tabs.  I've yet to use an IDE that supported removing chunks of them like tabs with a backspace, for example.  Or copy-pasting things.
Logged
Through pain, I find wisdom.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5369 on: January 23, 2014, 07:45:37 pm »

Tabs are the best thing, and Python people are weird. First you make indenting really important and mandatory, and then you use spaces instead of tabs? Weird, I say.
Logged
Pages: 1 ... 356 357 [358] 359 360 ... 796