Skip to main content
Participant
September 2, 2015
Answered

How to built logic of any program?

  • September 2, 2015
  • 3 replies
  • 858 views

Whenever I want to write any kind of program in any programming language I couldn't write either I know all the things of that language but I couldn't built the logic.

    This topic has been closed for replies.
    Correct answer Nancy OShea

    For me, logic was a tough subject.  I struggled with it in school and I hated relational databases for the longest time.   I guess my brain isn't hard wired correctly.  Eventually, after a lot practice working with code, I had an ah ha! moment.  Things started falling into place.   I still struggle with it though. I can get myself into a loop without even trying.  Funny thing is, I'm very good at puzzles and games that require logical thinking.  I guess some people "get it" right away while others have to find it with practice & repetition.

    3 replies

    Chuck Uebele
    Community Expert
    Community Expert
    September 3, 2015

    When I was a kid, I would build these "mazes" out of wood blocks and then insert marbles that would travel down the ramps and splits that I made - very much like programming. Figuring out how you want your program to flow is a big part. Lots of people create flow diagrams. With my javascript coding, I tend to put a lot of things in functions or routines. This keeps my main program flow clean and easier to follow.

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    September 2, 2015

    For me, logic was a tough subject.  I struggled with it in school and I hated relational databases for the longest time.   I guess my brain isn't hard wired correctly.  Eventually, after a lot practice working with code, I had an ah ha! moment.  Things started falling into place.   I still struggle with it though. I can get myself into a loop without even trying.  Funny thing is, I'm very good at puzzles and games that require logical thinking.  I guess some people "get it" right away while others have to find it with practice & repetition.

    Nancy O'Shea— Product User & Community Expert
    Rob Hecker2
    Legend
    September 2, 2015

    Flow control is a large part of the logic of programs, consisting of if, while, foreach and for statements. Is that what you are talking about?

    Participant
    September 3, 2015

    Yeah I mean to flow of control during writing a program. I didn't get it during coding and got scared that it'll not be by me.

    Rob Hecker2
    Legend
    September 3, 2015

    The book Programming PHP by Lerdorf,Tatroe and MacIntyre has a section in chapter 2 on flow control.

    For me, in my early days with PHP, working with arrays, especially multilevel arrays, was sometimes hard for me to figure out.