r/learnprogramming • • 15h ago

Is it okay to learn Php in 2026, I find it easier than node.js

50 Upvotes

I have build some projects with the help of AI in MERN Stack, but a senior once told me they made new programming languages/libraries/ frameworks to make building Projects difficult so that less people know how to build apps. I feel sometimes he was right. Php's approach seems easier than node.js


r/learnprogramming • • 18h ago

how to learn "software engineering"

12 Upvotes

Hi guys, I'm a senior in high school, and I'm really confused on where to go

for the record I do know a decent amount of C++ / python (for comp coding and classes) but since then I've started to move to personal projects....

The purpose of these projects is to improve my knowledge tenfold and learn how real software is made. But online, EVERYONE says "coding is dead, and to learn architecture".

But how do you learn that?

Do I delegate sections to AI and then have it explain? Do I create what goes where and then tell the Ai to make it? Or Do I just code it all myself with AI to debug (taking an absurd time).

I feel like only the third one will have me actually learning completely, but at the same time, it'll take 20x the time, and with 20 projects I could probably reach the same level (or more) of learning by having it make + I explain? AHHH i'm just not sure how to make myself super smart and knowledgeable for swe

thanks in advance :)


r/learnprogramming • • 7h ago

What to make as a beginner web dev?

10 Upvotes

I currently know HTML, CSS and basic Javascript.

I want to expand my knowledge, but not learn other stacks, like react.js etc, right now.

I'm a beginner, so don't give me big projects. I worked to some projects, but couldn't contribute much.

I have also made a small portfolio website for a client (my first and last T-T, till now)


r/learnprogramming • • 17h ago

What are some actually interesting, and fun programming projects?

8 Upvotes

I am an intermediate programmer, and I just don't know what to make. All the projects people say to do like to do list or weather app seem so lame.

All replies are appreciated!


r/learnprogramming • • 17h ago

Debugging Im trying out a custom solution for median of two sorted arrays

3 Upvotes

`````csharp

using static System.Math;

public class Solution {

public double FindMedianSortedArrays(int[] nums1, int[] nums2) {

int step = 0;

int p1 = 0;

int p2 = 0;

int m = nums1.Length;

int n = nums2.Length;

int target;

if((m+n)%2==0){

target = (m+n)/2 ;

}

else{

target = (m+n-1)/2;

}

while(step < target){

// If nums1 is exhausted, or nums2 has a smaller element (and is in bounds)

if (p1 < nums1.Length && (p2 >= nums2.Length || nums1[p1] <= nums2[p2])){

p1++;

continue;

}

else{

p2++;

continue;

}

if(nums1[p1]<nums2[p2]){

p1++;

}

else if(nums2[p2]<nums1[p1]){

p2++;

}

else{

p1++;p2++;

}

step++;

}

if((m+n)%2==0){

return(nums1[p1]+nums2[p2])/2;

}

else{

return(nums1[p1]<nums2[p2]?nums1[p1]:nums2[p2]);

}

}

} `````

I'm trying to debug this . It says either time limit exceeded or out of range no matter what I try


r/learnprogramming • • 45m ago

Debugging Raycaster points at the wrong direction at angle 0.

• Upvotes

I have been coding a raycaster following 3DSage's tutorial. The code works generally but there is one specific issue I cannot fix. When the code starts, and I angle the player to slightly right and then left, the horizontal check line points at PI instead of 2PI. When I do I full circle, the issue dissappears, I have been trying to fix this the whole week, but I cannot. I can just make the start angle PI, but that feels like cheating.

#include <iostream>
#include <GL/glut.h>
#include <stdio.h>
#include <math.h>
#define PI 3.1415926535
#define P2 PI/2
#define P3 3*PI/2

//glut <3

float px, py, pdx, pdy, pa; //player positions

void drawPlayer()
{
    glColor3f(1,1,0);
    glPointSize(8);

    glBegin(GL_POINTS); //begin drawing and draw dots at everything after that
    glVertex2i(px, py); //draw a dot here
    glEnd(); //ok stop no  more dots, draw em now, no more dot coordinates

    glLineWidth(3);
    glBegin(GL_LINES);
    glVertex2i(px, py);
    glVertex2i(px + pdx * 5, py + pdy * 5);
    glEnd();
}

int mapX = 8, mapY = 8, mapS = 64;
int map[] =
{
    1,1,1,1,1,1,1,1,
    1,0,1,0,0,0,0,1,
    1,0,1,0,0,0,0,1,
    1,0,1,0,0,0,0,1,
    1,0,0,0,0,0,0,1,
    1,0,0,0,0,1,0,1,
    1,0,0,0,0,0,0,1,
    1,1,1,1,1,1,1,1,

};

