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.

Pxtl ,
@Pxtl@lemmy.ca avatar

If you’ve seen the Barbie movie, there’s a scene where America Ferrera rants about the paradoxes in the expectations on women. The whole “be strong but not pushy” thing.

That’s CSS.

MargotRobbie ,
@MargotRobbie@lemmy.world avatar

Wait, I’m CSS?

I don’t get it.

TechCodecPawx OP ,

CSS is coloring and styling in programming, Ma’am… It fits to describe the Barbie movie because of its vibrant colors

JS is about logic and calculations… More like science in Oppenheimer

rikudou ,

Ah, so that’s not Peaky Blinders.

Scrappy ,

I’ll have you know that CSS is Turing complete

MargotRobbie ,
@MargotRobbie@lemmy.world avatar

But I’m not cascading though…

Not normally, anyways. 💖

EmperorHenry ,
@EmperorHenry@sh.itjust.works avatar

A lot of antivirus programs have trouble stopping malicious JS files too.

fragmentcity ,

How many people who post JS BAD memes could provide a single example of why it’s bad without looking it up?

thedeadwalking4242 ,

It was made in 10 days, its type system is a mess, its syntactic shit, and there are just better replacements out there that will never see the light of day due to how big its already gotten

DryTomatoes ,

Coming from other languages I find the async by default thing annoying but I fully understand it’s necessary for web sites to render in real time.

Blimp7990 ,

well if you consider its not finished yet, it was actually made in 27 years.

still not good tho

rikudou ,

Well, use typescript. There’s no excuse to use pure JS nowadays. It doesn’t solve everything, but it for sure solves 95%+ of JS issues.

Or use WebAssembly, I think it’s usable nowadays?

p1mrx ,
TechCodecPawx OP ,

WASM knows kung-fu

RagingNerdoholic ,

I use it regularly (web dev). A lot of complaints and mockery stems from using it badly. None of the programming languages that are regularly the butt of everyone’s jokes force you to use them badly, they just allow you to. If you follow good practices, you’ll be just fine.

wols ,

Many of the programming languages that are regularly the butt of everyone’s jokes don’t just allow you to use them badly, they make it easy to do so, sometimes easier than using them well.
This is not a good thing. A good language should

  • be well suited to the task at hand
  • be easy to use correctly
  • be hard to use incorrectly

The reality is that the average software developer barely knows best practices, much less how to apply them effectively.
This fact, combined with languages that make it easy to shoot yourself in the foot leads to lots of bad code in the wild.

Tangentially related rantWe should attack this problem from both directions: improve developers but also improve languages.
Sometimes that means replacing them with new languages that are designed on top of years of knowledge that we didn’t have when these old languages were being designed.
There seems to be a certain cynicism (especially from some more senior developers) about new languages.
I’ve heard stuff like: every other day a new programming language is invented, it’s all just a fad, they add nothing new, all the existing languages could already do all the things the new ones can, etc.
To me this misses the point. New languages have the advantage of years of knowledge accrued in the industry along with general technological advancements, allowing them to be safer, more ergonomic, and more efficient.
Sure, we can also improve existing languages (and should, and do) but often times for one reason or another (backwards compatibility, implementation effort, the wider technological ecosystem, dogma, politics, etc.) old quirks and deficiencies stay. Even for experienced developers who know how to use their language of choice well, there can be unnecessary cognitive burden caused by poor language design. The more your language helps you automatically avoid mistakes, the more you can focus on actually developing software. We should embrace new languages when they lead to more good code and less bad code.

CapeWearingAeroplane ,
  • be easy to use correctly
  • be hard to use incorrectly

C++ has entered the chat

rikudou ,

Which subset of C++ specifically? That thing’s ridiculously huge.

CookieJarObserver ,
@CookieJarObserver@sh.itjust.works avatar

Security concerns.

Blimp7990 ,

WAT?

also, humans are really bad at rote memorization and this is a bad metric for you to use, in life.

Ask people on the street why NOx is bad. What about an easy one like methane? Or how about asking someone whether driving your car for 30 miles or eating a hamburger is worse for the environment (yes, its obviously the hamburger). Etc, etc, etc.

rikudou ,

WAT

Reminded me of this: www.destroyallsoftware.com/talks/wat

Blimp7990 ,

that…uh…was the joke

TechCodecPawx OP ,

The meme was not about bad or good… It’s about Colors (CSS = Barbie), and Complexity (JS = Oppenheimer)

trimmerfrost ,

Quite a few

smileyhead ,

<span style="color:#323232;"><span>Please enable JavaScript to use this app</span>
</span><span style="color:#323232;">document.getElementById("noscript").style.display = 'none';document.getElementById("noscript-info-with-bold-text").style.fontWeight = 'bold';document.getElementById("status__content__text").textContent="JS ecosystem is all hack upon hack upon hack upon hack. We love hacks, but don't want to relay on them to access my bank or watch a movie. Just send me a webpage, not a soup of obfuscated, impossible to edit scripts that assemble god sake app. That's the reason we can't have new browser engines anymore, try to disable one wrong thing and whole app breaks. Browsers are made as interactive documents viewers, not disposable operating systems.";
</span>
orl0pl ,

<span style="color:#323232;">var bomb = []
</span><span style="color:#323232;">for(var i = 0; i === -1; i++){
</span><span style="color:#323232;">  bomb.push(i)
</span><span style="color:#323232;">}
</span>
TonyTonyChopper ,
@TonyTonyChopper@mander.xyz avatar

what does 3 equals signs do

axsyse ,

Identity. “A is literally B” instead of “A equals B”. This is necessary here in JS because if A is the string “-1” and B is the integer -1, JS evaluates A==B as true because reasons

ForbiddenRoot ,

because if A is the string “-1” and B is the integer -1, JS evaluates A==B as true because reasons

Interesting. If it were the other way around, I think I would have been fine with it (i.e. == used for comparison with type like any other language and === without type). But as it stands now I would hate it if I had to write in JS (but I don’t so it’s fine).

rikudou ,

It’s not that bad, honestly, just something you get used to. When I switch to C++ after a while, I sometimes write === and when I switch back to JS after some time, I occasionally forget to use ===.

In C++ it’s obviously an error and for JS I have my IDE set to warn me about ==. I think I’ve used == in JS (and PHP) intentionally once in the last ~5 years.

axsyse ,

Honestly, I think it actually makes some sense this way around. To me, in JS “==” is kinda “is like” while “===” is “is exactly”. Or, put another way, “equals” versus idk, “more-equals”. I mean, “===” is a much stronger check of equivalence than normal “==”, so I think it deserves to be the one with the extra “=”

adrian783 , (edited )

2 equal signs will coerce the second operand into the type of first operand then do a comparison of it can. so 1 == “1” is true. this leads to strange bugs.

3 equal signs do not do implicit type conversion, cuts down on weird bugs. 1===“1” is false.

edit: it appears to be more complicated than that for double equals and the position of operands don’t matter. developer.mozilla.org/en-US/docs/Web/…/Equality

TonyTonyChopper ,
@TonyTonyChopper@mander.xyz avatar

wow that seems super useful, thanks

rikudou ,

Doesn’t it widen the types regardless of position? Meaning 1 == “1” will be compared as strings, not numbers.

adrian783 ,

developer.mozilla.org/en-US/docs/Web/…/Equality

mdn goes into it more and it’s way more involved than I thought, looks like order of operand doesn’t matter. see the number to string section

rikudou ,

It seems it is that way, which is weird. You should always convert to the widest type, meaning string for comparing numbers and strings. I just checked that 1 == “01” is true, which means that “01” gets cast to an integer. And according to the document it might be that for example 1 == “a” would basically be interpreted as 1 === NaN which is false.

Poob ,

This makes absolutely no sense. Front ends that include JavaScript still use css.

KrankyKong ,

deleted_by_author

  • Loading...
  • Poob ,

    The only sites I can think of that don’t look like they use css are motherfuckingwebsite.com and bjarne stroustrup’s website.

    Any site that uses JS for more than trivial things is going to be a disaster without styling of some kind.

    darcy ,
    @darcy@sh.itjust.works avatar

    no frills? javascript is frills

    avidamoeba ,
    @avidamoeba@lemmy.ca avatar

    Maybe, but they don’t need to. You could write an HTML styling engine in JS if you wanted to.

    scottywh ,

    sometimes

    Personally I hate CSS and the last several websites I created had plenty of JS.

    GreenMario ,
    lud ,

    Now it’s: I AM THE FLEXBOX!

    adrian783 ,

    bro we’re on css grid now

    rikudou ,

    Around flexbox is when I stopped caring about CSS, so it’s the last one I know. Is the grid better?

    adrian783 ,

    for some stuff absolutely, styling frameworks like bootstrap and others kludged together the concept of grid based designs. css grid just makes it official and more flexible.

    thanks_shakey_snake ,

    They’re both tremendously useful and have significant overlap in use cases. Grid isn’t going to replace Flexbox, it just has some capabilities that aren’t part of the Flexbox concept.

    argv_minus_one ,

    Problem: Oppenheimer, unlike JavaScript, was actually competent.

    corytheboyd ,
    @corytheboyd@kbin.social avatar

    Would be funnier if it was just “JS” on the right, because obviously HTML and CSS are involved too, but JS is where all hell breaks loose

    WtfEvenIsExistence ,

    Is this some highly sophisticated programmer humor that I’m too tech-illiterate to understand?

    judgeholden ,

    JS bad, please clap

    scottmeme ,

    👏

    starman ,
    @starman@programming.dev avatar

    👏👏

    HumanPerson ,

    👏👏👏

    lemann ,

    👏👏👏👏

    vicfic ,
    @vicfic@iusearchlinux.fyi avatar

    👏👏👏👏👏

    KIM_JONG_JUICEBOX ,
    @KIM_JONG_JUICEBOX@lemmy.ml avatar

    Little diddy bout Jack and Diane

    SnowdenHeroOfOurTime ,

    ITs NoT StRoNgLy TyPeD aNd Is ThErEfOrE gArBaGe

    starman ,
    @starman@programming.dev avatar

    Give me one advantage of language that isn’t strongly typed

    SnowdenHeroOfOurTime ,

    It’s not a debate I care to have, I just think it’s funny that people want to build websites but hate how websites are built.

    kogasa ,
    @kogasa@programming.dev avatar

    Fluent polymorphism via duck typing. It’s useful when you’re treating objects as a collection of properties, and therefore it’s not their type that matters but which properties they have. Types can still be used to label common collections of properties but it’s less painful to talk about objects that are “like an X but with/without certain properties,” or where some properties themselves have a different shape, etc. This is applicable to web APIs, not just because of JSON, but because it allows to define both very rigid and very flexible schemas without much overhead or repetition. See the OpenAPI specification.

    Durotar ,
    @Durotar@lemmy.ml avatar

    The real question is since when CSS is good?

    exscape ,

    CSS is used to create the design, basically the look (colors, layout and so on), but no substance.
    JavaScript is used to implement code and logic.

    HTML + JavaScript would typically (since you're supposed to use CSS to create colors and design) look very dull, thus the black-and-white Oppenheimer.

    rikudou ,

    document.querySelector(‘.whatever’).style.color = “red”;

    Don’t recommend, though.

    exscape ,

    Sure, but setting the .style attribute could really be argued as using CSS, just with a different interface. W3Schools refers to this as "inline CSS".

    blotz ,
    @blotz@lemmy.world avatar

    What

    nalyd ,

    I’m not sure either, fork bombs are a thing you could probably do in JavaScript, but I don’t know of a thing called an Atomic Bomb in programming? I think if you put lots of atomic operations you’ve just reinvented single threaded programming but with more overhead

    avidamoeba ,
    @avidamoeba@lemmy.ca avatar

    JS is Touring complete. You can write anything in it, including SkyNet or whatever else you can think of that will destroy the world.

    rikudou ,

    I want my world destroyed fast, thank you very much. Do you want them to stop mid-murder to prolong your pain because they’ve ran out of RAM?

    Say no to JS Skynet, embrace C++ Skynet!

    avidamoeba ,
    @avidamoeba@lemmy.ca avatar

    I don’t disagree.

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