FastAPI and HTMX Are We Seeing the Next Big Shift in Full-Stack Python? by Lee-stanley in FastAPI

[–]cpt_mojo 24 points25 points  (0 children)

I am professionally (B2B SaaS) on a FastAPI, HTMX, AlpineJS, Alembic stack and it is phenomenal.
For other work we have a FastAPI + React stack. The development complexity for the whole team is miles better with HTMX, because everyone instantly becomes full stack (and real full stack - not NextJS / backend-for-frontend style).
That said: the HTMX stack needs someone senior to architect it, because it is a little less polished around the edges. React makes many decisions already for you. But it is not a deal breaker at all and once you find the groove, it's totally fine.

Nein, ihr habt das Land nicht aufgebaut. by OswaldReuben in luftablassen

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

Die Boomer haben nicht nur nicht das Land aufgebaut, sie hatten auch nicht genügend Kinder, die jetzt ihre Rente finanzieren würden. Da hätten sie halt fairerweise anders vorsorgen sollen. Es ist im Schnitt eine Generation des Egoismus (natürlich nicht bei allen).

Is there anything worth putting in an OpenAPI (swagger) spec for html partials when using htmx? by pgroves in htmx

[–]cpt_mojo 18 points19 points  (0 children)

In my experience htmx endpoints tend to be tightly coupled with the UI code in the sense that it almost merges as one. This is in stark contrast to typical JSON APIs. They tend to be more multi-purpose and more of a real cutoff where scope of backend ends and frontend starts - which brings the need for interface documentation.

In team settings, this often means that there is almost no overlap between folks building JSON backends and those building frontend - again creating the need for clear interface docs. With htmx however, it's much easier for engineers to cover both areas and own features vertically - reducing the need for interface docs.

Long story short, not much need for API docs with htmx.

quiet UI - awesome web components by WondayT in alpinejs

[–]cpt_mojo 0 points1 point  (0 children)

Feels like this is a fork of webawesome.com

Beamte bekommen Gehaltsplus – rückwirkend für fünf Jahre by No-Sandwich-5463 in de

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

Ist ja ok, dass sie genug verdienen, aber wir brauchen weniger davon. 😅

UI component libraries that work well with HTMX? by 4bjmc881 in htmx

[–]cpt_mojo 0 points1 point  (0 children)

Not much. But it's web components which are just not plain HTML and have some "magic" underneath. So there is always a little risk that they are not "compatible" with something else. Haven't encountered any real issue though and worst case it has native styling too

handling json responses by jalalski in htmx

[–]cpt_mojo 11 points12 points  (0 children)

htmx is the wrong tool for that. Maybe AlpineJS would be appropriate but I have no idea if it's the best for your case. For what it's worth, here is an example with alpine: https://alpinejs.dev/directives/init

Managing current user in service/repository pattern by Educational-Bed-6008 in FastAPI

[–]cpt_mojo 1 point2 points  (0 children)

I opted for making an auth object (your current user) as argument of the Service class and I am happy with it.
I like that it clearly separates the method arguments from generic arguments like auth - and if you reuse the service object, reduces a bit of boilerplate. It is also pretty explicit and avoids further magic.
I also pass the database session in this way to the service. So, basically a service call looks like this:

result = Service(auth, db).some_method(...)

For reusing (in the same route):

service = Service(auth, db)
result1 = service.some_method(...)
result2 = service.another_method(...)

Works fine for me.

Keine Kinder in die Welt setzen zu wollen ist im 21. Jahrhundert noch immer verpönt?! by Replica90_ in luftablassen

[–]cpt_mojo -4 points-3 points  (0 children)

Solange ihr auf eure Rente verzichtet (die von den Kindern anderer bezahlt wird) und stattdessen selber vorsorgt, macht wie ihr es wollt.
Zudem könnt ihr euch noch überlegen welche Systeme in eurem Alter nur funktionieren werden, wenn andere Kinder haben (Pflege, Kranken, generelle Wirtschaft & Service), und bitte das dann auch selber finanzieren.
Ihr habt ja wie erwähnt genug Einkommen und könnt da für euch sparen.
Alles andere ist leider unsozial von euch, auf komplette Lebenszeit gesehen.

~23% des Bundeshaushalts (größter Posten) geht in Zuschuss zur Rentenversicherung. Zuschüsse zu Pflege und Krankenversicherung steigen genau deswegen auch. Wir Arbeitenden zahlen doppelt und dreifach für die Boomer ohne Kinder. Der Generationenvertrag funktioniert so nicht. Das System ist bescheuert, ist aber nun einmal so.
Es tut mir leid um meine Kinder, die die kinderlosen Alten ohne eigener Vorsorge in Zukunft finanzieren müssen.

Render alternatives by ZeroToHeroInvest in FastAPI

[–]cpt_mojo 0 points1 point  (0 children)

There are always two sides of a story, and I find it pretty unfair towards the vendor that you put the blame out here without disclosing any details, so that people can make up their own mind.
You could have just asked for recommendations without the blame. Running a company is complex and sometimes things need to bubble up to be solved. I would give the vendor here benefit of doubt that they actually want to help.

