r/learnprogramming • • 8h ago

Looking to Collaborate on a Spring Boot Project

1 Upvotes

Hey everyone! Is anyone working on a Spring Boot project and looking for a contributor? I'm learning Java backend development and would love to collaborate, contribute to a real project, and learn from other developers along the way.


r/learnprogramming • • 10h ago

Learning FastAPI

1 Upvotes

I am a student learning FastAPI nowadays is it any benefit of learning fast API in the future


r/learnprogramming • • 21h ago

Code Review Please help me find out why formState goes stale in React Hook Form

0 Upvotes

I recently dabbled in react forms and got React Hook Forms setup to be used with my Zod schemas, it all works perfectly... that is until I reset the form. The reset causes the formState (to my knowledge) go stale as validation messages show that the title input is empty, but inspecting its value property through code and looking at the display of typed characters on the screen proves otherwise.

I tried multiple stuff and went through the React Hook Form docs, but tbh the docs were utterly useless as I couldn't make heads or tails of any of it. Interestingly tho, using watcher to re-render the react component causes all of it to work so I suspect its a synchronization issue, but I'm still starting out so I don't know for sure...

Schemas:

const PLAIN_DATETIME_REGEX =
  /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,9})?$/;


const DISPLAY_TIME_REGEX = /\bMoments\b|[hm]$/;


export const taskSchema = z.object({
  id: z.uuid().default(() => crypto.randomUUID()),
  status: z.literal(["complete", "incomplete"]).default("incomplete"),
  title: z
    .string()
    .trim()
    .min(1, "Title cannot be empty")
    .max(100, "Title cannot exceed 100 characters"),
  description: z.preprocess(
    (raw: string) => raw?.trim() || undefined,
    z
      .string()
      .max(2000, "Description cannot exceed 2000 characters")
      .optional(),
  ),
  createdAt: z.iso.datetime().default(() => Temporal.Now.instant().toString()),
  deadline: z.preprocess(
    (raw: string) => raw?.trim() || undefined,
    z
      .string()
      .regex(
        PLAIN_DATETIME_REGEX,
        "Deadline must be a valid ISO 8601 plain date and time",
      )
      .optional(),
  ),
  priority: z.literal(["low", "medium", "high"]),
});


export const taskFormSchema = taskSchema.omit({
  id: true,
  status: true,
  createdAt: true,
});


export const taskViewSchema = taskSchema.transform(
  ({ description, createdAt, deadline, ...rest }) => ({
    ...rest,
    description: description,
    createdAt: formatDateTimeSince(createdAt),
    deadline: formatDateTimeUntil(deadline),
  }),
);


export type Task = z.infer<typeof taskSchema>;
export type TaskForm = z.infer<typeof taskFormSchema>;
export type TaskView = z.infer<typeof taskViewSchema>;

Form Component:

export default function TaskSaver() {
  const {
    register,
    handleSubmit,
    reset,
    formState: { errors },
  } = useForm<TaskForm>({
    resolver: zodResolver(taskFormSchema),
    mode: "onChange",
    defaultValues: {
      title: "",
      description: "",
      deadline: "",
      priority: "low",
    },
  });


  const addTask = useTasksStore((state) => state.addTask);
  const id = useId();


  const onSubmit: SubmitHandler<TaskForm> = (data) => {
    const result = taskSchema.safeParse(data);


    if (!result.success) {
      console.error(result.error);
      return;
    }


    addTask(result.data);
    reset();
  };


  return (
    <form onSubmit={handleSubmit(onSubmit)} className={styles.root}>
      <div className={styles.group}>
        <label htmlFor={`title-${id}`} className="sr-only">
          Title
        </label>


        <input
          type="text"
          {...register("title")}
          id={`title-${id}`}
          className={clsx(styles.input, styles.inline)}
          placeholder="Title"
        />


        {errors.title && <p className={styles.error}>{errors.title.message}</p>}
      </div>


      <div className={styles.group}>
        <label htmlFor={`description-${id}`} className="sr-only">
          Description
        </label>


        <textarea
          {...register("description")}
          id={`description-${id}`}
          className={clsx(styles.input, styles.multiline)}
          placeholder="Description"
        ></textarea>


        {errors.description && (
          <p className={styles.error}>{errors.description.message}</p>
        )}
      </div>


      {/* Needs to be worked on: below */}
      <div className={styles.group}>
        <label htmlFor={`deadline-${id}`} className="sr-only">
          Deadline
        </label>


        <input
          {...register("deadline")}
          id={`deadline-${id}`}
          className={clsx(styles.input, styles.inline)}
          placeholder="Deadline"
        />


        {errors.deadline && (
          <p className={styles.error}>{errors.deadline.message}</p>
        )}
      </div>


      <div className={styles.group}>
        <label htmlFor={`priority-${id}`} className="sr-only">
          Priority
        </label>


        <select
          {...register("priority")}
          id={`priority-${id}`}
          className={clsx(styles.input, styles.dropdown)}
        >
          <option value="low">Low</option>
          <option value="medium">Medium</option>
          <option value="high">High</option>
        </select>
      </div>


      <div className={styles.group}>
        <button type="button" className={clsx(styles.button, styles.reject)}>
          Cancel
        </button>


        <button type="submit" className={clsx(styles.button, styles.accept)}>
          Save
        </button>
      </div>
    </form>
  );
}

