Skip Navigation
Learn Programming

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.
  2. Provide everything up front. Don't make people fish for more details in the comments. Provide background information and examples.
  3. Be present for follow up questions. Don't ask for help and run away. Stick around to answer questions and provide more details.
  4. Ask about the problem you're trying to solve. Don't focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Members
1,805
Posts
114
Active Today
1
Created
2 yr. ago
  • Learn Programming @programming.dev
    Cyno @programming.dev

    How do you know if you are overengineering? Specific example in mind

    I will frame the question in terms of a specific C# objective that I am working on right now but I imagine the question is a pretty general one related to the Dunning-Kruger effect, in a way - how do you know how to build an application when you don't know all the issues you are supposed to prevent?

    There is a message hub and I am developing a consumer for it. The original plan was to just create a few background services that get initialized alongside the application, that have a loop to load new messages/events and then process them.

    Some time has passed and it feels like I am knees deep in Wolverine, Quartz, Hangfire, MassTransit, transactional outbox and all manner of different related things now. The potential issues are dealing with downtime, preventing loss of messages by storing them in a separate table before processing them, and everyone on the planet has a different idea on how to prevent and solve them and none of them sound simple and straightforward.

    Honestly at this p

  • Learn Programming @programming.dev
    odd @feddit.org

    Excellent new tool to learn Git!

  • Learn Programming @programming.dev
    Colloidal @programming.dev

    What is NoSQL good for?

    I’m versed enough in SQL and RDBMS that I can put things in the third normal form with relative ease. But the meta seems to be NoSQL. Backends often don’t even provide a SQL interface.

    So, as far as I know, NoSQL is essentially a collection of files, usually JSON, paired with some querying capacity.

    1. What problem is it trying to solve?
    2. What advantages over traditional RDBMS?
    3. Where are its weaknesses?
    4. Can I make queries with complex WHERE clauses?
  • Learn Programming @programming.dev
    rissanen @techhub.social

    Learning by doing is hard to beat when it comes to building software.

    Learning by doing is hard to beat when it comes to building software.

    I am starting a home lab to have a safe environment to try things out. Any ideas on what I could run that is completely useless but fun to set up?

    @learnprogramming
    @homelabs

  • Learn Programming @programming.dev
    originalucifer @moist.catsweat.com

    dynamic tables?

    im trying to understand 'dynamic tables' [snowflake] and they kiiinda just sound like materialized views + automation on cache results?

  • Learn Programming @programming.dev
    Cobratattoo @feddit.org

    How to define lines and check on click which body is clicked?

    How can I define lines so when I click on the screen, my program knows whether I clicked on A B or C?

  • Learn Programming @programming.dev
    Saki @lemmy.blahaj.zone

    Can only send post requests to root page in JS

    Hi, I have this function that is supposed to upload a file stream to another page:

     undefined
        
    async function getData() {
        const vocadata = await fetch('http://localhost:3000/upload/',
            {
                method: "POST",
                headers: {
                    "Content-Type": "multipart/form-data",
                },
                body: data,
            });
        console.log(vocadata);
    };
    
      

    The problem is though, no matter what URL I enter in the first argument, it always posts the request to /. How can I fix this?

  • Learn Programming @programming.dev
    1xb0 @lemmy.cafe

    How do I come up with good project ideas?

    I've been stuck in this mindset where I can't think of any good website ideas, or game ideas, or anything really. I want to get out of this mindset by thinking, "What should I make?", or "What do I need to make?".

    I still follow peoples advice on "go take a walk and think about it for a bit" and "you'll get one soon" and things like that. Those don't seem to work.

    All I need is advice on how I can make myself come up with ideas for projects that would let me do something with my free time. Any help would be appreciated!

  • Learn Programming @programming.dev
    ZILtoid1991 @lemmy.world

    Any alternative for libevdev for controller handling on Linux?

    I know stuff like SDL and RayLib exists, but I already have my own X11 and Windows API stuff working, and otherwise those libraries like to obscure things from the user in the name of "ease of use", sometimes even missing features (force feedback and proper XInput are the ones that are often skimped out on for whatever reasons, and only SDL has them to my knowledge). While I'll implement libevdev eventually, it has the issue of needing access to the devices.

    While I found some reference to game inputs in X11's input extensions, I cannot find any user guide on them, since they're instead pointing me to SDL and co.

  • Learn Programming @programming.dev
    ZILtoid1991 @lemmy.world

    Where can I find OpenGL tutorials that are known to be not generated by AI?

    I not only have hard time finding tutorials, but even if I do, I have a hard time getting them to not crash, let alone working. I don't know what's the reason, but I have a suspicion that some of these are now AI generated, hence the issues of them not working or outright crashing.

    I know newer APIs exist. They're way too complicated for my usecase.

    I've heard about WebGPU, but I don't want to touch it with a 10 meter long pole, due to its name. I'll have a lot of time convincing people that WASM isn't a web-only thing, and me using it for scripting won't mean my game engine is either Web-based, nor that it has any Web-capability, and I only stayed with it due to my inability of finding a well-supported scripting VM without "Web" in its name.

    If you ask: My game engine is currently using CPU rendering, and used to use SDL2 for displaying the output. I decided to move away from them. Managed to find some basic OpenGL tutorials when I first write my replacement for the SDL2 window han

  • Learn Programming @programming.dev
    ZILtoid1991 @lemmy.world

    What is wrong with my shaders?

    Vertex:

     glsl
        
    #version 120
    
    void main() {
        gl_TexCoord[0] = gl_MultiTexCoord0;
        gl_Position = ftransform();
    }
    
      

    Fragment:

     glsl
        
    #version 120
    
    uniform sampler2D tex;
    
    void main(){
        vec4 texSlmp = texture2D(tex, gl_TexCoord[0].st);
        gl_FragColor = vec4(texSlmp.r, texSlmp.g, texSlmp.b, 1.0);
    }
    
      

    All I get with this is a black screen.

    I cannot seem to get tutorials for anything older than OpenGL 3.3, and for my usecase, I could go lower, except everyone tells me "OpenGL is obsolete, try Vulkan instead".

    gl_TexCoord[0] seem to be all zeros if I modify the fragment shader to try to output gl_TexCoord[0].st, so its content would be displayed as color information, which I did for a different test. Also I can't find anything on how do I "pass" textures (or other values) to the shaders in the official docs, nor any of the tutorials I could find explains how that actually works.

    EDIT: Target version is OpenGL 2.1/GLSL 1.20

    EDIT2: I updated the shaders to GLSL 3.30, but t

  • Learn Programming @programming.dev
    Binette @lemmy.ml

    Is it better to check if a file exists before trying to load it, or to try to load it, and catch the error and move on?

    For context, I am trying to do a save system for a game.

  • Learn Programming @programming.dev
    Harendra @programming.dev

    Why Go Interfaces Are the Remarkable Secret to Clean Code Mastery

  • Learn Programming @programming.dev
    Harendra @programming.dev

    Unlock the Secrets of Web Storage APIs in JavaScript

    Learn about Local Storage, Session Storage, Cookies, and IndexedDB with working code examples

  • Learn Programming @programming.dev
    andioop @programming.dev

    What are some easy-to-solve errors you spent awhile fixing?

    I just spent an hour searching for how I could have gotten an

    Uncaught TypeError: Cannot set properties of null

    javascript. I checked the spelling of the element whose property I was trying to set and knew that element wasn't null because the spelling was the same in the code as in the HTML. I also knew my element was loading, so it wasn't that either.

    Turns out no, the element was null. I was trying to set " NameHere" when the element's actual name was "NameHere".

    Off by a single space. No wonder I thought the spelling was the same—because all the non-whitespace was identical. (No, the quotation marks slanting in the second NameHere and being totally vertical in the first NameHere wasn't a part of the error, I am typing them all vertical and either Lemmy or my instance is "correcting" them to slanted for the second NameHere. But that is also another tricky-to-spot text difference to watch out for!)

    And what did not help is that everywhere I specifically typed things out, I

  • Learn Programming @programming.dev
    rangeva @lemmy.world
  • Learn Programming @programming.dev
    Cyno @programming.dev

    I don't grok repositories and services and where's the cut-off point for them

    I understand the basic principle but I have trouble determining what is the hard line separating responsibilities of a Repository or a Service. I'm mostly thinking in terms of c# .NET in the following example but I think the design pattern is kinda universal.

    Let's say I have tables "Movie" and "Genre". A movie might have multiple genres associated with it. I have a MovieController with the usual CRUD operations. The controller talks to a MovieService and calls the CreateMovie method for example.

    The MovieService should do the basic business checks like verifying that the movie doesn't already exist in the database before creating, if all the mandatory fields are properly filled in and create it with the given Genres associated to it. The Repository should provide access to the database to the service.

    It all sounds simple so far, but I am not sure about the following:

    • which layer should be responsible for column filtering? if my Dto return object only returns 3 out of 10 Movie
  • Learn Programming @programming.dev
    andioop @programming.dev

    How to go from writing code that works to writing efficient, clean code and following good practices?

    Besides some of the very, very obvious (don't copy/paste 100 lines of code, make it a function! Write comments for your future self who has forgotten this codebase 3 years from now!), I'm not sure how to write clean, efficient code that follows good practices.

    In other words, I'm always privating my repos because I'm not sure if I'm doing some horrible beginner inefficiency/bad practice where I should be embarrassed for having written it, let alone for letting other people see it. Aside from https://refactoring.guru/, where should I be learning and what should I be learning?