Programming, why so difficult?

This, and reading your other threads to me points to you having a fundamental attitude problem with regards to learning things. That is, anything you don’t immediately understand is simply impossible to understand and so not worth learning. You then blame your inability to immediately understand it on the designers/developers of said technology designing it incorrectly.

The fact that there are millions of people out in the world using JavaScript and Regular Expressions every day without any issues shows that they are not impossible to learn. Whatever issues you have learning them are personal to you, not a flaw in the technology.

Sometimes things don’t make sense immediately. The solution is to that is to keep reading and experimenting with them until they do, not just blame the tech/it’s developers. I’ve been working on Unit Testing off and on for the last year or more. I still struggle with a lot of the aspects of it, but with each attempt I learn a little more and get a little better.

If you truly feel that nothing makes sense even after repeatedly attempting to understand it, then all I can say to that is maybe programming just isn’t for you and you should put your energy toward something else you enjoy.

A big part of learning is asking questions, and just like anything else there are good ways and bad ways to ask questions. Your initial question isn’t great, but at least it is enough to provide some kind of basic guidance.

Following up is just as important as the initial question. You say you don’t understand even 5% of the answers, but that’s not helpful. What exactly don’t you understand? Show us some bit of code you don’t think you understand, and tell us what you think the code might mean. Take a wild guess if you have to. We can’t see what you’re thinking, so you have to tell us. The more you reveal about your thought process, the better we can correct or confirm it to help improve your understanding.

4 Likes

I always knew that programming is not for me, my passion is gymnastics and that’s what I do, I also consider myself not stupid, and I try myself in many directions, reflection is always in the first place for me when people come to our classes , he can always be taught, like a bear, to ride a bicycle, and in languages too, and this is much easier than physical activity, so I understand that programming requires at least another 20 years to develop a program for complete understanding, for example, I took 2 years I study and

Most courses teach a computer language and expect you to assume certain things are true.
If you want to understand pure computer programming then I suggest that you start by learning machine code programming using assembler. I doubt that front console computers are available today.
When you are proficient in assembler and can write a program using it then you will have an inkling of the how and why of higher level languages.
Here is a link
https://resources.infosecinstitute.com/topics/secure-coding/what-is-x86-assembly/#:~:text=Assembly%20programming%20targeted%20specifically%20towards,instruction%20set%2C%20AMD%20for%20instance.

But everything there is paid, I’ve been studying like this for two years and it’s all in vain

If you are interested in learning the low-level how a computer works stuff, I’d recommend Ben Eater’s video series. Maybe knowing more about the hardware will help you understand why software does certain things.

1 Like

As we are moving away from @pinkod02’s original topic of Regular Expressions, I have moved this to a more general category.

In the 1950’s I wanted to be a rock star. I mean I really wanted it with a passion. But no matter how hard I tried and how passionately I wanted it, I failed.
I was too tone deaf and didn’t have the vocal range or quality to succeed in that field. And my guitar playing sucked.
Eventually I got a dose of reality and become a Radio Technician evolving into an electrponics engineer.
When mini-computers began controlling machinery I learned machine code and assembler and progressed to other languages as my equipment support required.
If after two years of trying you are unable to understand the basic principles of computer programming, my advice is to change track, pursue something else, preferably something that you are good at, instead of banging your head against a brick wall.

9 Likes

This was done a long time ago, I always learned English the same way, it’s a waste of time, just like programming, but many people hope that they can learn something that was not intended by their ancestors, so I always prove the opposite, why wasting time if people already don’t have the opportunity to exist well in this world, it’s better to do what their family did, here they will be the happiest and most beautiful people in the world, I repeated that I have everything in this life, and there is a lot of free time where I can do whatever I want.

Programming can be challenging due to its abstract nature, attention to detail, and problem-solving demands. However, with practice, patience, and a logical approach, mastering programming becomes rewarding and accessible.

Programming can be challenging because many developers do not know how to write good documentation.

The title is about programming in general but the question (actually comment) is specific to a different question about Regular Expressions that also mentions JavaScript yet this question (actually comment) is quite vague.

Probably because this thread was splintered off from a question about Javascript Regular Expressions, as rpg mentioned in their message.

1 Like

Here I absolutely agree, the developer may have understood how it works, but he does not know and does not know how to convey it to the student, but he tries to be smart, and as a result he receives a huge number of negative messages.

That’s not what he’s talking about in this situation. He’s not referring to a text book or trying to teach someone how something works.

He’s referring to documentation of code so that when someone goes back later to try and maintain it, they know exactly what the code is intended to do, and why it was done this way.

Too many developers still abuse the “code should be self-documenting” paradigm and don’t provide additional documentation that may be needed. “self documenting code” is a theory that you should instantly be able to understand what code can do just by reading it and there should be no need for separate documentation to understand why it does something. This means clear naming conventions (method name, variables, etc), concise code, etc.

The problem occurs in that the theory starts to crumble when the code isn’t self-contained to a single class or a single file. As soon as code gets reused different places, documentation is important because a simple change in the output could have unforeseen repercussions down the line if the code output is used for different reasons.

1 Like

Regarding documenting code:

I thought worth a mention, I use an extention in vscode call readable, which automatically generates doc strings and inline comments.

So for example, I selected the entire reverseString function code, right click → readable: generate docstring and it creates the comments above the function automatically.

/**
 * Reverses a given string.
 * @param {string} strg - The string to be reversed.
 * @returns {string} - The reversed string.
 */
const reverseString = function(strg) {
  // get the string as an array
  const target = Array.from(strg);
  const len = strg.length;
  // get the middle index
  const middle = len >> 1;
  
  for (let ltIndex = 0; ltIndex < middle; ltIndex += 1) {
    const rtIndex = len - ltIndex - 1;
    // swap the elements
    [target[ltIndex], target[rtIndex]] = [target[rtIndex], target[ltIndex]];
  }
  // return the reversed string
  return target.join(''); // 
};

It might not always get it 100% right, but it is very useful

1 Like

That is relevant too but I was referring to documentation of stuff like languages. Many years ago I wanted to write a program and tried to use Pascal. I got so frustrated trying to understand the Pascal language documentation that I used assembler instead. Documentation of processor instructions tend to be clear. These days the Microsoft documentation is constantly confusing. If a method is called DoSomething then the Microsoft documentation might say it does something. Most computer language and library documentation is not as clear and precise as documentation of processor instructions.

My current battle is how to bind a combobox in WPF to a field that is a foreign key. That is the type of thing that can be very frustrating. Theoretically, I should be able to figure that out from the documentation but typically we must find a sample showing how to do it.

Yes. My style is to write specifications of programs before writing the program. Management often does not want to spend much time on that. If an undocumented program needs to be re-written then it should first be documented but often programmers and management both do not want to spend time documenting.

That might be useful. It might be what Microsoft uses when they write something such as the DoSomething method does something.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.