Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to build programming logic?

Status
Not open for further replies.

shivajikobardan

Junior Member level 2
Joined
Oct 23, 2021
Messages
24
Helped
0
Reputation
0
Reaction score
2
Trophy points
3
Activity points
292
I am computer engineering student(Our curriculum is 80% similar to electronics engineering in our country so you can call me electronics engineering student as well tbh). But this thing is relevant to electronics engineering as well so I am asking it here. I still don't know how to program. I of course can code very tiny tiny programs like prime number etc etc...But I am nowhere near the level of building big programs like using frameworks to make stuffs and so on.

I learnt c, c++ and python and bit of javascript. But all of them were useless. I learnt programming languages and not programming.

I know assebly language coding in 8085 and 8086 microprocessor. I didn't learn 8051 quite well though.

I think this question is relevant to electronics engineering students in my country(Nepal) as most electronics engineering students pursue career in coding like web development. Any way, coding is essential part of electronics engineering, we all know about that.


I am currently learning python. I learnt syntax of python. And I am currently solving codewars problems. I read other person's solutions as well and try to understand at least 5 different solutions to a problem. My logic has improved a bit in programming but I consciously want to know how to improve my logic in programming? What else can I do to improve my logic in programming? Any guidance will be extremely valuable
 
Hi,

I don´t understand what you need to know / learn.

If you can solve a a task and generate the code for it, then you are done.

Maybe you need this:
For bigger tasks: You need to divide the big task into smaller tasks and the smaller tasks into even smaller tasks. ..until you can generate the code for the tiny task. Then test the tiny program and go to the next.

or this:
Give one task to a couple of programmers and get different solutions.
Usually there is not the one and only "best" solution.
Maybe one is optimized for code size, the other for RAM size, the other for precision, to ther for low power, the other for high execution speed.

or you just need experience.
Not experience in solving similar tasks, but tasks with very different requirements.
* doing a "quick and dirty" voltmeter
* or do the high safety airbag control

In either case: A pencil and a sheet of paper may be very helpful.

Klaus
 

Hi,

I don´t understand what you need to know / learn.

If you can solve a a task and generate the code for it, then you are done.

Maybe you need this:
For bigger tasks: You need to divide the big task into smaller tasks and the smaller tasks into even smaller tasks. ..until you can generate the code for the tiny task. Then test the tiny program and go to the next.

or this:
Give one task to a couple of programmers and get different solutions.
Usually there is not the one and only "best" solution.
Maybe one is optimized for code size, the other for RAM size, the other for precision, to ther for low power, the other for high execution speed.

or you just need experience.
Not experience in solving similar tasks, but tasks with very different requirements.
* doing a "quick and dirty" voltmeter
* or do the high safety airbag control

In either case: A pencil and a sheet of paper may be very helpful.

Klaus
My question is as a noob starting coder, how do I build my problem solving skills? How do I build my programming logic? How do I improve my ability to solve problems? What do I practice? How do I practice? That is all I want to know.
 

you improve by practicing - that is, doing
set yourself a task and do it
then another, and another...

pick things you are interested in
preliminary suggestions:
clock
timer
stopwatch

if you like cards, randomize a deck
deal cards for a game
for a card game you like, program hand evaluation for winning (as one might use in poker)

if you like cryptograms, write a program that takes in the cryptogram
and displays the cryptogram and your solution as you determine letters
(this is not having the program sole the cryptogram)

try here
 

In addition to above helpful replies...

1.
Learn the command-keyword set. Learn easy methods built into the language that do whatever you might need to do.

2.
Write programs that detect:
* keyboard presses
* shift key, option, ctrl, etc.
* mouse coordinates
* single click, double clicks.

3.
Write programs that create data, save it to disk as a file, and read it from disk. Handle some data as numbers, some as text.

4.
When you debug, generate verbose output onscreen. Tell what step you're executing, value of pertinent variables, user input, etc.

5.
Structure your programs so that it's easy to grasp operation. When you write a subroutine/ function, try to make all of it visible onscreen.
 

more advice
document your work with liberal use of comments
write sentences and paragraphs, not short phrases

at the start of each routine, be it main or a subroutine, or a function, or a macro
or whatever else you may call it:
specify the name and purpose of the routine
define all the variables
specify the inputs and outputs and their relationship

you need to know what your programs are for and how they work
the best way to do that is to write it down before writing any code

do revision control
when you have a working version, save it
create a new file with a new revision number to make changes
it is a lot easier to restart an old version that works than to re-create it
from a version that doesn't work
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top