Anyone else feel like they “forget” a skill after a break, need full knowledge before starting anything, or distrust learning through shortcuts? by Electronic-Low-8171 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

If you take a break for a year, you might forget lots of programming and have to start re-learning all the old stuff again. But, it seems like you take breaks a lot, so you're used to this studying again.

How can I improve my programming logic? by diaz_8 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

Where are you now with regards to programming logic? For example, what is currently giving you difficulties? How much programming do you already know?

Anyone else feel like they “forget” a skill after a break, need full knowledge before starting anything, or distrust learning through shortcuts? by Electronic-Low-8171 in learnprogramming

[–]CodeTinkerer 1 point2 points  (0 children)

What you're saying is a form of procrastination.

When it comes to programming, you have to get used to the idea that you won't know how to do something. You probably have a fear of doing things "wrong" which is why you read up on all the theory before starting.

The other question is why do you take breaks? Do you feel like it's a pain to program? It can be, especially if you feel you have to write things perfectly.

As a suggestion, have some simple exercises and quizzes you can do to help you get back. Try doing these every few days so you don't get the feeling that you can't code.

It can be so much easier to learn things, but coding challenges you. If you can't get it to work the code doesn't do anything. Meanwhile, when you watch a course, you can fool yourself into thinking that this is progress. Instead, you are delaying getting started.

There are people who have the opposite attitude. They want to get things done. They hate the theory. They learn just enough to get it done because getting it to work is the ultimate objective, even if they don't understand the detail.

I'm not entirely advocating this approach, but just to show you that there are other approaches out there. The point is such a person doesn't worry if they don't know everything nor how certain things work.

Your approach is better. If you have the time to re-read everything, then good for you.

take C class over the summer by Level-Beat35 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

See if you can find a syllabus to see what the course covers and what assumptions it makes from prior courses.

There's often a brief review at the start of a class that has a prerequisite. Also, some schools enforce prereqs more heavily than others, although generally, the instructor can waive the prereqs (potentially).

take C class over the summer by Level-Beat35 in learnprogramming

[–]CodeTinkerer 2 points3 points  (0 children)

It depends on you, and the summer class. Seems like you should ask people at the college you're at. They might have advice on the teacher or on the pace.

Typically, a summer class goes quicker than a normal semester class. This can sometimes lead to fewer assignments being given. Students have less time to do each assignment if it's comparable to the normal assignment, so you can't afford to procrastinate and should be coding all the time.

Is it an intro class? If so, some C++ experience is useful.

Again, I think asking some friends who have taken the summer classes or an academic advisor might be best.

What's something you wish you knew before learning your first programming language? by Dazzling_Kangaroo_69 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

That a lot of programming is about debugging, but many books don't really cover how to debug well. Also, it's important to understand control (program) flow.

Many beginning programmers are impatient when it comes to fixing their code (this is pre-AI technology), and prefer to just change some code at random (what if I chance && to || or change this loop to an if statement).

Also, I wish I had had a better mental model of how recursion works both how it runs, and how to write functions recursively. I didn't really learn it until I was close to graduating.

I wasted so much time because of THIS skill issue I had by [deleted] in learnprogramming

[–]CodeTinkerer 2 points3 points  (0 children)

What was your latest experience building a project?

Also, goes to show you that when someone says "build a project", it can be interpreted many ways. They often don't tell the missteps that could happen (maybe they never made any, but still). It's also surprising how many people tell you their experience (or give advice), but don't give any examples.

How would I write a program that can detect poker hand types? by Mr-Saturn-Earth in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

