News for hackers. Stuff that matters.
Re:A minimalist lifestyle does not make you a better person by edw519 on Thursday October 07, 2010 @10:42AM (#1767970)
A minimalist lifestyle does not make you a better person

But a minimalist coding style does make you a better programmer.

I really don't mind a few extra Philips screwdrivers, kitchen knives, or pairs of shoes in my house, but I every superfluous bit of code in my repository drives me nuts.

Others say I go overboard and they're probably right, but I can't help myself.

If a 6 character variable name can be shortened to 5 characters without losing meaning, then I do it. Same thing with labels and function names. If I find the same line of code twice, I write a function (but only after whipping myself). Complex If Statements are replaced by Case. Complex Case Statements are replaced by arrays and pointers. Two programs look alike? Replace them with one parameter-driven program. Two forms look alike? Replace them with a flexible form app. Reports? Same thing.

Old data? Archived! Old programs? Archived! Old notes? Archived! And not one trip to Goodwill, just to my e: drive. I'm so proud of myself when I can fit the software needed to run a $100 million company on a 256K thumb drive.

There must be a 12 step program for people like me. But then, by the time I was done with it, it would be a 7 step program.

Re:A minimalist lifestyle does not make you a better person by Raphael_Amiard on Thursday October 07, 2010 @11:35AM (#1768191)
> If a 6 character variable name can be shortened to 5 characters without losing meaning, then I do it

While i totally agree with the general sentiment of your post, i'm really not sure about this one.

Or rather, im rly not sure abt dis one ;)

It's all about balance really, and very often this balance is only subjective, even if we generally don't like this idea

Re:A minimalist lifestyle does not make you a better person by T_S_ on Thursday October 07, 2010 @06:11PM (#1769742)
Interesting example. In Mathematica, they opted for fully spelled out function names with caps to indicate new words for minimal ambiguity. For example LinearSolve is not linsolve or lnsolve or lsolve or even ls as it is in other languages or libraries. This makes the names of standard mathematical functions easier to remember or guess at.

Your minima may not be my minima!

Re:A minimalist lifestyle does not make you a better person by tome on Thursday October 07, 2010 @01:27PM (#1768600)
Sure, but to be charitable to edw519, it's possible to interpret the remark as "can be shortened ... without compromising meaning".
Re:A minimalist lifestyle does not make you a better person by Raphael_Amiard on Thursday October 07, 2010 @01:49PM (#1768698)
Definitely, that's why i said i agreed with the general sentiment. I generally reason in exactly the same way so i understand from where GP is coming from.
Re:A minimalist lifestyle does not make you a better person by threepointone on Friday October 08, 2010 @12:06PM (#1772103)
Here's an example regarding this that affects me in javascript -

var t = this;

and then every time I refer to 't', I save 3 bytes. It's something js compressors can't do, and every byte counts in the end :)

Re:A minimalist lifestyle does not make you a better person by robryan on Thursday October 07, 2010 @10:45AM (#1767984)
Going a bit off topic but I really hate when you have a bit of code you can either have 2 functions with some repetition or one function that gets ugly because of the number of if statements required based on parameters. Both options feel suboptimal.
Re:A minimalist lifestyle does not make you a better person by HeyLaughingBoy on Thursday October 07, 2010 @01:04PM (#1768483)
I've found that sometimes passing in a function/function pointer as a parameter makes this a lot cleaner.
Re:A minimalist lifestyle does not make you a better person by sprout on Thursday October 07, 2010 @11:49AM (#1768240)
If a six character variable name is a real word and the 5 character variable name isn't, in my mind you've increased the number of objects in every statement that variable appears in from 1 to 5.

Now, there are some really common ones that are more or less idiomatic. i is iterator, ct is count. That said, those save a lot more than 1 character.

Re:A minimalist lifestyle does not make you a better person by fragmede on Thursday October 07, 2010 @10:48AM (#1767996)
> If a 6 character variable name can be shortened to 5 characters without losing meaning, then I do it.

So.... what, you get rid of vowels, web 2.0 style?

Re:A minimalist lifestyle does not make you a better person by jules on Thursday October 07, 2010 @01:24PM (#1768588)
The thing is that sometimes when you've removed the redundancy you end up with a program that's more complex than the one you started with.
Re:A minimalist lifestyle does not make you a better person by peterbessman on Thursday October 07, 2010 @05:30PM (#1769621)
Toward the end the author says:

"Simplicity" is a relative term, and perhaps inapt; try "convenience", which has more useful connotations.

The lifestyle he describes and the programming style you describe are both, in the final analysis, maximally convenient (ceteris paribus). While not as catchy as "minimalism," I think convenience maximization (or time-debt minimization, as Patrick McKenzie might say) is a worthy objective. Perhaps call it "enlightened laziness" for that added sparkle.

Re:A minimalist lifestyle does not make you a better person by MichaelGG on Thursday October 07, 2010 @01:02PM (#1768471)
If statements? Case statements? Arrays and pointers? If you want minimalism, pickup a functional language and go pointfree.