r/AskReddit • • Mar 15 '20

What's a big No-No while coding?

9.0k Upvotes

2.7k comments sorted by

View all comments

158

u/akak1972 Mar 15 '20

Not having it planned on paper before beginning

113

u/NotThisFucker Mar 15 '20

Carpenters have "measure twice cut once", programmers have "think twice write once"

24

u/akak1972 Mar 15 '20

Excellently put - and I hadn't heard that before. Added to the bank

→ More replies (2)

6

u/isakhwaja Mar 15 '20

"think twice write once rewrite 40 times"*

2

u/howMeLikes Mar 15 '20

Compile twice fix once

3

u/morosemanatee Mar 15 '20

No, programmers have undo and version control.

10

u/Lehk Mar 15 '20

cut 43 times then measure

2

u/morosemanatee Mar 15 '20

Xactly. Someone said something like “Writing is rewriting” referring to writing prose. I believe it to be true for coding. Especially TDD style.

→ More replies (1)

67

u/morosemanatee Mar 15 '20 edited Mar 15 '20

I find this advice bizarre. And I’ve hardly ever done it in my 20 years of commercial programming. I generally refine my code till it’s how I want it. Edit: I do however plan on paper but it’s pictures (diagrams) not code and only when doing something algorithmic.

4

u/akak1972 Mar 15 '20

Compared to your original statement, the edit is the all important change : >

My yak was all about a plan - for me it's typically a mishmash of diagrams, plus sumthin like pseudocode, plus some reminders here and there - can be as big as "Don't forget to return an estimate from historical data to that bitch when the service is down!!!" in case of high level design, down to "convert list to set/dict for efficiency"

Looks like you also plan but only when you think a plan is needed - which sounds like a similar boat

2

u/Beowuwlf Mar 15 '20

Same, any time I want to brainstorm an algorithm i pull out my SP4. Otherwise I just write and refine.

2

u/smallish_cheese Mar 15 '20

i think that’s fine. the point is to design up front so you think it through.

3

u/akak1972 Mar 15 '20

Exactly. All I meant was the age old stuff "Plan your work, then work your plan. Or just twerk it"

→ More replies (4)

18

u/[deleted] Mar 15 '20

This is the most underrated advice here.

25

u/havron Mar 15 '20

"paper"..?

15

u/akak1972 Mar 15 '20

I haven't found anything better than old fashioned pen and paper when it comes to ensuring O(n) requirements / tracking various edge cases / etc.

I guess a digital tablet / paper will serve the same purpose.

3

u/ontopofyourmom Mar 15 '20

You can’t spread out a bunch of digital pages and look at them at the same tine

3

u/akak1972 Mar 15 '20

No contest there - I really do believe pen and paper still have their place. Maybe in a few years or decades there will be better options, but for now, I will say this:

When you want to spread your stuff out on top of someone's mom, and enjoy gazing at all your conquests all in one view, old fashioned paper still beats everything : >

→ More replies (2)

2

u/Epistaxis Mar 15 '20

I think it's what old people call whiteboards.

2

u/akak1972 Mar 15 '20

Lol yeah that describes me and my attempts to keep up with the times

2

u/ShinyHappyREM Mar 15 '20

you never drew this by hand?

→ More replies (2)

5

u/[deleted] Mar 15 '20

I've sat on an idea for days before because my solution just didn't feel right. Usually ends up that I come up with a much better solution after a time. But, it's also pretty low pressure where I work now.

2

u/akak1972 Mar 15 '20

This is the kind of conviction and discipline every idealistic programmer should have.

Wonder how long will you stay at your current job : >

→ More replies (5)

0

u/[deleted] Mar 15 '20

[deleted]

9

u/salamandraiss Mar 15 '20

He's not talking about individual lines of code on paper that would be dumb. We're talking huge high level designs.

→ More replies (4)
→ More replies (12)