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

  • #1
yungman
5,708
240
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.
 

1. What is logic in computer language?

Logic in computer language refers to the set of rules and principles that guide the behavior and operations of a computer program. It involves a systematic approach to problem-solving and decision-making using logical reasoning and mathematical concepts.

2. How can I improve my logical thinking skills?

To improve your logical thinking skills, you can practice solving logic puzzles, study algorithms and data structures, and familiarize yourself with the syntax and structure of different programming languages. Additionally, you can also take online courses or attend workshops on logic and critical thinking.

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

The best way to learn the logic of computer language is to start with the basics and gradually build your knowledge by practicing and implementing what you have learned. It is important to choose a programming language that aligns with your interests and goals, and to regularly challenge yourself with new and complex problems.

4. Is it necessary to have a strong mathematical background to learn logic in computer language?

A strong mathematical background can be helpful, but it is not a requirement for learning logic in computer language. While some concepts may involve mathematical reasoning, many programming languages have built-in functions and libraries that make complex calculations easier to implement.

5. Are there any resources available to help me learn the logic of computer language?

Yes, there are many resources available to help you learn the logic of computer language. These include online tutorials, coding challenges, textbooks, and coding communities where you can ask for help and share your knowledge with others. It is also beneficial to practice and experiment with coding on your own to solidify your understanding.

Similar threads

  • Programming and Computer Science
2
Replies
54
Views
3K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
8
Views
820
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
7
Views
655
  • Programming and Computer Science
2
Replies
41
Views
3K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
2
Replies
58
Views
3K
Back
Top