r/learnprogramming • • 10h ago

Is finding open source issues getting harder, or am I approaching it the wrong way?

4 Upvotes

Hi guys,

I've been trying to get back into open-source contributions after spending couple of month working on personal projects.

I had 5 bug fix PRs merged into an OSS projects, and when I create those PR, I had no issue finding issue. But when I checked that same projects recently, there weren't any open issues left.
I've also looked through quite a few other projects, especially libraries I use, but I'm struggling to find issues that aren't already assigned or being worked on. (I've looked about 30 OSS)

Even when I find an issue, someone often opens a PR before I can fully understand and solve it, especially with how fast people can submit PRs using AI nowadays.

So I'm curious, how do you guys actually find issues to work on?
Do you just keep searching through repositories until you find something available? Or do you usually find bugs or improvements, and open your own issues?

Any recs would be helpful as well! I'm into ML and Data engineering, python or TS is preferred.

Thanks!


r/learnprogramming • • 7h ago

How did you improve your coding skills as a beginner?

25 Upvotes

I find coding a bit difficult. What helped you improve? Any tips or resources that worked for you?


r/learnprogramming • • 20h ago

Trying to learn how to code, is CS50 the way to go?

26 Upvotes

Hi guys I'm a high schooler who recently got interested in coding but I have been almost solely relying on ai. I know that I need to actually understand whats going on so I plan to learn how to code proficiently. I can code and understand basic python so far, but I am wondering if CS50 will allow me to progress more efficiently and faster.


r/learnprogramming • • 23h ago

At what point did programming stop feeling like memorizing random rules and start making sense?

106 Upvotes

Something I've been thinking about while learning programming is how different it feels to understand a concept in a tutorial versus actually being able to use it on your own.

You can watch someone explain loops, functions, data structures, or algorithms, and everything seems to make sense at the time. Then you open a blank editor, try to build something without following a tutorial, and suddenly you don't even know where to start.

I wonder if this is just a normal stage of learning or if there's a better way to approach it.

For those of you who have been programming for a while, was there a particular point when things started to click? Was it building your first project, solving problems on platforms like LeetCode, reading other people's code, or struggling through bugs until you finally understood what was happening?

I'm also curious how you balance learning new concepts with actually building things. Sometimes it feels like there's an endless amount of material to study, and it's difficult to tell when you know enough to move on to the next thing.

I'd appreciate hearing what genuinely helped you improve, especially things you wish you'd done differently when you were starting out.


r/learnprogramming • • 23h ago

Topic How do I improve programming fundamentals and basics?

13 Upvotes

How do I improve my coding ?


r/learnprogramming • • 21h ago

Discussion When people mention having a "personal style" in programming, What does that actually mean?

52 Upvotes

With all of the AI code thats out there now, I've heard people say that most code has lost the unique style of the developers. I can assume its just how they have structured the code and solved the problems but I'm not sure. If that is correct how can I have/develop that as I learn?


r/learnprogramming • • 4h ago

How do I become job-ready as a backend developer while using AI to code? Looking for honest advice

1 Upvotes

Hey everyone,

