There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

HellAwaits , in How the IT guys see the users

It’s so true, it hurts my insides.

Theharpyeagle , in Which side are you? Javascript or Typescript

Honestly, as a mainly backend dev wanting to do more full stack, webdev is frustratingly intimidating. I keep trying to look up best practices but there’s so little in the way of consensus. “Use JQuery, no use Vue! React is better, but also React is clunky and bad. Write pure js, no don’t that’s a waste of time, at least use typescript.” It’s all such a mess and I spend so long trying to figure out what to use. I’m trying to just pick something and stick with it, but I keep worrying that I’m not doing things the best way.

AVengefulAxolotl ,

If you just want to try frontend, not trying to get a job there are these frameworks you should try:

  • Solidjs (love it so far) for a web application so SPA with separate backends
  • htmx to have a decently interactive website, it can be integrated with any webserver
  • astro for generating static sites

And i think everyone should use either Typescript or JSDoc for any bigger application.

beeb ,

Svelte is a happy middle ground between vue/react and SolidJS which is maybe too bleeding edge still

AVengefulAxolotl ,

Agreed on the svelte part.

But I think solidjs has a real chance of taking over React, because its similar, meaning JSX and hooks, but without the footguns. After using React, its so much cleaner and easier to work with, i cannot recommend it enough.

dubbel ,

Thanks for recommending it, it does look really nice. I’ll definitely check it out when a fitting project comes along.

9point6 ,

I’d agree with you if you were saying this about 8 years ago, but IMO the post-jQuery-front-end dust has settled and the “best” (in terms of what most organisations end up choosing) hasn’t really changed in a while.

  • Typescript unless you’ve got a really good reason not to.
  • React if you have anything remotely complex.
  • Webpack (or one of the wrappers) to bundle it up.

Sure, someone may like a React alternative, and that’s completely fine. But at the end of the day, most companies are using React because it’s basically industry standard at this point, and it’s got too much momentum behind it for that to change any time soon.

I’d say the back end is where all the choice is these days

zebbedi ,

Webpack… Aren’t you on the vite train?

railsdev ,

Ha! Webpack. I ripped that shit out as soon as import maps were added to Rails; I cut my Docker image size by 50% and kissed Node goodbye.

Strawberry ,

We must be in different organization circles because almost every frontend I’ve seen at my jobs or those of my friends at other organizations uses Angular

Phen ,

I’ll be honest, I think it’s been years since I last saw anyone even mention Angular anywhere.

fidodo ,

Maybe I’m just too used to it, but with next.js static site generation I find react to also work really well for simple sites too. If you’re not dealing with state, react is basically just functions that return templated html. IMO it’s pretty sleek for static websites since tsx let’s you do basic templating with functions.

executivechimp ,
@executivechimp@discuss.tchncs.de avatar

Don’t worry, none of us are doing things the best way.

MyNameIsIgglePiggle ,

Lol yeah. Op needs to realise we are just throwing shit at the wall and waiting for the next new tool we have to learn this week

aubertlone ,

For sure don’t use jquery.

React is industry standard, but not my favorite. That being said, even my personal projects I do in react. I’m happy with my current role, but if I wanna switch down the line there’s less openings for a dev with mostly Svelte (my favorite framework) experience.

Theharpyeagle ,

Right now I’m working on a personal project with Vue because it happened to be the one I was hearing most about when I started. I’ve got one project that I’m definitely gonna finish at some point started in react, so maybe I’ll try out svelte on my next project.

h_a_r_u_k_i ,
@h_a_r_u_k_i@programming.dev avatar

Wait until you meet “Platform Engineering”/DevOps. The sheer amount of CNCF projects and new tools out on a daily basis are on par with the JavaScript world.

Strawberry ,

jQuery is obsolete and insufficient if you’re looking for an easy monolithic framework. Angular, React and Vue are all good (disclosure, I haven’t used react), just pick one and learn it well and you’ll have a good foot in the door. If you already know JavaScript and don’t want to learn typescript, Vue can be used with plain JavaScript.

o_d ,
@o_d@lemmygrad.ml avatar

I’ve used all 3 although, not very much Angular so I don’t have much to say on it. Vue is the easiest to learn imo. It bundles in routing and state management so you don’t have to worry about picking supporting libraries for this. It’s a pretty standard template style with lots of helpers and some magic going on behind the scenes. React is better if you want to write JavaScript. I prefer it for this reason.

fidodo ,

Curious if you’ve used next with react. React itself has a scope rendering design goal and leaves the rest of the app to the community, and next sets up all the stuff around it for you and I think they did a really great job with the defaults they close, and it’s still fully extendable.

o_d ,
@o_d@lemmygrad.ml avatar

