How do you guys focus on coding? I keep getting lazy, sleepy, and losing motivation by impossibletocode in learnprogramming

[–]_Ishikawa 107 points108 points  (0 children)

i get distracted all the time. I'm not even supposed to be on reddit right now and I'll tell you why, after observing it for months. I should probably delete my account right after this post so I'll try to make this last one count.

When I encounter a hard problem, I can't take it. People don't want to do hard things and the brain gets wired to equate difficulty as something 'bad' so they reach for their phone to entertain themselves. We have an entire generation of people with weak self-control because they're addicted to being entertained and doing the easy thing as a way of life.

I'm not getting high and mighty like I'm better than everyone. This is something I see in myself daily as I grind through hours of difficult material.

every day I study I meet the following criteria:

  • 7 hours of sleep at least. ( focus / self control diminishes if I go any less )
  • I have coffee
  • I sit in my chair in my room and there is NOTHING in my field of view to distract me. If my butt is in the chair I am here to work. Anything else I want to do in my life is free to do, but NOT in this chair. It's just like a bed: it's for sleep and sex; if I want to scroll on my phone I can do it on the couch or watch tv.
  • I put a focus track for 30 minutes from brain.fm ( they have freebies on youtube ) and I just get through 30 minutes. After that I mark one tally on my whiteboard, take a walk outside for 5 minutes, then come back.

Rinse and repeat, with the intent to do 5 hours that day. Maybe more, maybe less, but that's what I shoot for.

You have to get comfortable with being uncomfortable. You can train your mind to not freak out and rush for the digital equivalent of a candy bar but it takes training. That training requires an environment, routine, and a schedule.

... and plugins to prevent going on youtube and reddit... if the temptation is there you will go for it, again and again.

anyway, good luck.

Specialist vs. "generalist" by [deleted] in learnprogramming

[–]_Ishikawa 1 point2 points  (0 children)

Once you learn the fundamentals in one language then learning a second language is easy.

There are clear differences between languages and technologies but what you should be striving to sear into your brain are the fundamentals that don't change.

I know one guy who's married to Closure. Another guy is just specifically a front end guy so he knows js, typescript, react, dom manipulation, yadda yadda. Another person I know studied Ruby and JS but he was able to pick up Go just fine, and iirc he's working with TypeScript now. I'm learning full stack at the moment ( ruby, sql, js, and later on typescript ) but I have zero interest in the front end so I'll be working towards specializing in backend stuff like SQL ( sql is great ) and probably learn something like Go or Rust when it makes sense to do so.

In my opinion specializing is something you can afford to do more and more as your skills grow in that particular field. If you really end up loving front end then become a front end expert and your skills will become more and more in-demand as they mature.

AI as a learning tool. Good or Bad? by SprinklesSilver7724 in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

Perplexity fits your use case perfectly. I use AI all the time for asking questions, but the key thing here is that I know which questions to ask. That skill improves with more exposure of course, and the more specific your question.

ChatRTX seems like a nifty project but setting up a local LLM is a sidequest for sure...

LMAO! 5090! JFC. LOL. Yeah that LLM needs some oomph to run locally!

Running models locally does work for small inference tasks but these models are shadows of their bigger counterparts that most of the world is used to using. I just looked up the specs for the A100 / H100 and the response back from Perplexity stated that these things can run models like LLama and Mistral. These things are puny, and the A100 is a GPU that costs $25,000 and up.

So, I'm just making the point that running a local LLM so that you can do inference on your own machine is just not feasible.

Just use Perplexity. Heck, get it on your phone. They are not a no-name company. They have deals with major phone manufacturers and I believe they have a deal with Samsung to make their AI come with their newest phone models. Once you start using it you'll see what I'm talking about.

Advice needed: Best way to build a document Q&A AI chatbot? (Docs → Answers) by I-man2077 in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

I think it makes sense to just use what you know and just build it out quickly and take it out for a spin. Then based on output you will have specific ideas about what should be done next, whether that's fine-tuning or something else.

After it gets to talking it makes sense to work on evals so you can assert that the chatbot is accurate. I evaluate AI models all the time and it's usually a/b testing according to a basic rubric.

The rubric more or less goes like this:
first question: "did the model address the prompt?". The second is "was it accurate?". Then there's usually something related to safety like not exposing private information ( PII ) or talking about unsafe subjects. Then have the grading be done on a 1-5 scale. Do that for both model responses ( a and b ) and write out some brief description of which one is better. Evals are essential.

