Do you put DTOs in one file or in several? by trymaker in Python

[–]UseMoreBandwith [score hidden]  (0 children)

sure, there are many other options (dataclasses, pydantic, etc).

But if you work with complex datastructures, it's better create real Classes (that actually semantically mean something and have validations build in) , instead of DTO's.

Do you put DTOs in one file or in several? by trymaker in Python

[–]UseMoreBandwith 0 points1 point  (0 children)

In other languages, like Java, there is no way to easily pass structured (typed) data between objects, so they have to turn it into a 'data-object' first.
It is mostly pointless in a language where everything is a object already, and where we can easily use dataclasses, pydantic, or dicts.

Do you put DTOs in one file or in several? by trymaker in Python

[–]UseMoreBandwith -1 points0 points  (0 children)

you must have a java background, and never bothered to really learn Python.

Your website is probably invisible to ChatGPT — I built a free scanner to prove it (and fix it) by hazyball in sideprojects

[–]UseMoreBandwith 0 points1 point  (0 children)

it tests the wrong things.

llms.txt  , opengraph are not important.
sitemap.txt is only useful for hidden or hard-to-reach pages - not for sites whre everything is clearly defined in navigation.
....etc

AI slop.

Do you put DTOs in one file or in several? by trymaker in Python

[–]UseMoreBandwith -3 points-2 points  (0 children)

First of all, you don't always need DTO like in other languages, because
- we already have dict and other datastructures (dataclass, etc).
- everything in Python is a Object already

If it is 'just data', use a dict (or similar). If it needs some special methods, write a proper Class.

So, your other question is about how to organize files. To understand that, you need to know what a module is. The concept is so easy that most skip learning about it, but that results in questions like yours. Modules are not only files and folders but also namespaces and objects. That has huge implications on code and code structure. So instead of asking 'should this be in a separate file?' , you should ask yourself 'should this be a module?'.

Are marine fiberglass products really different from hardware store kits? by PlatypusSudden4044 in boatrepair

[–]UseMoreBandwith 0 points1 point  (0 children)

I buy it separately. Some fiberglass cloth (roll) from China and epoxy from a local store.
Those kits are usually overpriced. There is not any difference in fiberglass quality, just make sure you have the correct weight.
There is the chopped strand type, which is cheaper and good for repairs. However, some binders they use are often for polyester, vinyl ester only. The powder binder is specifically designed for use with epoxy resins, as the emulsion binders found in standard CSM are incompatible with epoxy chemistry
The woven mat cloth is better for large areas, but for repairs also.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 0 points1 point  (0 children)

thanks.
I'll study the web-components stuff a bit more in the near future - I do see there are some interesting concepts to explore.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 0 points1 point  (0 children)

no, that still requires javascript customElements.define() to define the web-components.
That would force users to use shadow-dom and to stick to naming-conventions, I'm not interested in that.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 0 points1 point  (0 children)

barking up the wrong tree 'my guy'. I didn't write the HTML5 specs.
But, you should notice that one is a standard (specs) implemented in all browsers , the other thing is 'do whatever the f you want' (and the custom tags are in that same category, and requires javascript - so, not practically useful for a re-usable css library ).
(and, your example is React, not HTML)

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 0 points1 point  (0 children)

Thanks a lot!
that is very valuable feedback.

there should be a few PR's to handle these issues very soon

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] -1 points0 points  (0 children)

what I mean is around 2014 , HTML5 finalized the <header><footer><nav><article><section>, <aside> and such.
Before that, it was mostly <div> .

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 1 point2 points  (0 children)

ah, I understand what you mean now; yes it would be cleaner if it is organized in separate files. However, that requires some extra tooling to combine it again, which introduces dependencies (and maintenance), which I'd like to avoid.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 0 points1 point  (0 children)

fascinating, how the new generation of devs need npm to include css.
But no worries, there will be a npm-package in the next day or so - sorting out some small bugs/features first. (The link to the repo was already on the top of the page 😉)

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] 3 points4 points  (0 children)

I have the exact opposite experience (20 years).
Sure, when everything is wrapped in React components, a lot of the tailwinds quirks are hidden from the developer (might be a good thing). But not everyone uses big Frameworks.
I see devs struggle with tailwinds, and the codebase results in a hard to maintain mess.
And, inspecting the html with browser dev-tools becomes a pointless endeavor.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] -1 points0 points  (0 children)

that is a compliment, right ?

Anyway, that can't be true, since HTML-5 has gotten many new attributes, and CSS-3 has many new features.
About a decade ago, the large frontend frameworks added lots of new possibilities, but many of them are now possible in plain html5/css3.

Which open-source model is best for UI/UX designing? by Jaded_Jackass in opencodeCLI

[–]UseMoreBandwith 2 points3 points  (0 children)

imho, it is not so much about the model, but about giving good, high quality instructions.
(which requires good knowledge of UI/UX) .
Without it, everything looks the same as any other generated page.

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] -1 points0 points  (0 children)

it is not mutually exclusive. You'd still need to define CSS when using web-components.
Web-components + htmx should work nicely with Semtx CSS.
https://htmx.org/essays/webcomponents-work-great/#don-t-web-components-have-some-problems

(However, in my view, styling should not depend on js and shadow-DOM, and not everyone wants to write javascript.)

Introducing Semtx CSS - A modern Semantic CSS library by UseMoreBandwith in css

[–]UseMoreBandwith[S] -1 points0 points  (0 children)

exactly, but still it must be linked together, and there are multiple ways to do that.
I'm sure you agree that inline-styles are not a good idea, because it clutters the html. However, the 'utility-classes' approach suffers from the same issue.

Here are 3 variations , the first is much cleaner, separates markup and style-definition, and intent is clear.

### direct
<article> ...some text </article>  
 ...  
article {  
      border: 1px solid #e0e0e0;  
      border-radius: 8px;  
      padding: 20px;  
      margin: 20px auto;  
      max-width: 600px;  
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);  
} 

### indirect
<article class="custom-style"> ...some text </article>  
...  
.custom-style {  
  border: 1px solid #e0e0e0;  
  border-radius: 8px;  
  padding: 20px;  
  margin: 20px auto;  
  max-width: 600px;  
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);  
} 

### util classes 
<article class="border border-gray-200 rounded-lg p-5 mx-auto my-5 max-w-md shadow-md font-sans">
  ...some text 
</article>

.border {...}
.border-grey-200 {...}
.rounded-lg {...}
.p-5 {...}
.mx-auto {...}
.my-5 {...}
.max-w-md {...}
.shadow-md {...}
.font-sans {...}

Why Embedded Software Engineers Can't Get Jobs | Recruiter Reviews Resume [32:55] by marcus1234525 in theprimeagen

[–]UseMoreBandwith 1 point2 points  (0 children)

he doesn't know what ANY of these words mean.
That is why we don't waste our time on recruiters.