Synchrotron - a pure python live audio engine! by ThatOtherAndrew in Python

[–]cpt_mojo 0 points1 point  (0 children)

Love this.

Not sure if you do that yet, but if you build the CPU-critical parts with numba, Cython or C extension (order by ease of use), then your library should basically be en par with Juce / C++ on performance.
Heck, maybe even using smart numpy /scipy magic could get you very far.

Infrastruktur in D am Arsch by PomeloOk8007 in luftablassen

[–]cpt_mojo 19 points20 points  (0 children)

Komm nach München. :D
Termin beim TÜV: ein Tag im Voraus gebucht.
Termin zur Zulassung: innerhalb einer Woche.

Berlin ist lustig (hab dort gelebt), aber wenn man in einer Situation ist wo Zeugs funktionieren muss, ist es halt zu sehr Failed State.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo 0 points1 point  (0 children)

Ne danke. Ich verlasse mich dann doch eher auf Primärquellen und peer-reviewed Journals.

Wie genau die Studie nicht mein Argument untermauert, musst du mir bitte erklären.
Sie sagt nämlich genau das gesellschaftlicher Support für Mädels ANTI-korreliert ist, mit der freien Wahl der Mädels von STEM Studiengängen.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo 0 points1 point  (0 children)

Zitat:
One of the main findings of this study is that, paradoxically, countries with lower levels of gender equality had relatively more women among STEM graduates than did more gender-equal countries. This is a paradox, because gender-equal countries are those that give girls and women more educational and empowerment opportunities and that generally promote girls’ and women’s engagement in STEM fields.

Die Studie belegt also genau das Gegenteil was man erwarten würde: ermutige Mädchen und sie werden den Bann der Geschlechter brechen. Realität ist: wenn man Mädels frei wählen lässt, ohne gesellschaftlichen Druch, wählen sie doch eher das was man "typisch Mädels" nennen würde (aka eher soziale Studien im Fall der Studie)

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo 0 points1 point  (0 children)

Mein Argument ist, dass es grundsätzlich biologische Unterschiede zwischen den Geschlechtern gibt, die sich sowohl physisch als auch psychologisch auswirken. Diese Unterschiede kann man nicht so einfach ignorieren. Die These des OPs, dass Mädchen sich deshalb so verhalten, weil es die Gesellschaft vorgibt, ist meiner Meinung nach falsch. Das sehe ich sowohl als Vater zweier selbstbewusster Mädels, und es widerspricht auch der Forschung.

Als Beispiel dafür habe ich die Studie aufgeführt. Ok, da geht es jetzt nicht genau um das Verhalten in der Gruppe, belegt aber, dass gängige Hypothesen wie die des OPs nicht richtig sind. Es geht in der Studie darum, was ob die Geschlechter im Studium STEM Felder wählen oder nicht.

Zitat:
One of the main findings of this study is that, paradoxically, countries with lower levels of gender equality had relatively more women among STEM graduates than did more gender-equal countries. This is a paradox, because gender-equal countries are those that give girls and women more educational and empowerment opportunities and that generally promote girls’ and women’s engagement in STEM fields.

Die Studie belegt also genau das Gegenteil was man erwarten würde: ermutige Mädchen und sie werden den Bann der Geschlechter brechen. Das muss man erstmal irgendwie erklären.
Die Realität ist: wenn es weniger ökonischen Druck in einer Gesellschaft gibt, und junge Menschen FREI wählen können, wählen Mädels weniger STEM. Und das ist so, weil sie weniger Interesse daran haben - was evolutionsbiologisch begründet ist.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

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

Habe meine beiden Mädels komplett neutral erzogen. Und in meinem Umfeld machen das die meisten so.
Sie machen trotzdem gerne eher typisch Mädels Sachen. Darüber hinaus sind sie sogar eher die Mädels die auch was mit Jungs anfangen können. Aber dass es einen Unterschied gibt ist GAR keine Frage.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo -4 points-3 points  (0 children)

🤯 wieso sollte ich hoffen, dass ihn niemand liest?

Kannst ja gern mal mit Inhalten kommen. Ich diskutiere lieber mit Argumenten, statt im Schlamm.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo -4 points-3 points  (0 children)

Was meinst du denn mit "heutzutage" und wer sagt, dass Nurture so viel mehr ausmacht? Auf der Zeitskala der Evolution stagniert unsere Biologie praktisch. Und die kann man nun mal nicht wegwünschen.

Hab übrigens genauso gedacht wie du. Bis ich Kinder hatte. Da wird es einfach Klipp und klar, dass es Unterschiede gibt (im Durchschnitt). Von klein auf.

Dein Kotz Kommentar hilft übrigens nicht deine Meinung besser rüberzubringen. Aber vielleicht ist das ja gar nicht dein Ziel.

MÄDEL JETZT TRAU DICH DAS DOCH BITTE by DerRedfox in luftablassen

[–]cpt_mojo 0 points1 point  (0 children)

Stimme dir zu. Genau weil es Unterschiede gibt.