# What is your coding style?



## sossego (Nov 2, 2013)

Chaotic.


----------



## wblock@ (Nov 2, 2013)

By the third rewrite, elegant.  Sometimes the second rewrite.


----------



## Savagedlight (Nov 2, 2013)

Functional but hard-coded prototype at first, open-ended API which can be used like Lego bricks some time later.


----------



## freethread (Nov 2, 2013)

Simply perfect.


----------



## kpedersen (Nov 2, 2013)

The code I write on Wednesday is pretty good. The rest of the time it's crap.


----------



## fonz (Nov 2, 2013)

Anal. It can always be made just that little bit better (whatever exactly "better" means).


----------



## Juanitou (Nov 2, 2013)

Absent.


----------



## qsecofr (Nov 3, 2013)

Prosaic.  With comments that answer "why?" more than "what?" or "how?". I want a person, upon first exposure to the source code, to be able to understand the idea of it - much like reading a book, instead of reading program source code.


----------



## beatgammit (Nov 3, 2013)

I don't always test my code, but when I do, I do it in production


----------



## Savagedlight (Nov 3, 2013)

beatgammit said:
			
		

> I think this sums it up:
> 
> [img]https://www.thinkgeek.com/product/f141/[/img]



Clever. Very clever.


----------



## ronaldlees (Nov 3, 2013)

*Programming potpourri*

I've been immersed into different programming cultures over the years... and when I've been particularly impressed with a style, I morphed it into the whole.  I did this when I saw what I liked, and eventually smooshed all those different templates of approach into something I think is uniquely my own.


----------



## sossego (Nov 3, 2013)

ronaldlees said:
			
		

> smooshed


Now this is a goodly word.


----------



## zspider (Nov 4, 2013)

kpedersen said:
			
		

> The code I write on Wednesday is pretty good. The rest of the time it's crap.



Huh, sounds like a case of the Wednesdays?:\


----------



## NewGuy (Nov 4, 2013)

In one word, practical. I'm not one to do massive re-writes of existing code to improve its modularity or style. Once code works, I like to leave it alone. I'm also cautious. A lot of my work is bug-fixes and I try to avoid making big changes, preferring small tweaks where possible. I also prefer commenting out code to deleting it.


----------



## chatwizrd (Nov 4, 2013)

Spaghetti...


----------



## graudeejs (Nov 4, 2013)




----------



## j4ck (Nov 5, 2013)

chatwizrd said:
			
		

> Spaghetti...


Me too . But I'm trying to reach Lasagna coding skill :e.


----------



## newbie32 (Nov 5, 2013)

```
# intro comment of module
class something
begin
  # description of locals
  # <-- Note there are only 2 spaces per indent level
  # all privates start with "my" or "my_"
  myLocal as whatever
  # all protected/shared start with "our" or "our_"
  ourShared as whatever
  # all globals are just a label
  globalVar as whatever
  
  method something as void
  begin
    # describe what is being attempted which ultimately is really only a guideline
    do somestuff
    do some more stuff
    # describe why what you're doing here doesn't match with the method description
    do contrary stuff
    do some more stuff that probably makes some sense
  end
end

...
```
I also tend to prototype everything I write in pseudo-code to avoid the overhead of "crappy" looking code. It doesn't always work once I get started but I don't like leaving it to chance.


----------



## igorino (Nov 10, 2013)

Dadaist.


----------



## Carpetsmoker (Nov 11, 2013)

I always try to write my code in a way that's good for my job security.


----------



## Crivens (Nov 11, 2013)

Carpetsmoker said:
			
		

> I always try to write my code in a way that's good for my job security.



And that is why people like me are tormented with coding style guides with more than 130 pages, defining which _i_ to dot how and what not... All that, when K&R is the first and last word in styles.

Ok, I deviate from it when I need to, but I do not see any reason to be too detailed about the style. As long as I can read it, and others can understand it, it's OK by me.


----------



## igorino (Nov 16, 2013)

The six most common species of code.


----------



## break19 (Nov 16, 2013)

I start off strong, but never actually finish anything worthwhile.


----------

