Programming

212 readers
2 users here now

Welcome to the Lemmygrad programming community! This is a space where programmers of all levels can discuss programming, ask for help with problems, and share their personal programming projects with others.


Rules

  1. Respect all users, regardless of their level of knowledge in programming. We're here to learn and help each other improve.
  2. Keep posts relevant to programming and related topics.
  3. Respect people's personal preferences. If you disagree with someone's choice of programming language, method of formatting code, or anything else, don't attack the poster. Genuine criticism is fine, but personal attacks are not.
  4. In order to promote breaks from typing, all code snippets must be photos of code written on paper.
    Just kidding :), please use proper markdown code blocks.

founded 2 years ago
MODERATORS
1
2
3
4
5
 
 

Randomly stumbled into this article and found it very interesting. At a glance, his other articles here also seem promising.

6
 
 

💀💀💀💀💀

7
8
 
 
9
 
 

For anyone who doesn't know, advent of code is a series of coding challenges that happens every year. It's made to be like an advent calendar, with one programming challenge released per day until Christmas. Something interesting about this is that since the challenges only need the output of the program, you can do it in any language you want. I thought it might be interesting to compare and discuss solutions (ideally spoilered in case anyone hasn't completed the challenge yet).

Thoughts?

10
 
 
11
12
 
 

Skill issue

13
 
 

Any ideas what modern resources are useful for back end devs to learn modern front end development? I'm decently familiar with the basics of html, css, js, but don't really have experience with frameworks beyond basic bootstrap v3/v5, a smidge of react, some angular 1, etc. Kind of a smattering of tools but without real confidence to wield them in anger, you know? Hopefully this post can be helpful for other design challenged programmers.

Edit: extra resources on accessibility and security would also be much appreciated!

14
15
 
 

I’ve been really into serverless recently. Specifically, I’ve been running the T3 stack on Vercel. There are several reasons:

  1. I can bootstrap and deploy an app with full stack type safety, db, and auth in under 30 minutes.
  2. I have a tendency to rent a server, abandon the project, and forget to cancel. Meanwhile, most serverless providers have generous free tiers.
  3. I think it encourages a more decoupled architecture, which is just more maintainable in the long run.

That said, I’m tired of the patterns React encourages. I’m tired of the fact that it requires so much glue code to get things to work inside its model. I’m tired of prop drilling. I’m tired of the hype beast cycle. I’m tired of build steps and weird edge cases with server side rendering and shitty code maps. Now everyone’s talking about server functions and I’m just looking to get off the hype train. I’m tired of running projects from last year and being inundated with security warnings and having upgrades always cascade giant failures for inscrutable reasons.

Now, having used HTMX a bit and seen that their own repo is literally a 3k line vanilla JavaScript file with zero dependencies, it’s making me remember how much less tooling was required to throw together a simple website when I first started. You put a file in a directory. People would request the file. They would get the file, byte-per-byte.

I’m not saying I’m wanting to return to monke and just run LAMP on bare metal. I remember all the bullshit that came with that, too. But I really feel like there’s a middle ground to be had where all this modern deploy tooling can be used without 20 layers of abstraction. And without sacrificing type safety. It really feels more achievable than it’s been in a while, to build projects that don’t turn to mud after a couple years, but also don’t big you down and get in your way while you’re trying to iterate on ideas.

16
 
 

My gut answer is "yes!!!" or "revolution" but I want to hear what y'all think. For those unware, some creative professions such as film writers get paid a small portion of all revenue generated by their work after it's been produced, which is called a "residual," and it's part of their current fight with hollywood not properly paying those residuals due to the streaming loophole.

Since most programs that are profitable are based on the work of long gone developers (basically capital that gets worked on by machine labour), I think this might be a great demand for an eventual software development union.

What do y'all think?

17
1
submitted 1 year ago* (last edited 1 year ago) by roux@lemmygrad.ml to c/programming@lemmygrad.ml
 
 

I just realized that I made my last post 3 weeks ago. In any case, I staggered my learning with building a simple starter app and just finished my last bit of logic this am. Figured I would share in hopes of some sort dopamine activity via validation.

The App:

  • Has 2 sets of strings that are common phrases that people might use while navigating eating out at restaurants where language barriers might be an issue.
  • First set in bold are translated in the app via the Language tab
  • Second smaller set are translated based on the phone's locale settings.

The idea is that the phone owner should be able to read the text as well, so I wanted 2 sets for when one party speaks one language and the other party speaks another. I mostly wanted to have the challenge of handling translations from within and outside the app and figured why not.

The phrases can be toggled with the green buttons on the bottom. This is to fine tune the dietary preferences. Vegan will toggle everything but gluten as "cannot consume" or will set it for relative vegetarian(so no meat or fish but yes dairy and eggs)

I put gluten in there for anyone who has Celiac. I have found a frightening number of waitstaff that just assume that both veganism and gluten allergy is just "fad diets" so I wanted to include both for the little bit of crossover between the 2 lifestyle diets.

Screenshot with French for phone language and Spanish for in app language:

github: https://github.com/AndroidHell/ImVeganBTW

Notes:

  • The app title translate based on phone language but it should be based on in-app language since it's meant more for the person taking a food order to know "I'm Vegan. I might have it change based on vegan or vegetarian for the in-app language but I suppose that is handled by the first card. 🤔
  • The nav buttons are not translated and localizing those would be good
  • if text in the cards is too long, it gets cut off with ... at the end. This is a similar issue to the Jerboa app nav buttons for some languages. I might make the strings shorter(lazy route) or try to write some sort of scroll/ticker or make each card expand with full text.
  • The source code is a fucking mess. I already know. I started working on viewModel stuff before actually learning about it or app architecture.
  • Translations were done by Google Translate so if they are wrong maybe let me know and I can fix them. I only speak English so had to rely on Google on this.
  • I tried to pick main languages that I could come across in the States. I think they should work in other parts of the world but I used Mexican Spanish and Simplified Chinese so I donno how that might work out elsewhere.
18
 
 

Is Gitee, GitHub, or some other software forge preferred in China and the Global South?

I'm trying to decide whether I should mirror my open-source repos onto Gitee or another forge, as Github's dominance in the space and ownership by Microsoft is rather disconcerting for anyone in non-U.S.-aligned countries.

19
20
 
 

Or does anyone wanna buddy up and learn it with me?

I lost my job as a Java dev after a little less than 2 years and figured is play around with Kotlin for Android development.

Working on setting up unemployment and startinf the whole job hunt thing again for the umpteenth time in my life but will have a lot of free time in the interim so I wanna start working on an app idea for calculating dice weight for ttrpgs. I've been looking at Kotlin over the last few months and decided sure why not.

The plan is to get the fundamentals down and make 1 or 2 small projects and see where I am at. After that I'm considering chekcing out Rust as well. But that won't probably be until next year.

Kotlin doesn't have nearly as much of a community as Rust so this is probably a shit in the dark. But I guess but me up if you are interested. I've never done a buddy system with a language but with my attention issues it might help?

21
 
 

Copyright is a tool of suppression by the bourgeoisie etc etc but as long as we have to deal with this tomfoolery, what licenses do you use or recommend, and why? I'm also open to the idea of custom or silly licenses if you can justify that they won't cause more trouble than they're worth.

I've heard the tale of a Rust DS emulator whose github repo was deleted, but because either there was no license or the license was something dumb, no one was able (or brave enough) to revive it, so i feel like it's important to take this more seriously than i have been. For the few things i have made i just put "copyright is fake" or "this isnt my code, it is OUR code, comrade!" in LICENSE.txt.

22
 
 

Great explanation about how CPUs actually work. Worth reading!

23
 
 

I don't really see any websites that allow you to practice webdev skills asides from JS. Maybe ask the user to make like a project or a simple website with the things they want implement and have them rank it and stuff?

24
 
 

I'm in the process of learning DOOM Emacs to move away from Codium, and the process prompted me to reflect on editors I've used in the past. There is one obscure editor I'm having flashbacks of: jGrasp. It was the editor I learned to code in because it's what my professor recommended. It is ugly and barebones as hell. Also, it's written in Java. I would never use an editor like it today, but I didn't know any better at the time.

25
 
 

I made an effort post in the genzedong general thread and I thought it would make a good standalone post. This is the context: https://lemmygrad.ml/comment/393476

That's likely part of it. I think part of it also has to do with what the U.S. materially controls. Having so much of the internet's infrastructure in burgerland along with insider access to the companies who own and run their services on that infrastructure allows for both easy surveillance and the ability to propagate propaganda on a scale that puts TV and radio to shame. The strategic importance of workers who do the labor to enable this, along with these workers requiring more training (both initially and continously) relative to others, puts an upward pressure on the wages. Another factor is that it is possible to make a software product where the only thing you need is software. What I mean by this is you don't have to go nuts on buying means of production and land in order to become a code kulak. There are exceptions to this of course (uber, amazon, etc.), and of course making good software isn't child's play even if it's not rocket surgery, but you can easily have a code kulak whose business is separated from material stuff enough that they'll end up with an even more skewed perspective of production than your vanilla petite boug. On top of all this: remember that infrastructure I mentioned earlier? If you're a code kulak looking to run your business, there's a good chance you'll use infrastructure owned by the big porkies in order to make money. With stuff like AWS, Azure, and Google cloud, all the code kulaks who want to use the convenient way of hosting their service is going to have their interests materially aligned with the big porkies. Sprinkle in the general state of education about history in the west being shit and liberalism (and consequentially, idealism) being the way most people are brought up to think about how the world works. You'll get programmers who are dilettantes in topics like philosophy and the natural sciences that try to use their technical knowledge as a way of understanding things that are outside of its intended scope. This ends up with a flavor of pseudery that is kind of ridiculous. You get things like James Damore, the singularity, and longtermism. Since the wages are high due to factors I listed above, you also get the effect of people who only give a shit about money seeing software development as a way to get rich. Combine all of the things I mentioned and you get an industry that selects for and produces some really bourgeoisified workers.

view more: next ›