• 0 Posts
  • 23 Comments
Joined 2 years ago
cake
Cake day: June 21st, 2023

help-circle
  • If you are new to something and want to learn, seek resources and educate yourself with them. Learning takes time, and there are no shortcuts.

    A hot DB should not run on HDDs. Slap some nvme storage into that server if you can. If you can’t, consider getting a new server and migrating to it.

    SQL server can generate execution plans for you. For your queries, generate those, and see if you’re doing any operations that involve iterating the entire table. You should avoid scanning an entire table with a huge number of rows when possible, at least during requests.

    If you want to do some kind of dupe protection, let the DB do it for you. Create an index and a table constraint on the relevant columns. If the data is too complex for that, find a way to do it, like generating and storing hashes, sorting lists/dicts, etc just so that the DB can do the work for you. The DB is better at enforcing constraints than you are (when it can do so).

    For read-heavy workflows, consider whether caches or read replicas will benefit you.

    And finally back to my first point: read. Learn. There are no shortcuts. You cannot get better at something if you don’t take the time to educate yourself on it.



  • For your second part:

    A lot of open source projects exist to make people’s lives easier at work. The people developing these projects are often also people who have jobs as devs and have a use for the projects. It just so happens that it’s easier to use these libraries at work and share them with others when they’re more permissively licensed, and there are community benefits when people all contribute back to it.

    There’s nothing wrong with wanting to go the AGPL route and forcing everyone into open source, but that makes it much harder to use these tools at work, which often kills the motivation behind building them in the first place.

    I tend to be of the opinion that community tools should be GPL/AGPL, while libraries can be anything. It works as a compromise for both - so devs can have an easier time at work while also forcing contributions back to community-developed tools.

    Edit: I should also mention dual licensed AGPL/paid commercial. That model is probably my favorite, but unfortunately uncommon.


  • TehPers@beehaw.orgtoProgramming@programming.devThe Innocent Loop
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    9 days ago

    This seems to me more like a complaint about JS’s functional methods on arrays being eager rather than a complaint about loops. All of this is solved in languages with iterators (or async iterators for a potentially better solution).

    For example, in C#, .Where does nothing immediately on enumerable types, and on IAsyncEnumerable, you can go as far as streaming/chunking results from a DB into the enumerable and filtering off the DB asynchronously just by passing the enumerable into an await foreach. In Rust, you get the same options (though more verbose) using streams from futures.

    Edit: the rest of the article doesn’t really have much to do with loops, but these are all solved problems in C#, Rust, and I assume other languages too. Even Python has iterables, and you can configure your thread pools however you want to for concurrency.


  • For your goals, I would stick with Python unless you want to learn another language. There’s not much value to switch away when all the tools you need are primarily designed for Python.

    As far as functional programming goes, with AI stuff, my experience is that you generally are more interested in orchestrating services than FP. For example, run input through model #1, then based on the output, run one of these other 3 models (or multiple of them in parallel), then eventually pass it all back into another service/function to aggregate and format the outputs. You can think of each of these as being “functions”, but they’re much higher level than what you’d traditionally consider functions in FP and more along the lines of microservices.




  • Some of these key findings seem a bit overblown. The number of domains persistently connected to shouldn’t really matter - one is enough. Update checks are standard for software. Unique IDs/device fingerprinting are so common that browsers build in ways to try to prevent it at scale. JWTs are standard authentication tools - who’s the security concern for? ByteDance? Or are you saying the JWTs are from the local machine? And MessagePack isn’t exactly a secret format either.

    The TL;DR of this seems to be that ByteDance’s AI IDE collects a crazy amount of data and offers free AI services in exchange. I’m not really sure why you’d want those services, especially at the cost of all your code potentially being stolen or other data being collected, but it should be obvious that nothing in this world is truly free.





  • I’m not sure what you want me to respond with. Do you want me to tell you that you can walk in and demand a compensation at the start of your interview or something? Most individuals don’t have the bargaining power to do that. If you are desirable enough that the company wants to pay you whatever you ask for, then sure. Go in and talk about money right away.

    For most of us, we are competing with thousands of others for one of maybe a few positions. The onus is on us to prove that we are desirable and will provide value, and asking about compensation first does not usually give that impression.


  • Can’t speak for everywhere, but in the US, if your first questions are about salary, they’re going to be left wondering if you’re even qualified for the job and if money is all you care about. Even if it is (which is fine most of the time), that’s not really the impression you should give if your goal is to be hired.

    Asking about salary later on is usually a much better idea. You know whether you actually are interested in working there, the interviewer knows if they are interested in you, and wanting money it isn’t the first impression you give.

    As for Python - leetcode style interviews are common, but almost always worthless. The only real value the company gets from something like that is to check that you actually can write code. They’re pointless beyond that, and a company doing leetcode interviews should be a red flag.



  • No.

    Although I think it’s a symptom of a larger problem. At the very least, consider Rider (or for non-C# code, VS Code/Codium/your terminal editor of choice).

    At work, we have to use VS for C# development though, due to us having VS licenses and not Rider licenses. I guess we could use VS Code for C# dev, but I could also use Morse code to type, and neither of those sound like a good time when you take our work tooling into account.




  • Another couple missing:

    • every language uses gendered nouns/verbs/adjectives/pronouns/etc
    • no language uses gendered nouns/verbs/adjectives/pronouns/etc
    • pronouns referring to people are always gendered
    • pronouns are always singular (1) or plural (2+)

    A fun language to learn regarding these is Hawaiian, where the language uses a-class and o-class rather than masculine and feminine, and which you use is largely based on how much control you have over it.



  • Usually the serialization/deserialization code, I keep with the model. The part where a file or whatever comes in, I leave that to the caller to decide on. In other words, the model knows how to serialize and deserialize itself, but not where it’s being serialized to or deserialized from.

    Then again, in C#, it’s usually just a couple attributes on my model, and in Rust, it’s usually just a couple derives. It’s rare I actually write much, if any, serialization logic by hand.