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.

rothaine , in Sometimes there is a better choice than Javascript

“Sometimes there is a better choice than JavaScript”

We call it TypeScript

bjornp_ ,

I heard they’re looking to add typing to JavaScript in a very similar style as TypeScript. Basically running TypeScript in the browser without tsc.

There’s at least a proposal which I hope they’ll continue with.

Legendsofanus , in python < shell (for scripts)
@Legendsofanus@lemmy.world avatar

I know a bit of HTML so I just started learning Python. It’s fairly easy and fun, haven’t made anything real yet tho

Feyter , in Sometimes there is a better choice than Javascript

I thought that’s what GIF was created for… Even if the original introduction of it is saying something completely different.

Sphks , in Title got catched by input sanitization
@Sphks@lemmy.dbzer0.com avatar
yum13241 ,

They’re seem non-existent, but they can make you pull your hair out.

drcouzelis ,
@drcouzelis@lemmy.zip avatar

There’s a potential explanation here.

feddit.de/post/2242238

steven , in Title got catched by input sanitization

steven ,

My comment above is U+3164

ImpossibleRubiksCube ,

Your comment above is NOTHING

TheBananaKing , in python < shell (for scripts)

Friends don’t let friends do string manipulation in bash.

princess ,

youre right

thats what sed is for

entropicdrift ,
@entropicdrift@lemmy.sdf.org avatar

Well this is awk-ward

andarwaid ,

That’s what she sed

TechieDamien ,

I think we some ed-ucation here

Sigmatics , in Title got catched by input sanitization

caught

vox , in Sometimes there is a better choice than Javascript
@vox@sopuli.xyz avatar

css can do animations, and it’s much more performant then js. I hate how over-used JavaScript is on “modern” websites.
some websites are even straight up unusable or don’t display anything with js disabled…

dukk ,

Some websites, JavaScript is necessary for doing things without overloading a server. Mostly SPAs/PWAs and such. I’m using Voyager for Lemmy right now, which needs JS, but it gives me a great experience.

But yeah, JS is often overused. Luckily, with new technologies coming out like Astro and HTMX, we should hopefully start seeing less JavaScript on pages that don’t need it.

vox ,
@vox@sopuli.xyz avatar

htmx just generates js too

dukk ,

However, it uses a lot less JS. It’s only a few lines of JS to replace an HTML element, but a lot more to parse a bunch of JSON and then alter the HTML to reflect that.

MonkderZweite ,

Still wayting for a native solution to AJAX.

No, not Java beans.

darcy , in python < shell (for scripts)
@darcy@sh.itjust.works avatar

thoughts on lua ?

alexcoder04 OP ,
@alexcoder04@programming.dev avatar

Lua is weird, but I would rank it same as Python

Chunk ,

Lua is not as common as python. Every team I’ve worked on knew X and python. C++, Java, JS, or node, and then also python.

SingularEye ,

lua is hot and sexy

grue ,

If I have to install it myself instead of being able to assume it’s on the system by default, that’s a Problem.

darcy ,
@darcy@sh.itjust.works avatar

… minimastic iso users: 😐

also i think it comes with neovim

Reptorian , in python < shell (for scripts)

I’m using G’MIC for raster-graphic image-processing, but I can do other things in it too with ease. I feel this post so much.

ICastFist , in Sometimes there is a better choice than Javascript
@ICastFist@programming.dev avatar

Wrong, annoying animations was Flash’s thing. Javascript was made for annoying popups and alert boxes

float ,

Also for these animated status line texts that were supposed to show what’s being loaded currently.

dukk , in Sometimes there is a better choice than Javascript
MonkderZweite ,

Huh, page displays nothing without js.

hellishharlot ,

Just typescript at that point

asyncrosaurus , in Sometimes there is a better choice than Javascript

I was there for the first wave of SPAs, I even learned angularJs and Knockout. It did feel like a major atep forward, being able to make highly interactive applications. However, things quickly went off the rails when the tools stopped being about managing heavy client state, and became the default for everything, even when it ment using JavaScript to build extremely basic functionally browsers did natively with html, but extremely worse(e.g. navigation). The modern Web really is a victim of hype and trends.

Unless your app needs to work offline, or you have to manage dozens of constantly changing client side data points concurrently, your site doesn’t need to be a big heavy js framework. My rule is if it looks like Google Maps, you need a SPA. if it looks like Gmail you need REST/HATEOS. and if it looks like google’s mainpage, you need a server side rendering.

At some point you might see the light, and go back to making your websites simpler, but Im not hopeful. Until then I’m building the majority of things with HTMX and alpineJs.

fidodo ,

I make fully static sites using react

AgentEnder ,

Yeah, I’ve personally been using react and vite-plugin-ssr to static render things and while there’s been a few bumps it still feels pretty nice

pulaskiwasright , in python < shell (for scripts)

Things that could have been done in bash is python’s best usecase. And bash sucks for scripting. Why not python?

dukk ,

Not really true. Python was created for, and is still best used for data science. It’s user-friendliness made it a first for many inexperienced programmers too, and it started to be used for way more than it was initially intended. I’m not saying it’s bad at everything else, but there’s most certainly better tools for the job.

pulaskiwasright ,

I won’t argue with what it was created for, but I disagree that it’s best usecase isn’t as a bash replacement. That’s the only spot I’ve used and liked it.

princess ,

have you ever tried to recreate a simple shell pipeline in Python

pulaskiwasright ,

If we’re talking about 5 like script, then sure. Just use bash. But python is much better long term, in my experience, for scripts any bigger than that.

entropicdrift , (edited )
@entropicdrift@lemmy.sdf.org avatar

There are many cases where bash/shell is better than Python. For one, any time you’re just stringing together 2-4 existing shell tools, bash has unbeatable speed since it’s all running in C. Plus, you should probably learn the tools anyways to handle CLI stuff on a day-to-day level, so the knowledge is reusable and becomes very intuitive to compose into some crazy one-liner piped chains of commands. If I just want to loop over a set of directories and do a couple chained CLI commands on each directory, this is the way I go.

That said, in cases where you’re doing something very custom, any time you’re doing something that can’t be simply described as a chain of CLI tool transformations, and any time you want to maintain a global state across a complex set of operations outside of a pipeline, I agree that Python is generally a more robust solution with much easier maintainability.

jim_stark ,

compose into some crazy one-liner piped chains of commands

Why not something that is completely redesigned from the ground up:

avonarret1 ,

That looks really elegant. I think I’m gonna give it a try. Thanks a lot for the recommendation!

mathemachristian ,

Xonsh

Ddhuud , (edited ) in Sometimes there is a better choice than Javascript

only original

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