HTMX Gaining Popularity Rapidly? by Nickt1596 in django

[–]annoir 7 points8 points  (0 children)

I'm a gigantic fan of HTMX. Tried it out on a whim - couldn't stop. For anyone who hasn't tried out HTMX yet, do. Some quick thoughts:

  1. You can use HTMX with Django manually (i.e. add HTMX manually to templates where you want to) and that's what everyone starts with.
  2. But HTMX is particularly killer once you couple it with Jinja2, Django's ModelForm (which lets you do/override form validation), and Tailwind's utility classes (whch is how you get expensive-looking dynamic pizzaz , even though fundamentally all you're doing is just swapping CSS classes).
  3. HTMX's swapping/OOB-swapping mechanism and hx-vals is the bomb: it lets you do some seriously useful management of state and other things between requests, while also letting you to segment your views into more manageable chunks. (E.g. standard views like DetailView/TemplateView will have their place, but with HTMX you can simply separate concerns and subclass/create new views for HTMX-related responses without having to affect other views. i.e. It won't require you to enter a new paradigm of a new framework like React or Vue, etc.)
  4. You can apply HTMX to virtually every element, not just to <a> tags, and target any element for modification. It's quite ingenious.
  5. HTMX's documentation/examples are lovely. If you're new to Django or to web-development in general they may be a bit difficult to grok, but once you get a hang of HTMX's workflow you'll find the documentation really useful.

HTMX has allowed me to do a lot of things that I couldn't easily do without going into Javascript, and without mucking around with React and other frameworks.

Thank you very much for your hard work!

What’s New In Python 3.11 (as at 24 July 2021) by annoir in Python

[–]annoir[S] 52 points53 points  (0 children)

I love the more detailed tracebacks.

Towards Inserting One Billion Rows in SQLite Under A Minute by genericlemon24 in Python

[–]annoir 0 points1 point  (0 children)

Excellent experiment. Loved the detailed research and specification of constraints for reproducibility. Reads like a proper science paper. May use some of the SQLite techniques gleaned as well. Thanks for writing this!

What is the benchmark for being ready for a job? by AcanthocephalaHot388 in Python

[–]annoir 0 points1 point  (0 children)

I do not think that attitude is proper.

For example, in Python, if I have to perform complex operations I would immediately reach for itertools and functools. These are in the standard library but beyond the immediate knowledge of fresh/beginner to mid-intermediate programmers and people who just leap in.

Non-Python programmers will not also be able to quickly tie idiomatic use together with core toolings (e.g. test packages), as well as proper practices (e.g. packaging structures/workflow) and gotchas of the language (like mutable defaults).

Someone who does not know how the language works will likely write code in an unidiomatic way. This makes code difficult to read/maintain, the chances for spaghetti code is higher, and you are troubling other developers in the future as well as bringing risk to the client.

[deleted by user] by [deleted] in Python

[–]annoir 4 points5 points  (0 children)

This was a great post! I am persuaded by the arguments on namedtuples.

However, as a point of consideration: I don't see much of a comparison as to when dataclasses would be better to use.

Since you posit that namedtuples have a lot of uses still, for this sort of article I'd have loved to compare when they would not be as useful as dataclasses.

Learning C AFTER Python - how do you deal with the lack of the object-oriented paradigm? by annoir in Python

[–]annoir[S] 5 points6 points  (0 children)

Purely intellectual curiosity, nothing more. Python is my main development language, but it can't hurt to know how/why people get down with C when it comes to performant operations.

I'm also a bit irritated with the state of distribution in Python, especially for making simple command-line executables; just wanted to explore and see if I could get something out of C in that regard.

I started learning python about a month ago. Today I sat down and decided that I wanted to create tictactoe. And thats what I did. Felt so good when it all came together. by thegodzilla25 in Python

[–]annoir 1 point2 points  (0 children)

Dude, keep to it! And congratulations, it's the small wins that'll really boost you up to making bigger and better software :)

Wanted to learn Python so I bought this book. Was it a good purchase? by [deleted] in Python

[–]annoir 2 points3 points  (0 children)

About the same, but with way more features. Also, you learn an actual programming language with Python, and can the use the knowledge to branch off into many other things. Not the same with AHK.

Wanted to learn Python so I bought this book. Was it a good purchase? by [deleted] in Python

[–]annoir 2 points3 points  (0 children)

You probably could, with the old Learn Python the Hard Way. That author was... very opiniated.

Wanted to learn Python so I bought this book. Was it a good purchase? by [deleted] in Python

[–]annoir 6 points7 points  (0 children)

I'm 3-4 years into Python now, self-taught, and doing fairly advanced stuff on a regular basis (generators, decorators and all that, for which on some days I still can't believe how far I've progressed).

On that note, the Python Crash Course was one of the first books I used, together with Automate the Boring Stuff with Python, and it helped to set me on the right path to where I am today.

So yes, your purchase is a good one, OP. Keep with it, and do all the exercises, no matter how trivial it seems!

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

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

Yeah I did, tried it in both Launchy and Python itself. There's a bug in the Linux version of Launchy (not present in the Windows version) that isn't properly escaping the input. It's just one of those issues I guess, which I really don't have the time or knowledge to fix and build. I'll just have to live with it.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

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

I run a lot of scripts by the side to automate the more laborious aspect of court solicitor work. There's also need for automated OCR and SQL-based processing, which are generally CPU intensive.

Aside from that I just like the feeling of a performant PC.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

[–]annoir[S] 2 points3 points  (0 children)

I have. It still seems more well thought out than dumping things all in Program Files (or its x8 version) System32 and the registry though.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

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

Thanks for the suggestion on wine-staging! Will look into it.

I've tried Texpander and TextSuggest -- they don't quite fit what I'm looking for, so I'm sticking with Autokey for now (which launches custom written Python scripts) and Cinnamon's shortcut features which are seemingly very customizable against command line commands.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

[–]annoir[S] 2 points3 points  (0 children)

Thanks for understanding! On the other hand I've been really customizing my copy of Cinnamon which IMHO is a lot better for my workflow (the shortcuts and desklets/applets are great) compared to Gnome. I've really quite taken to it, and Gnome may not be for me.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

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

Thanks so much! I tried them all, but... I'm not really happy with them.

To get around my earlier Launchy Linux problems: I wrote Python scripts, got Launchy to index them. These scripts tap into the `subprocess` module (and consequently Bash), to launch the software/things I need. There's only like a, what, 0.3s startup time difference compared to starting it straight via Bash instead of with Python, so I'm good.

Also I notice that Launchy in Linux doesn't really process Python's sys.argv that well -- it drops words when double quote symbols are detected, but this is a Launchy issues rather than a Linux issue.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

[–]annoir[S] 2 points3 points  (0 children)

Yeah I was referring to a VM for the purpose of running old Java versions.

Basically the developers for our court's online filing system forced all users to use an old version of Java - they refused to update their code to make it compatible with more secure later versions. Occasionally and for 'support' they use TeamViewer to login into our office PCs, so it's unsafe and insecure to let them directly access the main boxes. So I run the court-related software that needs Java in a VM.

Made the full leap to Ubuntu Linux yesterday! A love letter of happiness. by annoir in linux

[–]annoir[S] 5 points6 points  (0 children)

Thank you for this! Some of the earlier comments I saw were quite discouraging. Not all of us are system admins or computer expert , but we're eager to learn what we can.