Yup! Next is the most mature and complete framework for React. If I need SSR and/or SSG with hydration, it’s my go to for now. It adds some complexity, so it can be overkill if you don’t need these things. My experience working with it has been excellent.

fidodo ,

It can be overkill if you need something simple that doesn’t match next’s defaults, but if the default settings of next work for your use case I found the base project setup very simple to use.

curiousaur ,

React and typescript. If anyone tells you otherwise, ask them where they work.

icesentry ,

The main issue is that frontend is complicated and it can do a lot of very different things. Frameworks exist to solve some issues that may or may not exist in your project.

Kuresov ,

As a previously front-end gone full-stack gone and settled in backend/infra… don’t bother. But if you have to bother, or really, really want to 🙂, pick a relatively popular thing (e.g. Vue), and learn that, ignore the rest. By the time you come up for air the new hotness will have changed anyways, and the wheel will have been reinvented twice. It’s a moving target, just learn the fundamentals with something and you’ll be good to go.

SnowdenHeroOfOurTime ,

Where’d you get your time machine, that you obviously would’ve needed to set to 2008 to find anyone actual recommending jQuery?

severien ,

It’s still the best API for imperative access to DOM.

SnowdenHeroOfOurTime ,

Do you need to support 15 year old browsers? Practically all the jQuery features I used (which was a lot) are now available in standard js

severien ,

Yes, the features are there. Just the API is still horrible.

As an example, make a hidden element visible (extremely common imperative operation).

jQuery:


<span style="color:#323232;">$(</span><span style="color:#183691;">"#element"</span><span style="color:#323232;">).show();
</span>

Native JavaScript:


<span style="color:#0086b3;">document</span><span style="color:#323232;">.</span><span style="color:#0086b3;">getElementById</span><span style="color:#323232;">(</span><span style="color:#183691;">"element"</span><span style="color:#323232;">).style.display </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">''</span><span style="color:#323232;">;
</span>

I hope you’d agree that the native JS is certainly not an example of good API.

SnowdenHeroOfOurTime ,

That’s actually a great example of the shortcomings of jQuery. There are multiple ways to hide an element yet they standardized on one that often wouldn’t work.

Also you’re using an ancient method getElementById… I think visuals should still be controlled with css. So what is the right way to do that in modern js? document.querySelector(‘.some-name’).classList.add(‘hidden’) with that class defined in the css, with whatever makes sense, including maybe a css transition.

severien ,

There are multiple ways to hide an element yet they standardized on one that often wouldn’t work.

It’s the most common one. And it’s not like you can’t hide the element with some other mechanism with jQuery.

Also you’re using an ancient method getElementById…

And? What’s the difference from document.querySelector() when querying for ID?

So what is the right way to do that in modern js?

What is the right way is context dependent. I don’t see how having extra .hidden { display: none; } boilerplate is somehow modern or superior.

SnowdenHeroOfOurTime ,

What’s the difference

Your code reads like it’s from 1992 mainly, which makes sense I guess, given that you still find jQuery better than modern vanilla js. jQuery was created as a way to account for browser support challenges but is now obsolete. Anyhow, if I read “getElementById” in recent js code I would assume something was weird about that code. It’s old hat and there is rarely a reason to use it.

What is the right way is context dependent

Precisely my point. Which is why I think it’s opinionated in a bad way to arbitrarily pick one of them as the defacto. I often had trouble with jQuery’s .hide() method because while it felt natural to use it, it often conflicted with what actually needed to happen for good UX.

What you’re missing is that the hidden class can contain anything you want. Animations or whatever else. In other words, the idea that there is a “right” or “most common” way to hide an element is flawed at its core.

severien ,

Your code reads like it’s from 1992 mainly

Lol. You write a lot of text to mask the fact there’s no good reason why getElementById should be bad. It’s the same groupthink as with the jQuery, you’re told it’s bad, so you just follow the crowd.

jQuery was created as a way to account for browser support challenges

That was one of the reasons. The other was that DOM API was and still is crap. There were many such libraries to abstract away browser differences back in late 00s (Dojo, script.aculo.us, Prototype.js, MooTools), and the main reason jQuery “won” was that it provided the nicest API.

Which is why I think it’s opinionated in a bad way to arbitrarily pick one of them as the defacto.

You’re missing the fact that jQuery does not prevent you from hiding the element in other ways. It’s just optimizing for the most common case, which is one of the principles of good API.

What you’re missing is that the hidden class can contain anything you want. Animations or whatever else.

Sure, and when I just want to … hide it, without any animations? Then this hidden class is boilerplate only.

SnowdenHeroOfOurTime ,

I mean you’re coming across like more of an old man than I am and that’s saying a lot more than you know. For the first 2 years people shit talked jQuery I didn’t agree with them. And then I got the opportunity to work without it and it seriously took like 3 days to completely change my mind. And all my pages were I believe about 100KB lighter.