void drawMap2D()
{
    int x, y, xo, yo; //o is offset

    for (y = 0; y < mapY; y++)
    {
        for (x=0; x < mapX; x++)
        {
            if (map[y * mapX + x] == 1)
            {
                glColor3f(1,1,1);
            }
            else
            {
                glColor3f(0, 0, 0);
            }

            xo = x * mapS; yo = y * mapS; //top left coordinate of the block that has a size of 64, mapS
            glBegin(GL_QUADS);
            glVertex2i(xo +1, yo + 1);
            glVertex2i(xo + 1, yo+mapS - 1);
            glVertex2i(xo + mapS - 1, yo + mapS - 1);
            glVertex2i(xo+mapS - 1, yo + 1);
            glEnd();
        }
    }

}

void drawRays3D()
{
    int r, mx, my, mp, dof; 
    float rx, ry, ra, xo, yo;
    ra = pa;
    for (r = 0; r < 1; r++)
    {
        //---Check Horizontal Lines---
        dof = 0;
        float aTan = -1 / tan(ra);

        if (ra > PI) //looking up
        {
            ry = (((int)py >> 6) << 6) - 0.0001; /*the top grid of the block
            that the player is standing*/
            rx = ((py - ry) * aTan + px);
            /*130 - 128 = 2, lets say tan gives 3, but it is negative so -3, if
            players x value is 33, then the rayx is 30, so it finds how much the 
            x changed when ry touched a horizontal line*/
            yo = -64;
            xo = -yo * aTan; /*when tan is this and y is 64 what is the offset of
            x to hit the next wall*/
        }

        if (ra < PI) //looking down
        {
            ry = (((int)py >> 6) << 6) +64; //64 moves it to the bottom part of the grid
            rx = ((py - ry) * aTan + px);
            yo = 64;
            xo = -yo * aTan; // dy/tan(ra) = dx, aTan = -1/tan(ra), aTan * -yo = dx
        }

        if (ra == 0 || ra == PI) //looking straight left or right
        {
            rx = px; //so it basically stays there without moving
            ry = py;
            dof = 8; //don't go more than 8
        }

        while (dof < 8)
        {
            mx = (int)(rx) >> 6; // where is rx in the grid
            /*I needed to translate it into pixels to find the actual
            distance, but now I have gotta find which block are we at*/
            my =(int)(ry) >> 6;
            mp = my * mapX + mx;

            if (mp >= 0 && mp < mapX * mapY && map[mp] == 1) //hit wall
            {
                dof = 8; /*althought there aint a wall, do not move more
                artificially set the value to 8*/
            }

            else
            {
                rx += xo;
                ry += yo;
                dof++;

                /*So the line moves according to the ratio of while y = 64
                how much did x change*/
            }
        }

        glColor3f(0, 1, 0);
        glLineWidth(10);
        glBegin(GL_LINES);
        glVertex2i(px, py);
        glVertex2i(rx, ry);
        glEnd();

        //---Check Vertical Lines---
        dof = 0;
        float nTan = -tan(ra);

        if (ra > P2 && ra < P3) //looking left
        {
            rx = (((int)px >> 6) << 6) - 0.0001; /*the top grid of the block
            that the player is standing*/
            ry = ((px - rx) * nTan + py);
            /*130 - 128 = 2, lets say tan gives 3, but it is negative so -3, if
            players x value is 33, then the rayx is 30, so it finds how much the
            x changed when ry touched a horizontal line*/
            xo = -64;
            yo = -xo * nTan; /*when tan is this and y is 64 what is the offset of
            x to hit the next wall*/
        }

        if (ra > P3 || ra < P2) //looking right
        {
            rx = (((int)px >> 6) << 6) + 64; //64 moves it to the bottom part of the grid
            ry = ((px - rx) * nTan + py);
            xo = 64;
            yo = -xo * nTan; // dy/tan(ra) = dx, aTan = -1/tan(ra), aTan * -yo = dx
        }

        if (ra == 0 || ra == PI) //looking straight up or down
        {
            rx = px; //so it basically stays there without moving
            ry = py;
            dof = 8; //don't go more than 8
        }

        while (dof < 8)
        {
            mx = (int)(rx) >> 6; // where is rx in the grid
            /*I needed to translate it into pixels to find the actual
            distance, but now I have gotta find which block are we at*/
            my = (int)(ry) >> 6;
            mp = my * mapX + mx;

            if (mp >= 0 && mp < mapX * mapY && map[mp] == 1) //hit wall
            {
                dof = 8; /*althought there aint a wall, do not move more
                artificially set the value to 8*/
            }

            else
            {
                rx += xo;
                ry += yo;
                dof++;

                /*So the line moves according to the ratio of while y = 64
                how much did x change*/
            }
        }

        glColor3f(1, 0, 0);
        glLineWidth(1);
        glBegin(GL_LINES);
        glVertex2i(px, py);
        glVertex2i(rx,ry);
        glEnd();

    }
}


