brian

joined 2 years ago
[–] brian@programming.dev 3 points 2 days ago (1 children)

I'm saying we weren't taught when react was the way people wrote sites. if I was writing a site with pure html, css is great, especially modern css.

but if I'm already using react and their abstractions, opinions on that part aside, I'd personally rather lean on the react component as the unit of reuse. tailwind removes the abstraction that you don't need, since many people in react tend towards one scoped css file per component with classes for each element anyway

at this point I'd be more inclined to say for many sites the api and data fetching things are the content and html+css is presentation. csszengarden is cool but I haven't seen the html/css split help an end user, or really even me as a developer.

[–] brian@programming.dev 1 points 2 days ago

instead of using classes you just use whatever your ui library provides for reuse. stick a classname string in a variable and you have a class. use a component and it just contains all its styles.

unless you mean that if you look in the inspector you see a mess of classnames. I don't have a solution there

[–] brian@programming.dev 2 points 2 days ago (1 children)

shadcn is the primary one for react at least. they've done a great job filling the space where you're trying to build up a design system but don't want to start from scratch, but they're great if you just want prebuilt components too

all the components build on something else like radix, and are pretty simple themselves. normally just the radix component with styles. Installing a component just copypastes the source into your project at configured locations.

if you've ever fought against something like mui to get it to fit design changes or change specific behavior, shadcn is great. at some point the extension points of a library aren't enough, but if you own all the code that'll never be a problem.

[–] brian@programming.dev 4 points 2 days ago (7 children)

except we generally use higher level abstractions now, like component based frameworks. If you're writing raw html with tailwind and no library you're doing it wrong and css is a better fit.

well written straight css ends up building it's own tree of components. if you're using react too you're either only selecting a single component (inline styles but have to open two files) or writing good css (duplicating the component hierarchy in css).

tailwind is just the former but better since it encourages using a projectwide set of specific sizes/colors/breakpoints and small scope, the two actual problems with inline styles after organization and resuse, which react etc solves.

[–] brian@programming.dev 7 points 2 weeks ago

not at all related to the content of the messages like the title implies, just that they kept sending the messages to people that had told them to stop.

[–] brian@programming.dev 1 points 2 weeks ago

probably about the same as like vapor smoothing abs with acetone. I think pla has solvents that work too but they're much nastier

[–] brian@programming.dev 4 points 3 weeks ago

I'm sure all of them are just cherrypicked hotfixes from main tho

[–] brian@programming.dev 5 points 4 weeks ago (1 children)

repr is generally assumed to be side effect free and cheap to run, so things like debuggers tend to show repr of things in scope, including possibly exit

also then it behaves differently between repl and script, since repr never gets run. to do it properly it has to be a new repl keyword I imagine, but I still don't know if I'm sold on the idea

[–] brian@programming.dev 4 points 1 month ago

yeah fair enough. that wasn't really my point and I wasn't paying attention

[–] brian@programming.dev 2 points 1 month ago* (last edited 1 month ago) (2 children)

~~yeah it's incorrect bc it destroys multibyte characters, but~~ no idea what you're saying about u8 being a different type from unicode. the original code was reading bytes and converting them too? the typing isn't the issue, you can still store utf8 as a series of bytes

[–] brian@programming.dev 3 points 1 month ago

I mean, I'm not a big fan of bash, the most likely default shell, so my advice would be to explore some alternate shells.

I am a little surprised completions aren't working in bash by default, but yeah idk if it's possible to get the cycling through suggestions. double tap tab and it should at least list the options though.

I'd recommend you hop between some shells and see what you like. most distros tend to keep the default shell pretty vanilla, the most change you'll get is maybe zsh with some nicer defauls.

nushell is great and would be my first recommendation. everything is structured like powershell, but way less verbose and more emphasis on integrating the existing cli ecosystem than pwsh's commandlets for everything.

fish or oh-my-zsh are things other people recommend. you don't get structured data but they do give a better completion experience and other nice things

I want to like xonsh, and used it for a few years, but it has the same problems pwsh has with separate ecosystems of structured commands and unstructured text. if you're a python person though I'd consider it too though.

[–] brian@programming.dev 4 points 1 month ago

python isn't the only language to do "execute everything imported from a particular file and all top level statements get run". both node and c# (but with restrictions on where top level statements can be) can do that type of thing, I'm sure there's more.

python conventions are unique because they attempt to make their entrypoint also importable itself without side effects. almost no one needs to do that, and I imagine the convention leaked out from the few people that did since it doesn't hurt either.

for instance in node this is the equivalent, even though I've never seen someone try before:

if (path.resolve(url.fileURLToPath(import.meta.url)).includes(path.resolve(process.argv[1])))
{
  // main things
}
view more: next ›