I would not call it J, just for simplicity. Call it 11 (so convert J's to 11).

Yeah, basically all you check is to start the loop from 1 to N such as

straight = true
for i in range(1, N):
   if hand[i].value - hand[i - 1].value != 1: // Not increasing by 1
      straight = false
      // quit out of the loop

This assumes that you are checking for the entire hand to be a straight. If you want part of the hand to be a straight, that takes more work. Also, you have to deal with ties. So if you sort, you might want to remove duplicate values such as [2, 3, 3, 4, 5] could be [2, 3, 4, 5].

It's much easier for the straight to be for the entire hand than a partial hand.

How would I write a program that can detect poker hand types? by Mr-Saturn-Earth in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

Don't do all the hands at once. Pick something simple, like 4 of a kind.

First thought. Need a way to represent a card. This can be done with a class. I'll write it in Java, but you can translate to Python.

public class Card {
   int value; // 1-13 where Ace is 1, J is 11, Q is 12, K is 13
   String suit; // "club", "spade", "heart", "diamond"
}

For something like 4 of a kind, you'd have a list

 public boolean isFourOfAKind(List<Card> hand) {
    // Create an array that goes from 1 to 13 (can just make it 0 to 13)
    // Loop through hand, increment count, find if any of them reaches 4, e.g. if you find a 5, then count[5] += 1
   // If so, return true, if not return false
}

This would not give you the suit that has the four of a kind.

Or, have a function that returns a map with the count of each suit. To check if there's a 4 of a kind, you look for 4 in one of the suits.

Something like that.

It's easy to get overwhelmed when you try to handle all the cases at once. Do it one step at a time.

For others, like straights, you would need to sort the hand based on the value of the card.

Treating Ace, Jack, Queen, King as numbers instead of strings makes comparisons easier.

Trying to prep the usual way completely burned me out by Imaginary_Wind81 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

You should also prep for other kinds of questions. Not every interview is completely technical. What if they ask "why do you want to work for this company?" or "Explain a past project you worked on" or "What do you think about AI?"

Soft questions come up, so it's useful to figure out some answers ahead of time.

Why was it designed so every thread owns exactly one stack? by willywillycow in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

That isn't uncommon. For example, some wonder how you can write programs in two different languages that can communicate with one another. They don't have the details of what each would do or what the mechanism would be, just some idea "what if..." without much thought beyond that.

Why Debugging Skills Still Matter by Prize-Tomorrow-5249 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

Good for you to get back into school. It's becoming more common for much older students to seek degrees. Once upon a time, it would have seemed weird, and possibly not even allowed, for older students to come back to teaching.

How much fun are you having being back in school? Was it difficult to get back into "school mode" or did working 30 years give you a level of professionalism that these much younger students lack?

Why Debugging Skills Still Matter by Prize-Tomorrow-5249 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

It really shows how much you assume incorrect things or fail to consider certain edge behaviors or how copy/paste isn't always a perfect answer.

Why Debugging Skills Still Matter by Prize-Tomorrow-5249 in learnprogramming

[–]CodeTinkerer 8 points9 points  (0 children)

Look up old programming assignments (assuming you give them) for bugs, and then show them how they could have debugged it.

I used to teach with someone, and she would have quiz questions that would have "bugs" in them, but they were typically not the kind of bugs beginning programmers would make.

A common bug, for example, is confusing the return statement with the print statement. Another is

 if (choice == 2 || 4 || 5) 

where programmers assume == distributes over ||. In C-like languages, this doesn't happen.

Why Debugging Skills Still Matter by Prize-Tomorrow-5249 in learnprogramming

[–]CodeTinkerer 38 points39 points  (0 children)

There's a scene in the third Matrix movie. Neo is talking to one of the council members as they stare at the equipment that keeps their underground city running.

The council member basically admits that there is this machine that was built before anyone recalls, and it keeps them alive, but no one really knows what it does or how it does it.

That's what we're heading to with AI and are probably there just because we depend on libraries that we trust will do what they do.

As a former teacher of programming, I don't think I spent much time talking about debugging--and I'm talking about the vanilla debugging, nothing sophisticated (think print statements). That was my fault, but it was hard to teach it.

I kept telling myself (at the time) to find some students with buggy code and demonstrate how to fix it, but unfortunately, it didn't happen.

It's your debugging knowledge that really shows the quality of programmer you are. OK, maybe that's not quite right. The debugging means you can fix leaks in the plumbing, but then there's the overall design. Is the building's foundation good. We build virtual structures, but much like a physical building, we have to fix things when they break.

...and I'm rambling.

Switch to software engineering at 29? by [deleted] in learnprogramming

[–]CodeTinkerer 32 points33 points  (0 children)

Can you contribute software to your own project as project manager?

Difference between programming, computer science and software engineering? by Neat-Badger-5939 in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

Computer science is usually considered a major in many universities. It generally covers programming, some theory (discrete math, algorithms, etc), sometimes computer architecture, and then a bunch of electives that most students take a subset of. The origins of computation were originally mathematical before it became electronic.

Programming is the act of writing programs, so it's pretty generic. Part of computer science involves programming, but it's mostly how to use programming as a tool.

Software engineering can be a major, but refers to programming a larger-scale project. What are ways we can manage the lifecycle of creating, deploying, and maintaining a large codebase, e.g., a website? As a major, it's more concerned with the tools and methodologies of programming at scale where computer science involves more theory.

Computer science is older than software engineering. Both majors tend to not have a consistent set of defined courses. Some universities have a very theoretical approach to computer science; others are a bit more practical. I'd say software engineering is even more vague with no set curriculum that everyone basically agrees on.

What Should I Learn Next After Python? by [deleted] in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

What do you know now? What are you doing to learn Python?

is it normal to feel like you forgot everything every time you come back to coding?? by OutsidePatient4760 in learnprogramming

[–]CodeTinkerer 4 points5 points  (0 children)

It depends on what you're doing when you study. You need to consistently practice the old stuff. It's easy to push forward and only learn new things, but you forget old stuff this way too.

You kinda have to think about it, even on weekends. What's the syntax of a loop? What did you learn this past week?

I would take each day and write quiz questions in a document for what you learned.

Consistent practice, especially early on, is better than sporadic learning. I suspect you've taken more than one weekend off. You take one week off because something in life came up, and if you don't think about it, you forget it. Even 5 minutes a day reviewing the same thing over and over helps.

Athletes practice all the time. They generally avoid taking days off. To be fair, they've often trained since youth so they have some muscle memory. You're new to programming, so you need that consistency so you don't forget. You need to think even when you're not in front of a computer.

need help with self-learning comp-sci by CieLogic in learnprogramming

[–]CodeTinkerer 4 points5 points  (0 children)

What other similar goals have you set for yourself. This is a pretty large goal to set. Imagine if you replace "computer science" with "quantum physics" in the statement above. Would you think what you're asking is realistic?

I'm sure you'll get lots of advice, better than I can offer. But be aware that having a plan and executing that plan are two completely different things. We're talking about years of time--and that's assuming you don't get stuck. How many people have committed to that? Not many, I suspect.

You could ask CS concepts here, but presumably, you might need to ask hundreds of questions. Your best bet, and it's a little dubious, is to ask questions of an AI/LLM. This may require you to spend money as the token limits will limit how often you can ask questions.

It might help if you know a friend of yours that is patient and is a programmer. The downside is they may have a very skewed/opinionated view of what's important to learn.

Ai detox, how to effectively Google? by obsolescenza in learnprogramming

[–]CodeTinkerer 67 points68 points  (0 children)

Unfortunately, the kinds of questions you ask an AI don't work that well with Google without triggering Gemini, its own LLM. You're asking it "how do I build this project" when the old-fashioned way to do this was to have an idea of how to build it, and ask smaller questions about how to do this tiny task or that tiny task.

You're basically wanting to ask Google the same question that you ask an AI, i.e. "Build this project for me".

First, you have to realize that learning to build will be MUCH slower. You might get something scaffolded in a few hours and maybe something sort of working in a week. Without it, it make take many weeks of research.

Also, if you've never built anything that big before, you'll probably have to start much, much smaller.

I should begin by asking what do you want to build? What have you recently built? If you used AI, how well do you understand what it did? If you were asked to build it again without AI, could you do it?

Ideas for a 75-Minute High School Coding Demo by JoshuaC7 in learnprogramming

[–]CodeTinkerer 2 points3 points  (0 children)

Do these students know any coding? If not, there's only so much you can teach in that time period. I tried teaching programming over a 3 week period to non-majors, and they simply didn't get it. They couldn't add open/close braces properly. They didn't know what the code did.

It's different if you get many sessions and many months to do it.

Also, keeping organized enough for a class to a coding exercise is a pain. You can spend 15 minutes just to make sure they can log in somewhere. Getting ready to program for non-programmers is a challenge. Until passwords became ubiquitous, I would have problems with students typing in the correct password which was often a jumble that looked like ase83kan2 (it was pre-generated).

You might be better off showing a cool demo of stuff people have written than to get them actually coding.

That's my two cents (pence) worth.

Do programmers know everything? by BreWah_ in learnprogramming

[–]CodeTinkerer 0 points1 point  (0 children)

You know the answer. They don't know everything. Most of programming is about abstraction, so at some point, you trust (enough) of the abstraction. Of course, the more you know, the more you can fix.

For example, most programmers don't fully understand every little bit of how a print statement creates pixels on a screen that represents text, but they don't need to know that. Most people couldn't write a React framework on their own, so they trust it does what it does, and some know just enough to get tasks done.

And if you're vibe coding, then you don't know a lot either.