What is the best way to learn logic of computer language?

In summary, the best way to learn the logic of computer languages involves a combination of understanding fundamental concepts, practicing coding through hands-on projects, studying algorithms and data structures, engaging with online resources and communities, and consistently solving problems. Additionally, learning by teaching others and exploring various languages can enhance comprehension and adaptability in programming logic.
  • #1
yungman
5,755
293
Hi

I want to give an introduction of programming to my grand daughter who's going to college next year. She never learn any language. I want to play with Audino Kit with her. It's mostly C++. But it's too difficult for her to learn as first language and she doesn't have time as she's still very busy in school.

I remember when I was in Hong Kong, I learn about conditional statement like "If-Then-Else-Elseif", "While(...) do (...)", "Case(......)" etc type of things in a class called LOGIC. It also has AND, OR etc. It's a lot easier to learn without worrying about the Syntax, Class, Function and all that. Just want to teach her some basic logic, conditional statements.

I want to buy a book or go on line, my question is:

What is the name I should look for? Like I said, we called it "LOGIC" in HK 50yrs ago, it might be a totally different name now.

Thanks
 
Technology news on Phys.org
  • #2
You could use C++ for the same purpose, just use a small subset of the operators.
 
  • #3
yungman said:
who's going to college next year. [...] It's mostly C++. But it's too difficult for her
I highly doubt that:

61I+fGIABBL._SL1500_.jpg


https://www.amazon.com/dp/B09M58P9PG/?tag=pfamazon01-20

51i3hbg1yvL.jpg


https://www.amazon.com/dp/0988472627/?tag=pfamazon01-20
 
  • Haha
Likes oslon
  • #4
yungman said:
I remember when I was in Hong Kong, I learn about conditional statement like "If-Then-Else-Elseif", "While(...) do (...)", "Case(......)" etc type of things in a class called LOGIC. It also has AND, OR etc. It's a lot easier to learn without worrying about the Syntax, Class, Function and all that. Just want to teach her some basic logic, conditional statements.
Pretty much any programming language uses logic to determine which line of code should be executed next in conditional statements (like if - else blocks and switch blocks) or iterative statements (like for, while, and do while blocks).

C++ would be fine, as would python. You don't need to do anything with classes and object-oriented stuff.
 
  • #5
Mark44 said:
Pretty much any programming language uses logic to determine which line of code should be executed next in conditional statements (like if - else blocks and switch blocks) or iterative statements (like for, while, and do while blocks).

C++ would be fine, as would python. You don't need to do anything with classes and object-oriented stuff.
My question is do I look for books on "LOGIC"? I really want to know the name, I know they have it, or else how would they teach in Hong Kong in 1967?

Thanks
 
  • Like
Likes symbolipoint
  • #7
yungman said:
My question is do I look for books on "LOGIC"?
Don't look for books on logic. Pick a programming language and look for a book on that language. It should have a section that describes the comparison operators (<, <, <=, >=, ==, !=) and logical operators (&&, ||, !) and how logical expressions are used in conditional statements (if/else and switch/case) and iterative statements (for, while, do while).
 
  • Like
Likes symbolipoint
  • #8
You might look at the results from this search. This link confuses Physics Forums! You must copy the several lines of the link then paste it into the address field of your browser. :frown:

https://www.google.com/search?hl=en&source=hp&biw=&bih=&q="Basic+Basic"+book&iflsig=AO6bgOgAAAAAZStt7m3f5t1AVKhjPuSCZJdbNUDAubFN&gbv=2&oq="Basic+Basic"+book&gs_l=heirloom-hp.3..0i22i30j0i650i390l4.6388.16072.0.25080.18.18.0.0.0.0.268.1940.12j5j1.18.0....0...1.1.34.heirloom-hp..1.17.1850.Be0fapajlqw

You may find a copy in your area using this link for a world-wide library search.
https://openlibrary.org/books/OL4546760M/Basic_BASIC

It is a beginners book on the BASIC computer language, which was the only language available in the mid to late 1970's for the new Personal Computers.

As I remember, it really started at the beginning for language development.

Cheers,
Tom
 
Last edited:
  • #10
Sorry, no computer language has any sort of logic built-in. What it has, is a way to describe how to do things. The "logic" must reside in the brain of the implementer. How to transform that logic into working code may depend on the tool chosen - you can write a huge application in assembly code, but you would not really want to do that. Creating a database query in LISP would be another example of mismatched tools.
 
  • #11
How about dropping by in Wikipedias entry on Boolean Logic and following the links?
 
  • #12
I'd be surprised if your grand daughter doesn't have any experience with programming, and possibly knows more about programming than you do. We're ending 2023 and she's less than 1 year away from college. Certainly she has some experience already?
 
  • #13
Svein said:
Sorry, no computer language has any sort of logic built-in. What it has, is a way to describe how to do things. The "logic" must reside in the brain of the implementer.
The term "logic" is something of a misnomer here. I believe the OP, who is not a native speaker of English, really was asking about logical operations.

General purpose computer CPUs contain a chip or circuitry called the ALU or arithmetic logic unit. The section of this chip that deals with logic contains circuits for AND, OR, NOT, and other logical operators. Most computer languages provide capabilities to implement these operations.
 
  • #14
fluidistic said:
I'd be surprised if your grand daughter doesn't have any experience with programming, and possibly knows more about programming than you do.
Don't poke the bear!

Mark44 said:
The term "logic" is something of a misnomer
When working with computers? You betcha!

I am reasonably sure that ALUs implement all the logical operators as NAND gates (can be done with NOR as well, but I think NAND is what is used).

For axample, NOT is NAND with the two inputs tiied tohether.
 
  • #15
Mark44 said:
I believe the OP, who is not a native speaker of English, really was asking about logical operations.
Here's what he wrote:
yungman said:
I learn about conditional statement like "If-Then-Else-Elseif", "While(...) do (...)", "Case(......)" etc type of things in a class called LOGIC.
That's more than just the logical (Boolean) operators AND, OR, NOT. They're implementations of the fundamental flow-control concepts of selection and iteration.
 
  • #16
jtbell said:
That's more than just the logical (Boolean) operators AND, OR, NOT. They're implementations of the fundamental flow-control concepts of selection and iteration.
What I neglected to say was that he was interested in logical operators as they apply to conditional statements.
 

FAQ: What is the best way to learn logic of computer language?

What is the best way to learn logic of computer language?

The best way to learn the logic of a computer language is to start with the basics. Begin by understanding fundamental programming concepts such as variables, data types, loops, and conditional statements. Practice writing simple programs and gradually move on to more complex ones to solidify your understanding of the logic behind the language.

Should I focus on one programming language or learn multiple languages?

It is generally recommended to focus on learning one programming language thoroughly before moving on to others. Mastering the logic of one language will make it easier for you to grasp the concepts of other languages. Once you have a strong foundation in one language, you can expand your knowledge by learning additional languages.

Are online tutorials and courses effective for learning the logic of computer languages?

Online tutorials and courses can be effective tools for learning the logic of computer languages. They provide a structured learning environment with interactive exercises and practical examples that can help reinforce your understanding of programming concepts. However, it is important to supplement online resources with hands-on practice and real-world projects to enhance your skills.

How can I improve my problem-solving skills in computer programming?

To improve your problem-solving skills in computer programming, practice solving a variety of coding challenges and puzzles. Participating in coding competitions, working on open-source projects, and collaborating with other programmers can also help you sharpen your problem-solving abilities. Additionally, breaking down complex problems into smaller, manageable tasks and learning from your mistakes can further enhance your problem-solving skills.

What role does practice play in learning the logic of computer languages?

Practice is essential for mastering the logic of computer languages. The more you practice writing code, the more comfortable you will become with programming concepts and syntax. Regular practice allows you to apply what you have learned in real-world scenarios, identify areas for improvement, and develop your problem-solving skills. Consistent practice is key to becoming proficient in a programming language.

Similar threads

Replies
54
Views
4K
Replies
16
Views
2K
Replies
7
Views
930
Replies
2
Views
2K
Replies
13
Views
5K
Back
Top