Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 3y ago · link · parent

That's considered a radical stance, but I +1.

Ads should just be banned anywhere in general.

They concentrate power to those who already have it, because you can make more ads if you have more money. The local burger joint cannot compete against macdonals on advertising, the local soda against coca cola.

It's ugly, eat attention, and interrupt.

It creates business models with terrible incentives, which leads to censorship in medias, quantity over quality, attention driven content, etc.

It encourages mass surveillance, and is used to influence society in the worse ways, making it dangerous to democracy.

Finally, if you remove ads, suddenly you get a much better filter for things: if people don't think it's worth even a little bit of money, let it die. It was not worth it.

Besides, even if you pay, you still see ads. You see submarine articles in paid newspaper, ads before your movies in the theater, ads in your bus ride...

Can you imagine, all this ads money, now free to be invested in something else?

comment 3y ago · link · parent

That's were going multi-planetary is attractive.

comment 3y ago · link · parent

Bought a switched, but eventually gave it away.

But the deck stays.

comment 3y ago · link · parent

Every time I compare the values of video games to movies, even the small indie ones come out on top.

Cinema is so expensive nowadays.

comment 3y ago · link · parent

That's a pros, not a con. Once something is merged, intermediary steps to get that new thing are no longer interesting. In fact, most rebase workflows squash anyway.

In the rare case you have 3 steps in that PR of 23 commits you want to keep, squash it in 3 pieces and merge them.

comment 3y ago · link · parent

You can do that with squash-merge.

1717.

Implementing a C-like for loop in Python(tushar.lol ↗)

2 points · by BiteCode_dev · 3y ago · discuss

1718.

Racket Frustrates Me(lobste.rs ↗)

2 points · by BiteCode_dev · 3y ago · discuss

comment 3y ago · link · parent

PR piece. Kill that spam.

1720.

What's up in the Python community? – June 2023(bitecode.dev ↗)

10 points · by BiteCode_dev · 3y ago · 1 comment

comment 3y ago · link · parent

I though I was good at starcraft before going to Battlenet, and I though I learned I wasn't.

But last year I went to play HOMM3 online, and I imagined I could at least teach the kids a trick or two.

I was so wrong.

comment 3y ago · link · parent

Every time this is mentioned, the person is heavily downvoted.

But if you were here in the 2000, that's exactly what happened.

In fact, this very article starts with "JavaScript, the undisputed king of web development, is being sabotaged — not by a rival language or a revolutionary new technology, but by its own baggage from the past.". That's the first sentence.

Nobody wanted to work with JS, it was used to make snowflakes on your home page on Xmas at best.

Then things like gmail happened (using GWT!), and the web became the most awesome platform in the world. By then it was too late, JS was the de facto language of the coolest tech of human history.

It was such a trap Google spent billions and hired the best minds out there to make chrome, with a VM that could execute it fast enough, so the company could make its vision happen.

At the time, JS was a nuisance and an embarrassment, something we had to deal with. The "good parts" was the bible because it's a language you could only use if you ignore half of it.

Case in point, the most popular JS techs created after that existed precisely to avoid writing ES5. Like coffeescript, babel, webpack, etc.

JS is a decent language now, because the community invested so much into it. Provided you use tooling. A lot of it.

But that's not how it started. We were forced to use it, and had to spend considerable resources to make up for how bad it was.

I've yet to met anybody who knows Python/Ruby/C#/Java/Rujst/Go and JS to chose JS outside of the web. Because there, we have the choice.

Electron, unfortunately, might take a chunk of that choice, because once again, the browser platform is that great.

1723.

Python and the Legend of Zelda(gazj.substack.com ↗)

2 points · by BiteCode_dev · 3y ago · discuss

comment 3y ago · link · parent

You mean softwares VLC, Linux, Python all came out of a monopoly position?

Or maybe you mean great greater than life concepts like the press, the Web or vaccines have been invented by big monopolistic entities?

Or do you mean unicorns like Google, Amazon and Facebook were born out of monopoly?

comment 3y ago · link · parent

Managing multiple windows, copy/pasting, using shortcuts from muscle memory and things like instant middle mouse click are terrible experiences on any tablet or phone.

Just opening a new tab on a browser is tedious, and if you deal with a lot of intranet tools, this is the very basics of productivity.