jQuery is trash. And that doesn’t mean it wasn’t a great tool for its time. It’s truly obsolete now though. If you hate the native JavaScript stuff so much… I dunno maybe go work with Java or something?

severien ,

Just fluff, no real arguments, ok.

SnowdenHeroOfOurTime ,

I sure am glad I don’t work with a moron like you who would ship a fuckton of JavaScript to users because they’re too much of a pussy/old fuck to use modern practices

severien ,

Lol, so angry :-D jQuery hating must be a real passion for ya.

SnowdenHeroOfOurTime ,

we know that being a pain in the ass is your passion – your coworkers definitely have noticed

severien ,

So far they didn’t complain. My manager is all praise too ;-) It’s kinda weird that I’m supposed to be the asshole for not being hateful of a technology. But you the hater are the nice guy?

The things is, I don’t diss on technologies without arguments. I’ve grown to recognize that they are tools, not a subject of passion, at least in a professional context.

fidodo ,

Why would you not want to be using a rendering library? Your code is basically storing your application state in the dom which will turn into a horrible mess as soon as you reach any actual level of complexity. I know first hand. I’m traumatized from having to maintain large jquery code bases in the 00s. No serious professional writes code like this anymore.

Also, your vanilla code isn’t modern. It should look more like this:


<span style="color:#323232;">document.querySelector("#element").classList.toggle("hidden")
</span>

I could see not wanting to use a rendering library if you’re building a simple site on top of basic static HTML, but that’s not a serious discussion for industry professionals, and even still, jQuery is such a heavy dependency for saving some characters. If you find yourself using it so much you need the extra convenience then your site is already complicated enough that you should be using a rendering library with state management instead.

severien ,

Why would you not want to be using a rendering library?

Because it’s just not very useful in some contexts. I’ve seen web extensions which mostly query the current page, and it doesn’t render much or even anything.

Not all pages are SPAs either. Many apps are the old request-response with some dynamic behavior sprinkled on top. jQuery covers that well.

This model is also quite compatible with the rising HTMX where the state/rendering is driven from backend and you just insert few dynamic pieces with JS.

document.querySelector(“”).classList.toggle(“hidden”)