I'm working toward becoming a job-ready backend developer, currently using Python and FastAPI.

I've built projects, including a URL shortener, and I'm working on improving my skills. I use AI coding tools to speed up development, but I don't want to become someone who can generate code without understanding it or debugging it independently.

I'm trying to figure out a few things:

  • Learning: How do I balance building projects with AI and writing code myself so I actually improve?
  • Debugging: What's your process when you encounter a bug you don't understand, especially when AI keeps suggesting fixes that don't work?
  • Code quality: How can I tell whether my projects are good enough for a real production environment? What should I look for in testing, architecture, error handling, and security?
  • Getting hired: What helped you move from personal projects to landing your first software engineering job? What would you prioritize in today's market?
  • Feedback: If you're an experienced backend developer, what are the best ways to get honest criticism of my GitHub projects and identify the gaps I need to close?

I'm not looking for shortcuts or another list of technologies to learn. I want to develop the ability to solve problems independently, use AI effectively, and contribute to a real engineering team.

I'd appreciate honest advice, including mistakes you made and what you would do differently if you were starting today.

Thanks!


r/learnprogramming • • 6h ago

Returning to front end (React/TS) after a 3-year hiatus. Best way to bridge the knowledge gap and refresh my portfolio?

8 Upvotes

Hi everyone.

I worked as a Front-End Developer (React.js & TypeScript) for two years (2021–2023) before moving abroad to complete a Post-Graduation in Computer Science. During my studies I balanced a full-time non-tech job alongside my coursework, which meant my coding portfolio lay dormant, and I haven't written production code in roughly 3 years.

Now that I've completed my degree (3.9 GPA) and returned home, I’m feeling stuck on the best path to refresh my practical skills and get back into the market.

A few specific questions I'd love input on:

  1. Stack updates: What major shifts happened in the React/TypeScript ecosystem over the last 2–3 years should I prioritize catching up on?
  2. Refurbishing knowledge vs. courses: Is it worth taking a structured course to quickly repolish, or should I dive straight into building a complete full-stack project from scratch? Any specific updated courses or resources you'd recommend for someone with prior experience?
  3. Portfolio strategy: How should I frame this 3-year gap (academia + non-tech work) on my resume/GitHub when applying for mid-level or junior roles?

Thanks in advance for any insights or advice!


r/learnprogramming • • 14h ago

Question Early Exits in small sections

13 Upvotes

Hello, I have been practicing early exits throughout my code and was told I probably shouldn't be using them in small cases like the following where nesting wouldn't bring the code out too much, this is c++ code:

int findMaxInArray(const int arr[], const int num_elements) {  
  int maxIndex = 0;

  for (int i = 1; i < num_elements; i++) {
    if (!(arr[i] > arr[maxIndex])) {
      continue;
    }
    maxIndex = i;
  }
  return arr[maxIndex];
}

r/learnprogramming • • 15h ago

Topic trying to implement libc for windows to learn about c programming

3 Upvotes

Repo is here, welcome for contributions and anyone interested:
https://github.com/NHCM-dev/nwlibc

Trying to do a simple C standard library implementation for windows using WinAPI, which I think would be pretty useful for those who want to dive deep into C programming and learn about the mechanism about how programs really run


r/learnprogramming • • 18h ago

Resource What is the best way to read python's (crash course edition 3)?

7 Upvotes

I am trying to learn python with crash course then move to CS50p.

i suffer from a learning disablity and i hear people with such disability still learn python.

How should i read the books entirety then make projects or should i read it all and connect what i want for projects?

i want to figure out the best way to learn for me.


r/learnprogramming • • 20h ago

Programming Books That Read Like a Dictionary?

3 Upvotes

Hello. I’ve been wanting to start actually learning more about different programming languages, specifically applications and languages such as C#. I am a learner who loves reading in order to discover new things, but already know a lot about how programming languages work, and how each functions syntax-wise. So I have two questions:

  1. Are there any programming books that specifically work sort of like a dictionary with its documentation, where I can just look to a certain part to know about its syntax for a specific task?

  2. Is C# the way to go for what I want? If needed I can elaborate further. I don’t have an exact thing I want to do. All I know is that C# is a language that works well to build applications and is able to still perform its own tasks math and science wise.

Thanks!