Follow

programming pro tip 

in programming, when you put naked numerical values directly in the code it is called a "magic value". you will regret doing this 100% of the time. you should always just use a named value instead.

i just spent two hours debugging because i didnt realize i was scaling an object down by a factor of 4

re: programming pro tip 

bad programming is just tricking your future self.

programming pro tip 

@dankwraith

// Might change later
const FOUR = 4;

programming pro tip 

@dankwraith SO true. I'm pretty good after almost 40 years of programming to put all magic values in named constants at the top, but still... sometimes in the heat of the moment I "fix" something with a magic value that typically will cost me hours of debugging in the future.

programming pro tip 

@dankwraith Good thing we don't have any such hard-wired constants in Masto's codebase, ne? ^_^;

Sign in to participate in the conversation
monads.online

monads.online is a community for goth nerds, aka people who are interested in the intersections of math, art, programming, philosophy, and related topics. this does not include your techbro ass. we also enjoy a healthy amount of shitposting. if you are a techno-materialist, technocrat, or some flavor of capitalist, don't even bother applying. if you are interested in an account please fill out an application, detailing why you are interested in joining, what you have to bring to the community, and your prior, if any, accounts on the fediverse.