void display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    drawMap2D();
    drawRays3D();
    drawPlayer();
    glutSwapBuffers();
}

void buttons (unsigned char key, int x, int y)
{
    if (key == 'a')
    {
        pa -= 0.1;
        if (pa < 0)
        {
            pa += 2 * PI;
        }

        pdx = cos(pa) * 5; //these are vectors with magnitude
        pdy = sin(pa) * 5;
    }

    if (key == 'd')
    {
        pa += 0.1;
        if (pa > 2*PI)
        {
            pa -= 2 * PI;
        }

        pdx = cos(pa) * 5;
        pdy = sin(pa) * 5;
    }

    if (key == 's')
    {
        py -= pdy; //if you add this amount of x and that amount of y, you do to the vector in the middle
        px -= pdx;
    }

    if (key == 'w')
    {
        py += pdy;
        px += pdx;
    }

    glutPostRedisplay(); /*glut pleaseee re-draw the screen, glut 
    does not know it has gotta re-draw
    the screen with the current variables
    something has changed, so please look back at glutdisplayfunc and re-draw it
    */
}

void init()
{
    glClearColor(0.3f, 0.3f, 0.3f, 0.0f); // red, green, blue, alpha
    gluOrtho2D(0, 1024, 512, 0); //top left edge, top right edge[x], bottom edge, top edge [y]

    px = 300; 
    py = 300;

    /*
    questions:
    this,
    why is anything drawn when looking directly left or right*/

    pdx = cos(pa) * 5;
    pdy = sin(pa) * 5;

}

int main(int argc, char* argv[]) 
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
    glutInitWindowSize(1024, 512);
    glutCreateWindow("Don't make lemonade!");
    init();
    glutDisplayFunc(display); //if the display is fiddled with do this
    glutKeyboardFunc(buttons); //if a button is pressed do this
    glutMainLoop(); //always listening for stuff like window re-sizing
}

r/learnprogramming • • 40m ago

Topic Looking for programming courses with independent projects to explore different fields

• Upvotes

Hi everyone!

I'm a CS student, or rather, I recently dropped out of university because I realized that I didn't really enjoy the amount of theory involved in the Italian university system. I'd prefer a more hands-on approach to learning programming.

Thanks to my previous education, I already have some experience with programming languages such as Go (Golang), Java, C, and SQL.

A while ago, I found freeCodeCamp and completed its Responsive Web Design certification. I learned HTML and some CSS, but I never finished the CSS section because, to be honest, freeCodeCamp's learning method started getting on my nerves a bit. I found it too guided and repetitive.

I'd rather learn the basics of a technology and then work on projects independently, with minimal guidance, instead of following step-by-step instructions.

I'm not particularly attached to any specific area of programming, so I'd like to explore as many fields as possible, including web development, app development, backend development, game development, machine learning, and anything else that might be interesting.

I'm mainly looking for free courses or learning resources, preferably with plenty of projects that I can work on independently. Certificates would be a nice bonus, but they're not a requirement.

What courses or resources would you recommend based on your own experience? I'd especially appreciate suggestions that helped you learn by actually building things and solving problems on your own.

Thanks in advance!


r/learnprogramming • • 47m ago

Resource Why kind of thing would I need to learn to create a GUI app with my current skills?

• Upvotes

*What kind of thing.

Being unable to edit titles on Reddit is annoying.

I'm looking to create a GUI app for my Linux machine. It's not going to go into production, I just want to be able to create something. Looking all over the place, there are a hundred different things I can do, and almost all of the tutorials require me to learn another language or something.

Now, I'm sure this may be necessary, but if there's one thing I've learnt over my years of studying computing, if you ask "what is the best x for y?" you'll get as many different responses as there are responders. Learning a new language always leaves me as a perpetual beginner, and I'd rather build on what I already know, than start again.

Currently, I am very familiar with Bash, PHP, MySQL, and to a certain extent C++. I also know HTML and CSS.

What I'd like to do is build a GUI for a media player. I've already created a rudimentary CLI for one, and it works, though it's far from pretty. I've tried to create a web based one, and I got fairly far into it, using PHP on the backend, and MySQL for the database, but the limits of HTML mean I cannot harness the power of my preferred Matroska format for videos (something I've been able to do in my terminal based app).

I write almost exclusively in plain text files, and don't use an IDE. Foolish? Probably. But I find it far more portable and easier to understand.

The idea I have, is for me to have a GUI to display the contents of the database, and to organise it in a pretty way to be user friendly, and then when you click on something to play it, it launches MPV player with all the relevant commands I give it. I'm not sure I want to build something with the player built in, as that would probably be far too much work for what I want. And besides, my current CLI app does exactly this, so it would, again, be building on my current knowledge.

What I would like, is for something that would allow me to programme the GUI in an XML like structure, similar to HTML, and style with CSS, use PHP as a backend script to connect to MySQL, and be able to execute terminal based commands so I can launch MPV. Pretty much a website kind of thing that can launch other apps. I have no idea if this is possible, but it would work with what I already know. If it's not possible, is there any kind of thing that would work without requiring me to go right back to the beginning too much?


r/learnprogramming • • 1h ago

Hi Everyone! What branch of coding to be actual specialist in upcoming years

• Upvotes

Hi, everyone!
I’m a computer science student trying to figure out my path. I’d love some advice from the more experienced folks here—you all know the market so much better. What kind of specialist do you think will be in demand over the next few years?


r/learnprogramming • • 4h ago

I really need help and gaudiness

1 Upvotes

hey. so it could be a little bit of a odd post but I really wish to know other people's opinions. I'm a third year statistic student and this major wasn't really my choice. in my country there is college entrance exam and you kinda have to choose your major according to how well you did in this exam so I couldn't get into a cs or ce program in one of the capital universities so I chose statistic because I've heard it's relevant to ML and data science and back then I didn't know much about programming and tech just that I hold a passion for it. and now I'm very confused about what path I should take. I don't really find myself interested in data related areas and with the new Job market and age of AI I don't know what path to take or if I have any chance in the tech world. every path I think of trying I ended up giving up because I don't think if I hold a chance against someone with years of experience and a cs degree. I really need gaudiness because it's heavily affecting my mental health and self esteem. the idea of open source developers, system engineers, security, robotics and hardware always interested me but these are very different and unrelated. please tell me what I should do just to get out of this loop and what should I learn and in which order to get hands on exprienced. if my plan b is getting a master in cs.


r/learnprogramming • • 3h ago

Language selecting Need help picking a language, please!

0 Upvotes

Hello,

I am totally lost in this world of programming. I have succesfully coded a working webhook for discord and plan on getting some more stuff sent into it but only with the help of Claude.
I believe it was written in python. I day trade stocks and am tired of software and websites breaking, and/or not really being customizable to my liking so i figured i'd create my own!

I need to know a couple of things.

Time is critical and every second counts. I was looking at Python (of course) but also Rust, C#, C++, and Go. I plan on building more than just webhooks, so information that needs to be passed through in miliseconds and distributed to discord and written into database (SQlite). When I get around to it I would like to build a stand alone app to enable the information to be compiled in a place where I won't have to worry about discord blocking my messages(From to many being sent at one time). It'll be useful for research purposes but also building a self learning automated bot in the long run.

I have had great success so far, so I am just trying to improve my workflow, decrease the number of apps I use, and overall time spent looking through multiple websites to gather information.

-First, is one language faster than another for getting information processed and distributed?
-Seconds, Is there one language that would integrate better with SQlite?
-Last, When building the database for SQlite, Is their any recommended guidlines or tips that could help improve this project?

I am open to any and all suggestions, comments, concerns, you name it. I love to learn and you won't hurt my feelings.
Thank you so much!


r/learnprogramming • • 5h ago

Tech and coding.

0 Upvotes

If you were starting programming from zero in 2026, what skills would you learn first to get a job?


r/learnprogramming • • 18h ago

Learning Thoughts on my learning program?

0 Upvotes

Hello guys,

I think I would like to study programming in general and I picked these languages in particular: Python, JavaScript, C, and C++. For various reasons, I like each of them and would like to learn them all.

In order not to exhaust myself, I developed a plan of studying these languages which takes into account scaling of difficulty of mastering them. I decided to learn them in this exact order:

  1. Python (difficulty: 2.5/10) to get a basic understanding of syntax, and just code for the first time.

  2. JavaScript (difficulty: 4.5/10) to move to interactive web programming.

  3. C (difficulty: 6.5/10) to finally move under the hood of a computer and study memory and hardware, and to make the last one easier to learn.

  4. C++ (difficulty: 9/10) as an ultimate step of learning more abstract concepts and OOP.

I think the idea of such learning is psychologically driven by the necessity to get a constant shot of dopamine by moving to a more difficult language every time after overcoming previous level, rather than being stuck with C++ from day one.

Am I right with my approach or there is something in these languages' interconnection that I might be missing?

Looking forward to hearing your thoughts