namingthingsiseasy

joined 2 years ago

Interesting, I had never heard of ccache before, though yes, all good build systems (CMake, Ninja, etc.) should cache intermediate object files.

But the projects I was working on were so large that even binary and unit test executables were so large that even they would take ~20 seconds to link. You can't use caching to alleviate that buildtime cost unfortunately.

[–] namingthingsiseasy@programming.dev 0 points 1 day ago (2 children)

I think it’s just because it is always recommended as an “easy” language that’s good for beginners.

The only other thing it has going for it is that it has a REPL (and even that was shit until very recently), which I think is why it became popular for research.

If that's the case, then why didn't Javascript take its place instead? It's arguably even better at Python in both of those areas....

Agreed. I have seen a lot of Python code that was really painful to massage back into a more structured object hierarchy. Java certainly does a bit better in that respect, and as a language, it does a much better job of encouraging better practices, but I think it's also largely due to the kinds of people that use those languages as well.

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

Sure, but as with all things, it can depend on a lot of factors. All code needs some degree of testing, though one could certainly argue that Python needs more than Java and Java needs more than Rust/Haskell/etc. So you could argue that the productivity gain of using Python is offset by the productivity loss of extra testing. It's still hard to say which one wins out in the end.

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

It can scale though. It parallelizes really well if you use queuing systems to distribute the load. You just have to make sure that the hot loops are in C/C++, and it is very easy to interface with compiled binaries via the C API.

[–] namingthingsiseasy@programming.dev 2 points 2 days ago (3 children)

Python's type system is dramatically better than Javascript's though. Try doing things like '' + True and Javascript will do incredibly stupid things. Python will just give you a type error. Also, look at things like == vs === in Javascript as well. That's the biggest reason why Typescript replaced it overnight. Python has found a better balance between productivity and error safety.

In my opinion, the biggest shortcoming of Python's dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn't have semantic errors (a lot more than, say, Java). It has gotten better with the introduction of type hints, those I don't have much experience with them, so I can't say how much.

[–] namingthingsiseasy@programming.dev 3 points 2 days ago (2 children)

Having worked on large C++ projects, the solution to this issue is using a good IDE with an LSP. But it is quite a regrettable situation because setting up an LSP can be a difficult, and they also tend to break quite easily. Understanding how to make an LSP work is an important productivity skill in those kinds of positions.

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

Distribution usually isn’t considered a strong point for Python, though.

It depends. If it's a simple script with no external dependencies, then it's very easy to distribute. But if your application has external dependencies and you are trying to install it on your host (and you aren't using docker or similar technologies), then yes, it's harder than just shipping an executable or .jar file. The fact that Python's standard library is so comprehensive helps a lot in this regard, but it only works up to a certain point.

Yeah, you can use it both for full applications (web or desktop) as well as simple scripts. The flow of getting from something simple to a full blown application is pretty smooth and natural - better than just starting out in Java or C++ and taking at least an hour before you get anything that runs.

[–] namingthingsiseasy@programming.dev 52 points 2 days ago (42 children)

My opinion: Python may not be the best at everything it does, but it's in the top 3-5 languages in the following areas:

  • Very easy to install, write and understand
  • Great libraries for a lot of applications
  • Large community, lots of people with experience in it

It will always be a practical choice for those reasons. There are probably a lot more as well that I can't think of at the moment.

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

As others have mentioned, this is a matter of threat model. To be realistic, a sufficiently determined government will always be able to access your communications, but companies like Facebook and Google can only access them if you give it to them willingly. On the other hand, if other people you communicate with do this by themselves, then you've gone through all that effort for nothing. It's also worth pointing out that it cannot be proven that a regular phone does not have corporate spyware installed, so this may be another way your information could leak to companies.

That said, it is pretty insulting that tech companies have decided that they're simply entitled to everyone's private communication data. That for me is probably the biggest motivator in trying to avoid their services as much as possible.

Pathlib is very nice indeed, but I can understand why a lot of languages don't do similar things. There are major challenges implementing something like that. Cross-platform functionality is a big one, for example. File permissions between Unix systems and Windows do not map perfectly from one system to another which can be a maintenance burden.

But I do agree. As a user, it feels great to have. And yes, also in general, the things Python does with its standard library are definitely the way things should be done, from a user's point of view at least.

 

I'm at a relatively stable point in my life (working part time, financially stable), so I'm thinking about trying out as a freelancer, but just casually to start out and see if I like it. I'm curious how people get started - primarily, how to find work and connect with people who have available work and are willing to hire.

Other things to have in place before getting started (professional website, portfolio, other things) would also be helpful to know, but since I'm pretty casual about trying this out, I would hesitate to do additional stuff unless it's really important and makes a serious difference in obtaining potential clients.

Thanks in advance!

 

Now the win with PSG has even more eyes on Al-Khelaifi, whose claim to be the most important man in football grows ever stronger.

As well as being president of PSG, the 51-year-old former tennis player is chairman of the European Clubs Association — which represents the interests of 700 European clubs — is on the executive committee of UEFA — which organizes European football including the Champions League — and on the organizing committee for the upcoming FIFA World Club Cup. He is also a minister without portfolio in the Qatari government and chairman of state-owned broadcaster BeIn Sports, which has bought the rights to the Champions League.

 

A great introduction to what traces and spans are, how they work, and the OpenTelemetry Protocol

 

The researchers found sweeping changes in overall brain neuroanatomy which unfolded week by week during the pregnancy.

Inside Chrastil's brain, grey matter volume, cortical thickness, white matter microstructure, and ventricle volume all changed.

The changes were all over the brain too — "over 80% of my brain regions showed reductions in grey matter volume," Chrastil said.

Neuroanatomical changes observed over the course of a human pregnancy. Published by Pritschet, L., Taylor, C.M., Cossio, D. et al. in Nature Neuroscience (September 2024). https://doi.org/10.1038/s41593-024-01741-0

 

I've used a US-QWERTY keyboard layout my entire life. I've seen other layouts that do things like reduce the size of the enter/backspace keys, move the pipe operator (|) and can't wrap my head around how I would code on those.

What are your experiences? Are there any layouts that you prefer for coding over US English? Are there any symbols that you have a hard time reaching ($ for example)?

view more: next ›