comment 3y ago · link · parent

TIL again. Very good thread!

It's "interact" though, not "ive".

You can exit it to carry on with the regular pdb.

comment 3y ago · link · parent

There are not workaround, pdb is a rustic tool.

Since I still enjoy a cmdline debugger more than a graphical one, I use ipdb, which doesn't suffer from the multiline limitation.

However, scoping issues with lambda and comprehension are actually a Python problem, not a pdb problem.

comment 3y ago · link · parent

I was wondering was was this for Rust.

Then I realized with maturin, that was Python :)

1729.

FastDepends: FastAPI DI system cleared of all HTTP logic(lancetnik.github.io ↗)

1 points · by BiteCode_dev · 3y ago · discuss

comment 3y ago · link · parent

Nice. I should use a similar id with ULID.

Although, if stored in a DB, I would probably split the tag and the id in 2 separate columns, because DBMS often have a dedicated efficient UUID field type.

A little client code wrapper can make that transparent.

comment 3y ago · link · parent

That's more of a cultural thing. Because Python is easy to get into, and you can be productive very fast, a lot of people with little experience in programming start to build things that are out of their reach.

They just don't know it, and the people hiring them don't either.

It's not a new phenomenon, we got the same when Java arrived, then PHP, etc.

Every time something makes things easier, you get a wave of beginners set to create things they are not qualified to do. And because you now need software for everything, leaders also get into positions where are not qualify to make some decisions about it. You pair unqualified leaders with unqualified devs, and you get this.

And it's now easier than ever to be in this position, also you are more pressured than ever to get into this position.

I've worked on plenty of big Python systems myself, it's not the tech per se (it has the usual pros and cons game like every language), but Python is the language used "when you don't know programming".

Which is ironic, because when I started to use it in Python 2.4, only passionate devs used it because it was niche, and we had the opposite effect.

comment 3y ago · link · parent

-m pdb is post mortem debugging, it drops you in the debugger when it encounters the first unhandled exception. This is much easier than trying to pin point where to put a breakpoint.

comment 3y ago · link · parent

Damn, 15 years of python and I learn you can use -m twice. I've never even tried, didn't occur to me it would be supported.

EDIT: it support other options as well, like -c. That deserves an alias:

    debug_module() {
        if python -c "import ipdb" &>/dev/null; then
            python -m ipdb -c c -m "$@"
        else
            python -m pdb -c c -m  "$@"
        fi
    }

comment 3y ago · link · parent

I get where the author comes from, but my definition of simple doesn't include anything with the word "smart" in it.

I have simple watches. They are casio.

comment 3y ago · link · parent

It also uses the file as a module, not a script, which means suddenly relative imports works the root dir and the cwd are the same, and it is added to sys.path.

This prevents a ton of import problems, albeit for the price of more verbose typing, especially since you don't have completion on dotted path.

It is my favorite way of running my projects.

Unfortunalty it means you can't use "-m pdb", and that's a big loss.

comment 3y ago · link · parent

It's so nice to use, espacially in a shell.

And also such a performance trap.

comment 3y ago · link · parent

You started with the worse ORM in existance.

There are ORM with good pros/cons ratios out there. Python has espacially good ones:

- Django comes with a clunky and poor performing one, but it's very well integrated, super practical, productive and has nice ergonomics.

- Peewee gives you an ORM in a small package, which makes writing those little programs a joy when you don't need anything fancy, but feel lazy.

- SQLAlchemy requires a lot more investment, but is very flexible, generates clean SQL and has extremely correct behavior. It also exposes a lower level query builder for when you don't want the OOP paradigm and wish to express idiomatic SQL behavior, but abstracted away with Python.

This becomes a standard engineering decision, where you analyze the ROI.

comment 3y ago · link · parent

Yes, starting with Hibernate as a idea of what ORM provides is terrible.

ORM have plenty of flaws, but it's like buying screws on wish and saying using a screwdriver is a terrible experience.

comment 3y ago · link · parent

Ah, got tricked by the quote that was comparing safari on ios with kiwi on one plus 6.

comment 3y ago · link · parent

It states "Unparalled Speed", and testimonies say it's much faster than safari.

Since on iOS any browser must use Apple's engine anyway and can only provide a thin layer on top of it, how does that happen?

1
575859
184