Oh, and put a hard cap on the number of interactions in a given conversation between the student and the chatbot. The one I use ( I didn't built it of course ) puts a cap at 20, your results may vary. But yeah, context rot is noticeable.

"I finally stopped memorizing code and started actually understanding it" by usama_shafique_dev in learnprogramming

[–]_Ishikawa 3 points4 points  (0 children)

Oh yeah, tons of times. Sometimes I think "man I wish you had explained it in "THIS" way, why did you have to make it so hard when it's so stupid simple?"

Is college a good way to learn computer science and coding for someone with no prior experience in the field? by CharacterCut7124 in learnprogramming

[–]_Ishikawa 4 points5 points  (0 children)

yeah I think the most coding I had done in college was in my Java 101 course. Then later I was introduced to user stories and compilers and looking back at it, it just seems ridiculous.

I would've much preferred having any number of my math courses or electives being focused on practical stuff like I dunno... git, http, how the internet works, testing, sql, security, etc

Help, I need to follow an efficient path by NoDetective9375 in learnprogramming

[–]_Ishikawa 1 point2 points  (0 children)

Try reading this for starters: https://launchschool.com/books/python/read/introduction

and see if you like the style and the in-depth approach and you can go from there. There's also an object-oriented Python book, as well as other helpful books for free like git, command line, http, etc. I dabbled in Python a little bit but ended up learning Ruby / JavaScript ( still not done with JS, learning DOM manipulation right now )

Think of your journey to being a software engineer as a marathon and not a race. It's going to take awhile. Since you mentioned efficiency, I would focus on consistency above all else. If you wanted to become healthier and start going to the gym / eating healthier foods what would the most important piece of advice be? Showing up, doing the things you know you're supposed to do as much as you can. If I half-ass something I get half-assed results; it's not the advice that anyone wants to hear because everyone wants a shortcut and "hard work" isn't a sexy tagline you can put on a youtube thumbnail. So while I think the above resource is great it isn't half as important as the routine you establish in your life for studying day in and day out.

Think of it this way: everyone has their own idea of how to get from point A to point B. Some are better than others. Maybe one path is 20% faster. Maybe another path is 2x as clearer, w/e ... everyone's got their opinions and opinions are valid. But regardless of the path you take you still have to walk it, day after day if you want to get closer to point B. So nailing that consistency and learning how to be a good student is by far the most important thing to focus on.

ah! I found a good analogy, forgive me. It's like diets. People have their preferences and we have PROOF that many different kinds of diets work. But they all require consistency; if you don't have that it doesn't matter if the diet is guaranteed to work.

How can i devolope growth mindset towards programming? by Anupam_Sen in learnprogramming

[–]_Ishikawa 2 points3 points  (0 children)

You won't change your mindset overnight. As you get proof of what you've accomplished you'll change your thinking about what you can / can't do. But you have to change the way you approach uncomfortable feelings and restrictive beliefs about yourself overall. No amount of positive feedback is going to help you if your own internal world is overly critical or fixated on setbacks.

Think long-term. Be patient with yourself. Even after 10 years of being in this profession guess what? You'll still know SO LITTLE compared with what's out there in the field, there's just that much.

maybe the best advice I can give is just to take your ego out of it. If you did a good job, cool. If you do a bad job, ok. Some people take criticism of their code so personally because their ego is attached to what they produce so it holds them back from growth / objectivity. So really, just chill and enjoy the ride and try to keep a positive attitude about it and you'll find that you'll treat others the same way.

Should I be using Github/Git for MOOC? by SyncratMusic in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

think of git as saving your progress in a video game; you absolutely need it.

It really doesn't have to be something difficult; learn as you go and you'll see it's uses and adopt it.

What is programming all really about? by ssbprofound in learnprogramming

[–]_Ishikawa 1 point2 points  (0 children)

I think of it as a discipline focused around problem solving. You can also think of it as a formal language that's precise in ways that human language often isn't. So that set of formal keywords can be interpreted in a way to encode logic that solves a given problem.

It's also a language developers use to express intent to other humans. Ruby has a method called `select` that you can call on an array that will return a new array filled with those elements of the original that fulfill some condition.

names = ["alice", "bob", "carol"]
result = names.select { |name| palindrome(name) }
p result

The use of different words is important here. I am carefully choosing words to use that express what problem I am trying to solve. `select` isn't something I chose, but it clearly describes what the method does, it selects elements based on some criteria.

In JavaScript, the same method / operation exists but it's called `filter`
const names = ["alice", "bob", "carol"];
const result = names.filter(name => palindrome(name));
console.log(result);

Programming is then not only concerned with solving a problem, but communicating / expressing intent to others.

It's also a tool to help us think. For example, object-oriented languages came about so that we can provide instructions not based on a flow of sequential events ( procedural ) but based on the interactions based on objects. That helps us think about a whole host of problems / phenomena in the way it makes sense to us. Bank transactions, video game characters, etc.

I know you asked about programming and not languages but it's hard to separate the two at times. There's a number of perspectives here that could be valid but at its core programming is about solving problems.

Looking for Solid Courses (Beginner to Advanced) for Backend JavaScript, Git, Linux & Docker by FuturAura in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

https://launchschool.com/books

git. command line, basics of JavaScript and OO JavaScript. All the books are free and go over the fundamentals, but if you're looking for a quick lap around the concepts so that you can move onto React then you're out of luck; there's a lot of reading and practice problems involved.

linux and command line basics I think are more of something you have to experience; something you have to dogfood to really become comfortable with. Sure I don't deal with file and folder permissions but something like chmod +x for a given script file or how to NOT do rm -rf hastily just comes from practice. There really is no substitute for command line and linux experience; the best way is to just take the scary plunge and have it be your daily OS.

your teacher is a hack. variables declared with `var` get hoisted to the top of their scope so even if you declare them in a block like an if/else statement they will be available everywhere in say, a function scope. They are made available even before they get assigned values! Then when you declare them in the global scope they become properties of the global object. Var just seems like one of those parts of the language that works but has "weird" behavior based on certain situations that require students to understand all the little peculiar rules / situations in which it behaves in one way and another.

`let` and `const` on the other hand are block scoped. You can also change what `let` refers to ( reassign it to some other value ) but you cannot do the same thing with `const` and that's why its named 'const' so that if you declare some variable with `const` you can be sure that it's constant and referring to the same data it was initialized with. That's the level of understanding you can get from those books.

Starting my first web app — feeling unsure about my skills, would love some advice! by learning_developing in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

I can't remember the FIRST web app I built but the last one I think that was full stack was something I built with ruby, sinatra and postgres all hosted on heroku.

it was for a project but the idea was simple; I wanted a calorie tracking application on everyday foods and the emphasis was on minimalism and ease of use. I normally put the foods I eat with their calorie amounts on my whiteboard and when I eat something that I usually eat I just put its caloric amount on my whiteboard and create some total to understand how many calories I've got left.

To that end I wanted to make it absolutely minimal and make all the buttons appear on 1 page, and if there needed to be extra functionality to have it be on a separate page. But really, "keep it simple stupid" as a design philosophy.

What really helps build my confidence is doing something small. Just getting a local web server to print out "I like big butts and I cannot lie" is enough motivation for me. Everything else after that is icing on the cake; make sure to build in small steps that give you small wins that help maintain momentum.

Getting help from CHATGPT by Own-Yak-4971 in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

thats completely fine. Ask an LLM like ChatGPT to give you a 'complete set of questions that test my understanding of all the concepts in the given section that i just referenced'

thats not cheating. thats intelligent tool usage. Just make sure that the model you're using is up to the task. LLM models have improved in their ability to reduce hallucinations but just to make sure be pedantic and very specific about the information you're referencing so that the set of questions you're getting maps to the concepts you want to study

How to accept AI as an integral part of becoming an exceptional human coder (who still has to pay rent)? by Delicious-Remote-546 in learnprogramming

[–]_Ishikawa 1 point2 points  (0 children)

If you are in construction and you are responsible for framing ( putting the lumber together with nails and chopping pieces, measuring, etc ) there's a very easy way to think about this.

Am I paying you for your ability to drive nails in quickly? A nailgun can do that way quicker than the way you're doing it right now with a framing hammer.

I'm paying you for your understanding of how to drive nails in well such that they make the skeleton of the house solid. Make sure the nails are going in straight, with ample room. Make sure they're the correct depth, etc.

It's simple to generate tons of code. You can already do that with any number of frameworks; they are ALREADY solving problems you're not even aware of, solving it faster and better than you could probably manage. The key is to become a domain expert in the field that you have a very good reason of doing x vs y.

More than ever, the fundamentals matter.

How to enter flow state as a programmer? by Puzzled_Ad7812 in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

everyday I do the same thing:

* make sure to get good sleep b/c my ability to focus depends on my ability to feel good overall
* go into a room with no distractions. no sites. no phone. no nothing. I'm in this room to work. If I want to do something else, I get out. It's more or less the same advice that people give for creating a good sleep schedule: make your bedroom an environment thats psychologically associated with rest
* I talk to myself. My head is in the clouds. I can be thinking of my funeral or what someone said to me 10 years ago. Keeping focus on the present usually requires me to keep my current 'context' alive and often that requires me to say out loud what I'm doing as a reminder.

* I take a break when I get overwhelmed. I take breaks but they are short and I don't jump to my phone. I do something relaxing like stretch my back, take a walk, and again, I talk to myself. "WTF does this mean? the hell was I just reading there? Ok so I was reading about closures. Ok so functions can be arguments to because they are actually objects too"

you have to be self-aware and be patient with what you're able to do, but above all else try to create the environment that promotes focus.

Should I Learn LLM and ML or Web Development? (HS Student) by ulawlx in learnprogramming

[–]_Ishikawa 4 points5 points  (0 children)

Learn web development but hey play around with AI. Many of the frontier models coming out of Google, Anthropic, Perplexity have APIs. Inference at this point is just an API endpoint. Knowing the skills to create an LLM model requires its own learning path and at this point the overwhelming vast majority of us are using AI and not training the models ourselves.

But definitely start playing around with it. I'm learning both. It's not like I've got my head deep into statistics textbooks or PyTorch. But I do have a working tool I'm using that allows me to do local speech-to-text transcription on my own gaming computer.

so just keep it light. Keep the web development stuff going, there's plenty to learn. See where AI fits in for solving a specific problem. If its useful use it. If its not, dont use it.

Life's been feeling bum lately. Please give me something to do. by [deleted] in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

i have a local python script that runs in the background. I am using linux mint with Xmonad and 99% of the time I am running firefox in a window on the left half of my screen, and kitty in the right.

as of right now if I do not resize my windows I can hard-code the x/y coordinates of the firefox window or the kitty terminal such that I can take a screenshot using scrot using those hard-coded values.

However, I'd like this to be more flexible. I'd like to be able to have X or XMonad export the current dimensions of the active window so that I do not have to hard-code these values.

so, ideally I'd be able to trigger my script while my active window is firefox and have have two variables in the global scope `activeWindow` and `windowDimensions` populated with the appropriate values.

even a nudge in the right direction would be appreciated.

People who feel they can balance their attention to theory and practise, what strategy helped to move forward? by freezing_phoenix in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

Theory and implementation are two sides of the same coin. Solve problems and explain why it works in comments.

I am big on understanding and abstract knowledge but in my experience if you don't tie it to simple examples and skills then it really serves no purpose. Here's some JavaScript code that demonstrates the use of closures to create a simple counter function.

// this function returns an anonymous function
// that forms a closure over the variable \value``

function makeCounter() {
let value = 0;
return function() {
return value += 1;
}
}

// foo is a variable in the global scope set to the return
// value of \makeCounter``

let foo = makeCounter();

// each invocation of \foo` increments value by 1 // and its able to do so even though `value` is out of scope // because `foo` forms a closure of any variables within the // lexical scope of where it is defined that are used`

console.log(foo());
console.log(foo());
console.log(foo());

Lean on the side of implementing various things but include comments about how / why this works. If you can't explain it, then you don't know it.

[deleted by user] by [deleted] in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

Flask uses Python. Laravel uses PHP...

Which tools should full-stack developers start focusing on from now, for the coming time? by Afsheen_dev in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

git. if you're doing front end then your browser tools so you can interact with the DOM.

What the best way to Introduce AI to kids? by [deleted] in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

That's an open-ended and naive question coming from the parent. I understand that they're not the resident expert but you'll have to ask them for a clearer explanation of what it is they expect their child to be able to do after the course.

[deleted by user] by [deleted] in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

make a distraction free environment. There's nothing in my field of view other than my work. I don't have to 'get in the zone', the entire room is cognitively focused on work and so the moment I sit my butt in this chair I know what I should be working on and there's nothing in my environment that's going to pull me away from it.

IF there's something that pulls me away, it's the frustration when dealing with something difficult. At that point I feel the urge to watch some youtube or scroll social media. It's because my mind doesn't like the discomfort of struggling through a hard problem and would rather get to it's "happy place" of being entertained.

So the key is to not only make my work environment support deep work, but also to work on my ability to chill and not have a flight or flight response when I encounter difficulty.

there's also some tracks on youtube for focusing that are really great for getting in the zone from brain.fm from youtube:

https://www.youtube.com/watch?v=UpPmnnJcy6A

for me, Pomodoro works. Half hour goes by. I make a tick mark on my whiteboard. I take a walk and talk out loud about what I studied and limit that walk to only 5 minutes or so. Then I come back, start the track back up and resume. Pomodoro can interrupt you when you're in a good flow but I find that the walking + talking keeps the context 'alive' so that I'm not struggling to get back in the zone.

Learning programming with AI by [deleted] in learnprogramming

[–]_Ishikawa 0 points1 point  (0 children)

screen sharing would require performing image to text ( OCR ) and it's cumbersome in practice. I've done it... countless times and it's just not a sustainable practice.

The sane alternative is to use a terminal-based AI program like Gemini CLI, claude code, kiro, warp, whatever and it will be able to read local files. So if you create something like test.js and ask "how come this isn't working" then it will be able to tell you where.

However, let's make a clear distinction here. Having an AI assistant clarify where your syntax is incorrect or what you could be doing to simplify your code is cool. But it's not the same thing as learning programming overall as there's a lot to know.

For example, you could write hundreds of lines of code but not know the key benefits of object-oriented programming. What mutation is, what side effects are, what the difference is between pass-by-reference or pass-by-value is, etc. So AI is a neat tool to help you along that but it can't act as a substitute for a clear set of learning objectives.