The Gang Garrison 2 Forum
June 18, 2013, 03:49:28 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Chat with us on IRC: http://ganggarrison.com/irc.html
Server: irc.esper.net, Channel: #gg2
 
   Home   Help Search Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 »
  Print  
Author Topic: Official PyGG2 Development thread  (Read 38145 times)
Phantom Brave
All Hail Classicwell
Designer
*****
Offline Offline

Posts: 9230


Another one --


WWW
« Reply #810 on: June 23, 2012, 04:29:12 am »

I don't want to live in a world where people refer to consts while talking about storing dynamic data
I really don't
« Last Edit: June 23, 2012, 04:29:43 am by Chartreuse » Logged

Glock Topic
Newbie
*
Offline Offline

Posts: 12



« Reply #811 on: June 23, 2012, 04:42:39 am »

no sir that is not how data types work

Yes sir, in Python bools, int's, None, str's among others are, in fact, immutable.


and tuples
Logged
nightcracker
NC
Hero Member
*****
Offline Offline

Posts: 519


PyGG2 dev


WWW
« Reply #812 on: June 23, 2012, 04:43:23 am »

I don't want to live in a world where people refer to consts while talking about storing dynamic data
I really don't

Assuming you're talking to me, I was talking about immutable, not constant.

Variable in Python's are more "names" for objects than anything. When I say a = 1 I assign the name "a" to 1. When I say a += 1 I'm actually saying a = a + 1, meaning I assign the name "a" to the value of "a" with one added. The int object with value 1 never changed.

This is also the reason the ++ operator doesn't exist in Python.
« Last Edit: June 23, 2012, 04:49:21 am by nightcracker » Logged

nightcracker
NC
Hero Member
*****
Offline Offline

Posts: 519


PyGG2 dev


WWW
« Reply #813 on: June 23, 2012, 04:47:27 am »

no sir that is not how data types work

Yes sir, in Python bools, int's, None, str's among others are, in fact, immutable.


and tuples

As I said, among other things Smiley (frozenset)
Logged

Orpheon
Moderator
*****
Offline Offline

Posts: 5867


Developer


« Reply #814 on: June 23, 2012, 04:50:44 am »

I still prefer integer constants for team stuff because there isn't really a good reason why to use bools and it forces us to use signed bytes in syncing (something I don't like) or some extra if conditionals.

If we allow None, we can't do easy if checking, so we'll have this
Code:
if team:
...
elif team == False:
...
else:
...
whilst with constants we would have
Code:
if team == constants.TEAM_RED:
...
elif team == constants.TEAM_BLUE:
...
else:
...

I prefer the latter. It's a lot more readable.
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
nightcracker
NC
Hero Member
*****
Offline Offline

Posts: 519


PyGG2 dev


WWW
« Reply #815 on: June 23, 2012, 04:52:22 am »

I agree with Orpheon here.
Logged

Orpheon
Moderator
*****
Offline Offline

Posts: 5867


Developer


« Reply #816 on: June 23, 2012, 04:54:46 am »

I agree with Orpheon here.
*Marks this in the historical PyGG2 chronicles.*
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
nightcracker
NC
Hero Member
*****
Offline Offline

Posts: 519


PyGG2 dev


WWW
« Reply #817 on: June 23, 2012, 04:55:39 am »

I agree with Orpheon here.
*Marks this in the historical PyGG2 chronicles.*

I was just going to edit my post saying "call the newspapers"  hehe.
Logged

Phantom Brave
All Hail Classicwell
Designer
*****
Offline Offline

Posts: 9230


Another one --


WWW
« Reply #818 on: June 23, 2012, 06:10:30 am »

I don't want to live in a world where people refer to consts while talking about storing dynamic data
I really don't

Assuming you're talking to me, I was talking about immutable, not constant.

Variable in Python's are more "names" for objects than anything. When I say a = 1 I assign the name "a" to 1. When I say a += 1 I'm actually saying a = a + 1, meaning I assign the name "a" to the value of "a" with one added. The int object with value 1 never changed.

This is also the reason the ++ operator doesn't exist in Python.
The int object with value 1 is a constant. The name "a" is a variable. I don't care about your semantics shit.
Logged

Glock Topic
Newbie
*
Offline Offline

Posts: 12



« Reply #819 on: June 23, 2012, 08:52:36 am »

I don't want to live in a world where people refer to consts while talking about storing dynamic data
I really don't

Assuming you're talking to me, I was talking about immutable, not constant.

Variable in Python's are more "names" for objects than anything. When I say a = 1 I assign the name "a" to 1. When I say a += 1 I'm actually saying a = a + 1, meaning I assign the name "a" to the value of "a" with one added. The int object with value 1 never changed.

This is also the reason the ++ operator doesn't exist in Python.
The int object with value 1 is a constant. The name "a" is a variable. I don't care about your semantics shit.
only a few values (0, 1, ..) have constants
remainder dynamically instantiated immutables
Logged
Phantom Brave
All Hail Classicwell
Designer
*****
Offline Offline

Posts: 9230


Another one --


WWW
« Reply #820 on: June 23, 2012, 10:04:28 am »


how is it hard to understand that I don't fucking care about your language's semantic bullshit? Every other c-like language in the world calls them literals, and literals are constants. Changing the name doesn't do anything. Caring about the name being different when someone calls it the other thing just makes you a fucking jackass. Abstraction is your friend. Embrace it.
Logged

RedBluYellow
Guest
« Reply #821 on: June 23, 2012, 10:13:48 am »


how is it hard to understand that I don't fucking care about your language's semantic bullshit? Every other c-like language in the world calls them literals, and literals are constants. Changing the name doesn't do anything. Caring about the name being different when someone calls it the other thing just makes you a fucking jackass. Abstraction is your friend. Embrace it.

that image
Logged
NAGN
Developer
******
Offline Offline

Posts: 16904


Yeah so now I have an idea


« Reply #822 on: June 23, 2012, 10:50:46 am »

uh yeah

you know what fuck pygrafix; today I'm going to rework the font system so we can eliminate that dependency all together just so I don't have to compile it on my ubuntu laptop

Cheesy
Logged



[im
Orpheon
Moderator
*****
Offline Offline

Posts: 5867


Developer


« Reply #823 on: June 23, 2012, 11:02:44 am »

uh yeah

you know what fuck pygrafix; today I'm going to rework the font system so we can eliminate that dependency all together just so I don't have to compile it on my ubuntu laptop

Cheesy
^ Pro problem solving.
Logged

Your mind is software. Program it.
Your body is a shell. Change it.
Death is a disease. Cure it.
Extinction is approaching. Fight it.
Glock Topic
Newbie
*
Offline Offline

Posts: 12



« Reply #824 on: June 23, 2012, 04:13:47 pm »


how is it hard to understand that I don't fucking care about your language's semantic bullshit? Every other c-like language in the world calls them literals, and literals are constants. Changing the name doesn't do anything. Caring about the name being different when someone calls it the other thing just makes you a fucking jackass. Abstraction is your friend. Embrace it.
literals are literals. they can instantiate both immutable and mutable objects. in c, they are values. c doesn't have references.
literals are not constants. literals are a nice way to specify a new object
want a non-constant literal example? [] in python.
in python, c#, gml, js, and probably a bunch more, there are "mutable" and "immutable" objects.

learn some stuff about programming.
Logged
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.321 seconds with 19 queries.