Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to built logic of any program?

Community Beginner ,
Sep 02, 2015 Sep 02, 2015

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.

786
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 02, 2015 Sep 02, 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 othe

...
Translate
Guru ,
Sep 02, 2015 Sep 02, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 03, 2015 Sep 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 03, 2015 Sep 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 03, 2015 Sep 03, 2015

Thanks a lot sir

I appreciate you for your information.

I hope that one day I'll be a good programmer.If GOD willing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 03, 2015 Sep 03, 2015
LATEST

Here's a few things to consider before jumping in..

  • Take a deep breath before taking the first step, it's always the hardest.
  • Repeat the above, just one more time.
  • All programs can be done in quite a few ways, leaving the question of "getting logic correct" or "is my program efficient" entirely up to the eye of the beholder. Questions like "does it do what I intended it to do and does it do it well?" become more important.
  • Flowcharts are your friend. They help not only you, but your documentation, others reading your code and of course most importantly, you. As you use any of the many online, desktop or mobile (free and paid) flowcharting apps, experience is what will make these charts far leaner and more "human". Remember, flowcharts aren't about code, they explain the application from a very high level, which should be in some language such as, English .
  • In your flowcharting, try to learn what the symbols mean so you can properly understand things just by their names and symbols. That will greatly help you read others flowcharts as well.
  • I spent 2 bullet points on flowcharts which is almost one more flowchart than I've ever made. My point being, once you get "your own" familiar flow down, building will get faster and faster. At the beginning of a new project you'll already know what to do to get everything started.
  • Always try to break your system up into logical bits rather than one enormous bite. While you may be coding say, a slot machine, each piece of it can and should operate on their own. Breaking anywhere from a small to gigantic application down to the bits really makes you understand you can develop to any scale. As long as you baby step your way along.
  • Testing. You'll do this every little step of the way. Get used to it, do it often. Try not to write 200 lines of code and test it later. Eventually you'll want those little bits that make up your whole application to prove themselves. By this time you'll have started to learn about reducing dependencies and test driven design.
  • Use every possible thing available to help assist you. There are many integrated development environments (IDE, Adobe Dreamweaver‌, Adobe Brackets, Eclipse, Sublime Text, etc) that go a long way to helping you spot trouble long before you have it. Unfortunately, this stops short of logic. While your code may be syntactically ok, the logic may not do what you want. A good IDE will color code, fix common mistakes, point out syntax errors and give you lots of shortcuts. That let's you focus just on what's important, flow, testability and scalability.
  • Use resources wisely. The internet is absolutely overflowing with information to help you, in text and video form. Make use of all of it. Do this every time you get stuck, chances are someone else got stuck where you are and there will be help available.
  • It helps to read other peoples solutions. Take a look through other peoples code. You can read on say, their Github Readme what their JavaScript code should do. Go read the code and see if you can follow it. Experiment on, in and around it. That's what it's there for, you! Take existing code that does things you really want to do and give them a good read.
  • When you narrow down your questions to something a bit more focused, you're always welcome to post questions here at Adobe Code Corner.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2015 Sep 02, 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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2015 Sep 02, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines