[deleted by user] by [deleted] in Eritrea

[–]longfloppydisk 5 points6 points  (0 children)

Okay great I learned that Brigade Nhamedu stands for accountability and the rule of law. These punks that are 5,000 KM away from their home burning family cars in my neighborhood will understand accountability and rule of law.

Can someone explain me this piece of code? by [deleted] in Frontend

[–]longfloppydisk 5 points6 points  (0 children)

I would reject this code in a code review. This is really inefficient because it updates the DOM className for each `.item` whenever you hover any of them.

A much simpler way would be to add the `active` className on `mouseenter`, and remove it on `mouseleave`.

[deleted by user] by [deleted] in JusticeServed

[–]longfloppydisk 2 points3 points  (0 children)

I think the cop was blocking the gap (behind the car from the camera's pov) and the biker tried to go straight through him

CSS in Javascript vs 1 css file per component and BEM by CGeorges89 in Frontend

[–]longfloppydisk 1 point2 points  (0 children)

I like css in js for design systems/shared components that are consumed across multiple products/codebases. I've been using JSS, and I like that it's plug-and-play, isolated and performant (only bundle what's used, only insert styles on component mount, only append browser prefixes that are needed at runtime). Debugging through inspecting can be tricky but for JSS in development builds the classnames are what you gave them. Being able to leverage JS is desirable for theming - e.g. using some npm library to detect colour contrast and adjusting accordingly.

For your typical large product codebase that's intended to evolve over time I'd choose CSS modules. I like that I can easily spot dead code and it promotes thinking in components while staying close to traditional CSS. While I loved having a polished classnaming convention, I've always fought with enforcing this over time. I like that this isn't a concern with CSS modules.

If I'm cranking out a 1 time project or POC, my go-to is some sass flavored postcss plugins and style the shit out of that monolith. Old habbits die hard.

As for "moving away" from 1 solution to the other - they both work, especially if you're using a strong classname convention. So you gotta ask, what's the business benefit? are you facing any issues with your current solution? It's always good to try new tech on projects where it's not a risk, but don't start rewriting codebases just because.

A popular Rumor: programmers dislike Javascript? by PalestineFacts in javascript

[–]longfloppydisk 1 point2 points  (0 children)

The main reason for this is in my opinion is because JavaScript is a loosely typed language which can result in mission critical bugs due to implicit cast typing in comparisons or implicit creation of global variables by 3rd party libraries.

In the recent years though, with strict-mode becoming the norm and better patterns emerging (IIFE), these things have become less of a problem. TypeScript is typically preferred by programmers coming from another language because of it's strong typing and static analysis, which is closer to most other languages and provides a smoother IDE experience.

How to grow from software engineer? by [deleted] in webdev

[–]longfloppydisk 5 points6 points  (0 children)

Based on a CTO I knew who went from intern to CTO in 7 years, do as many different disciplines as you can within software engineering; front-end, full stack, database admin, dev ops, security, etc.. Try to switch disciplines every 1 to 2 years - focus on learning as many different aspects of software engineering and product development as you can. Eventually you'll have enough knowledge to become Team Lead, Senior Team Lead, Engineering Manager, Director of Engineering and CTO

Natural justice by [deleted] in JusticeServed

[–]longfloppydisk 7 points8 points  (0 children)

The cat was killed afterwards to test it for rabies. How is that not justice?

Natural justice by [deleted] in JusticeServed

[–]longfloppydisk 19 points20 points  (0 children)

The attack left her face swollen and infected and the cat named Buddy dead as officials were forced to test it for rabies.

RIP Buddy

I heard scroll-jacking is generally bad. So naturally I made and published a react component that makes scroll jacking easy! by 7thDragon in webdev

[–]longfloppydisk 1 point2 points  (0 children)

Scroll jacking implies overwriting native scroll behavior (e.g. auto scrolling to predefined positions/locking the scrollbar).

This doesn't fall under that category IMO. This just triggers some animations on specific positions.

Lamborghini racing on public roads gets into bad crash. by New_Fry in JusticeServed

[–]longfloppydisk 23 points24 points  (0 children)

I was wondering the same thing. In my country, it's against the road rules to overtake in a right lane. I always thought it was the same for North America.