Author Topic: How to think like a programmer — lessons in problem solving  (Read 2568 times)

0 Members and 1 Guest are viewing this topic.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2141
  • class keyThumper<T>:ILazy<T>
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

MickD

  • King Gator
  • Posts: 3638
  • (x-in)->[process]->(y-out) ... simples!
Re: How to think like a programmer — lessons in problem solving
« Reply #1 on: April 20, 2018, 09:08:31 PM »
:thumbs up: :)
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Re: How to think like a programmer — lessons in problem solving
« Reply #2 on: April 21, 2018, 12:17:24 PM »
Good read.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to think like a programmer — lessons in problem solving
« Reply #3 on: April 21, 2018, 12:54:00 PM »
Do not try to solve one big problem. You will cry.

Gold.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to think like a programmer — lessons in problem solving
« Reply #4 on: April 21, 2018, 01:10:26 PM »
LUCK
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: How to think like a programmer — lessons in problem solving
« Reply #5 on: April 21, 2018, 01:38:30 PM »
“Given input X, what are the steps necessary to return output Y?”

Don't we all follow that concept?


BTW the Understand/Plan/Divide paragraphs reminded me of MP's (well structured)coding style.
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2141
  • class keyThumper<T>:ILazy<T>
Re: How to think like a programmer — lessons in problem solving
« Reply #6 on: April 21, 2018, 04:18:56 PM »
Dividing the task into manageable portions is a well established process ..

"How Do You Eat An Elephant?: One Bite at a Time"
https://www.amazon.com/How-Do-You-Eat-Elephant/dp/1595262040
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

JohnK

  • Administrator
  • Seagull
  • Posts: 10651
Re: How to think like a programmer — lessons in problem solving
« Reply #7 on: April 21, 2018, 06:14:08 PM »
“Given input X, what are the steps necessary to return output Y?”

Don't we all follow that concept?


BTW the Understand/Plan/Divide paragraphs reminded me of MP's (well structured)coding style.

No! As an example, if following that mindset you'd end up with several bullet points. Each of those bullet points "should" be a seperate procedure (a small procedure for each task). You hardly/rarely see this "proper" structure; you often find procedures structured in a rambling fashion (e.g. "SolveThisIssueAndDrawLinesWhileMakingAViewport").

That's because ha has more years of experience then the swamp has members. *wink* And, he was probably around when the computer monitor pixel density was 1.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MickD

  • King Gator
  • Posts: 3638
  • (x-in)->[process]->(y-out) ... simples!
Re: How to think like a programmer — lessons in problem solving
« Reply #8 on: April 21, 2018, 08:45:57 PM »
The 'think first' part of the article reminds me of what Rich Hickey (creator of Clojure) calls 'hammock driven development' :)
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to think like a programmer — lessons in problem solving
« Reply #9 on: April 21, 2018, 09:55:53 PM »
BTW the Understand/Plan/Divide paragraphs reminded me of MP's (well structured)coding style.

My "style" is one born of necessity, experience and the product of much review early on of code by Ethan Winer, Pierre Lemire and Tony Tanzillo, the latter being comparable to what Dr. Jordan Peterson is to psychiatry circles today: outspoken, extraordinarily deep and organized thinker and overall brilliant practitioner.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to think like a programmer — lessons in problem solving
« Reply #10 on: April 21, 2018, 10:03:15 PM »
The 'think first' part of the article reminds me of what Rich Hickey (creator of Clojure) calls 'hammock driven development' :)

Love it, I've always dubbed that my "look out the window time" ...

« Last Edit: April 21, 2018, 10:41:04 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

MickD

  • King Gator
  • Posts: 3638
  • (x-in)->[process]->(y-out) ... simples!
Re: How to think like a programmer — lessons in problem solving
« Reply #11 on: April 22, 2018, 05:08:14 PM »
"Now easy as pie!"

:-D
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien