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

Click For Summary
SUMMARY

The discussion centers on introducing programming concepts to a beginner, specifically a granddaughter preparing for college. The original poster recalls learning about conditional statements and logic in a class called "LOGIC" and seeks modern resources for teaching these concepts. Participants recommend focusing on programming languages like C++ or Python, emphasizing the importance of understanding logical and comparison operators within those languages. They advise against searching specifically for "logic" books and instead suggest looking for beginner programming books that cover these foundational topics.

PREREQUISITES
  • Basic understanding of programming concepts such as conditional statements and loops.
  • Familiarity with programming languages, particularly C++ or Python.
  • Knowledge of logical operators (AND, OR, NOT) and comparison operators (<, >, ==, !=).
  • Awareness of programming resources, including books and online tutorials.
NEXT STEPS
  • Research beginner programming books that cover C++ or Python, focusing on conditional statements and logical operators.
  • Explore online courses or tutorials that introduce programming logic without heavy syntax requirements.
  • Investigate resources on Boolean logic and its application in programming.
  • Look into Arduino programming guides that emphasize logic and control structures relevant to the Arduino Kit.
USEFUL FOR

This discussion is beneficial for educators, parents introducing programming to beginners, and anyone looking to understand the foundational logic behind programming languages.

yungman
Messages
5,741
Reaction score
291
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
You could use C++ for the same purpose, just use a small subset of the operators.
 
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   Reactions: oslon
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.
 
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   Reactions: symbolipoint
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   Reactions: symbolipoint
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.
 

Similar threads

  • · Replies 54 ·
2
Replies
54
Views
5K
Replies
86
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 397 ·
14
Replies
397
Views
20K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K