There’s no difference between document.querySelector(“#element”) and document.getElementById(“element”), they’re both same level clunky.

Also, what you wrote is not functionally identical. $el.show() is idempotent, the el.toggle(“hidden”) is not (as the name suggests, it toggles a class). It also needs an extra boilerplate class.

I could see not wanting to use a rendering library if you’re building a simple site on top of basic static HTML, but that’s not a serious discussion for industry professionals

There are plenty of non-professionals doing web stuff and I think it’s great!

jQuery is such a heavy dependency for saving some characters

jQuery is 24 KiBs (minified, gzipped), that’s a good price for the egonomics it provides. If you’re constrained, there are API-compatible alternatives like cash which go down to 6KiBs.

fidodo ,

Even if you do, you can still use most modern js features with transpilation.

fidodo ,

Best practices are pretty straight forward in the typescript community. Frankly I think all the serious professionals from the JavaScript community just went to TS so the people left over that didn’t migrate are well…

kamen , in Every Single Freaking Time

I’ve almost gotten into the habit of hitting Ctrl+Shift+C when I want to copy something because of that.

vpklotar ,

I do that all the time. Opens up developer tools on firefox if you do it.

fernandu00 ,

I open developer tools every day doing that!

rinze ,
@rinze@infosec.pub avatar

Yes. And on Microsoft Teams that triggers a chat call.

scottywh ,

😂

KyuubiNoKitsune ,

Burn it with fire!

phoenixz ,

That solution ish the worst. Ctrl-shift-c does a shitload of different things in different programs, and in browsers it does different things per page.

Ctrl-ins, shift-ins, shift-del for the win bit THEN some programs simply refuse to support that.

I have like 4 different copy paste short cuts because of this and it sucks

kamen ,

I’m not saying it’s great, but at least in my use I haven’t seen it being destructive/disruptive like Ctrl+C is.

phoenixz ,

Ctrl-c for copying is a windows thing and it’s annoying.

millie ,

Do you at least have 4 clipboards to go with them? Because I don’t think I could ever go back to a single clipboard.

phoenixz ,

I use standard Linux dual clipboard (Ctrl ins and just select, middle click) but most extra clipboards I’ve seen require a lot of extra clicking to get the work done. I want something simple stupid fast.

millie ,

I’m running windows for my daily, but I’ve got Ditto and it works great. I have like 3 clipboards set up, could set up more. It just needs a different hotkey combination. It’s really simple.

21Cabbage , in How the IT guys see the users

I’m by no means a programmer, but the frequency in which “RTFM” makes me the problem solver in a group allows me to relate to whoever made this.

jayrhacker , in How the IT guys see the users
@jayrhacker@kbin.social avatar

Heh, now do Software Engineers and IT guys…

Raze157 ,

Then do IT security guys vs everybody.

Appoxo ,
@Appoxo@lemmy.dbzer0.com avatar

Just today I tried to understand the backup principle behind Veeam with my senior.
After that I (soft) bricked my head trying to visualize the GFS principle.
Lol that was fun.

But then I remembered someone imagined the whole backup cycle and not only invent it but the dev team needed have so much knowledge to not only adapt it into software but that it’s considered beyond business critical software.
In Germany we have the saying “Kein Backup, kein Mitleid” (No backup, no pity) and we literally just hope the software does as it’s told to do.
Even if we test backups it’s crazy how we rely on it.

TheSealStartedIt ,

Then do software engineers with mathematicians. (I’m a software engineer, I admire mathematicians)

cobra89 ,
FartsWithAnAccent , in It's a mass extinction event
@FartsWithAnAccent@lemmy.world avatar

Doubt it

CanadaPlus , in How the IT guys see the users

I like the literal dinosaur in the second panel.

Ew0 ,

Probably studying for a PhD.

Pfnic , in It's a mass extinction event

Because ASP.NET isn’t a thing at all…

AlexWIWA , in Single?

Just wait for them to buy programming socks

a_statistician ,
@a_statistician@programming.dev avatar

What’s wrong with programming socks?

AlexWIWA ,

Nothing, he’ll just finally have women to date in his CS classes.

cupcakezealot , in Only 14.99$
@cupcakezealot@lemmy.blahaj.zone avatar

I’ll wait for Linux Millennium Edition to come out first

snor10 ,

I heard it is buggy, I think I’ll wait for Linux Vista to be released.

loudWaterEnjoyer , in Markdown everywhere
@loudWaterEnjoyer@lemmy.dbzer0.com avatar

Where is that footage from?

Thade780 ,

Parks and Recreation. Season 2, episode 5.

30mag ,

Parks and rec

Father_Redbeard ,
@Father_Redbeard@lemmy.ml avatar

Parks & Recreation

Father_Redbeard ,
@Father_Redbeard@lemmy.ml avatar

ah beans, I’m late as shit replying…

Kyoyeou , in My poor RAM...

Recently downloaded the KFC app. Strangely the app needs to ask me if I accept cookies, hmmmmmmmmmm

xusontha OP ,

I thought KFC sold chicken 🤔

fu ,

@xusontha @Kyoyeou their cake is pretty good too, I'd try some cookies.

makingStuffForFun , in It's a mass extinction event
@makingStuffForFun@lemmy.ml avatar

Ok. What am I in the dark about this time?

turbodrooler ,

Guessing it’s about Unity changing their royalty structure.

makingStuffForFun ,
@makingStuffForFun@lemmy.ml avatar

Surely other engines use it? I know godot supports it. Not to mention half the business software of the world (pre cloud) seemingly built with it. etc

lobut ,

It’s a joke built in hyperbole for sure. A lot of my friends are C# devs they’re not going anywhere.

turbodrooler ,

Unreal, Unity’s primary competitor, doesn’t. Mainstream gamers seem to only know about the two. Anyway, it’s a meme. I use C# for exclusively boring corporate stuff, and will continue.

elbarto777 ,

Oooh, I bet they will! They’re probably salivating about it.

squiblet ,
@squiblet@kbin.social avatar

A whole lot more than game engines uses C#.

mnemonicmonkeys ,

Doesn’t Excel mainly use C#?

amio ,

I doubt they went away from VBA. While I do use C# any time I can, I can't say the same thing for Excel. I do know there are ways to do interop, and it's not great. Office file formats and interop have always been... awful.

Lmaydev ,

They actually recently added python support.

marcos ,

You can access the Excel scripting engine from C#, but this is more of a case of C# supporting Excel than the other way around. (And you will really not want to do it if you just have to read and save data in excel files.)

Excel mainly uses VBA.

Serinus ,

Which is kind of weird because most C# devs aren’t doing games.

r00ty Admin ,
r00ty avatar

Yeah. Maybe c# game developers will drop. But they're actually a drop in the ocean.

mwguy , in Markdown everywhere

They’ll find us soon

Thanos with Restructured Text and Sphinx

Travesty ,

You mean thanos.io?

mwguy ,

than.os

angelsomething , in How the IT guys see the users

If I had a penny for every time, I was told I’m a genius for helping someone with something easy, I’d probably about a fiver.

painfulasterisk ,

Nah, you didn’t give us admin privileges. You just forced them to call you that way.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines