If you’re so convinced you know best, I invite you to start writing your own filesystem. Go for it.
Dude is seriously missing the point here. It’s not about what, it’s about how.
If you’re so convinced you know best, I invite you to start writing your own filesystem. Go for it.
Dude is seriously missing the point here. It’s not about what, it’s about how.
What’s fun is determining which function in that list of functions actually is the one where the bug happens and where. I don’t know about other langauges, but it’s quite inconvenient to debug one-linres since they are tougher to step through. Not hard, but certainly more bothersome.
I’m also not a huge fan of un-named functions so their functionality/conditions aren’t clear from the naming, it’s largely okay here since the conditional list is fairly simple and it uses only AND comparisons. They quickly become mentally troublesome when you have OR mixed in along with the changing booleans depending on which condition in the list you are looking at.
At the end of the day though, unit tests should make sure the right driver is returned for the right conditions. That way, you know it works, and the solution is resistant to refactor mishaps.
But nothing is forcing you to check exeptions in most languages, right?
While not checking for exceptions and .unwrap() are pretty much the same, the first one is something you get by not doing anything extra while the latter is entirely a choice that has to be made. I think that is what makes the difference, and in similar ways why for example nullable enabled project in C# is desired over one that is not. You HAVE to check for null, or you can CHOOSE to assume it is not by trying to use the value directly. To me it makes a difference that we can accidentally forget about a possible exception or if we can choose to ignore it. Because problems dealt with early at compile time, are generally better than those that happen at runtime.
It can be pretty convenient to throw an error and be done with it. I think for some languages like Python, that is pretty much a prefered way to deal with things.
But the entire point of Rust and Result is as you say, to handle the places were things go wrong. To force you to make a choice of what should happen in the error path. It both forces you to see problems you may not be aware of, and handle issues in ways that may not stop the entire execution of your function. And after handling the Result in those cases, you know that beyond that point you are always in a good state. Like most things in Rust, that may involve making decisions about using Result and Option in your structs/functions, and designing your program in ways that force correct use… but that a now problem instead of a later problem when it comes up during runtime.
If Reddit back in the day had asked a few dollars for me to stick with using 3rd party apps using the API I would have. But they did the opposite, so here I am. First time actually donating to something, a measily $2 dollars a month, but hopefully a start to fund some of the free stuff I use.
I largely agree with this nodding along to many of the pitfalls presented. Except numbers 2s good refactor. I hope I won’t sound too harsh/picky for an example that perhaps skipped renaming for clarity on the other parts, but I wanted to mention it.
While I don’t use javascript and may be missing some of the norms and context of the lanugage, creating lamda functions (i don’t know the js term) and then hardcoding them into a function is barely an improvement. It’s fine because they work well with map
and filter
, but it didn’t address the vague naming. Renaming is refactoring too!
isAdult
is a simple function with a clear name, but formatUser
and processUsers
are surprisingly vague. formatUser
gives only adult FormattedUser
s, and that should probably be highlighted in the name of formatUser
now that it is a resuable function. To me, it seems ripe for mistaken use given that it is the filter that at a glance handles removing non-adult users before the formatting, while formatUser
doesn’t appear to exepct only adult users from it’s naming or even use! Ideally, formatUser
should have checked the age on it’s own and set isAdult true/false accordingly, instead of assuming it will be used only on adult User
s.
Likewise, the main function is called processUsers
but could easily have been something more descriptive like GetAdultFormattedUsers
or something similar depending on naming standards in js and the context it is used in. It may make more sense in the actual context, but in the example a FormattedUser
doesn’t have to be an adult, so a function processing users should clarify that it only actually creates adult formatted users since there is a case where a FormattedUser
is not an adult.
He may have used the wrong word, but maintaining the same function signature across two files (while made easier by IDE tools) sucks ass to do. It was one of the major pain points for me doing a C++ course (along with the abyssmal compilation error messages). Not that I have tried Zig, but I do not see a reason to involve header files in my life if I can avoid it.
Late here, but if you want the easy route then there is always Unity (C#) if it fits for your use case in game dev and the license isn’t a problem for you.
Compute becomes cheaper and larger undertakings happen. LLMs are huge, but there is new tech moving things along. The key part in LLMs, the transformer is getting new competition that may surpass it, both for LLMs and other machine learning uses.
Otherwise, cheaper GPUs for us gamers would be great.
The difference is, with a build pattern you are sure someone set the required field.
For example, actix-web you create a HttpResponse, but you don’t actually have that stuct until you finish the object by setting the body() or by using finish() to have an empty body. Before that point you have a builder.
There is noting enforcing you to set the input_directory now, before trying to use it. Depending on what you need, that is no problem. Likewise, you default the max_depth to a value before a user sets one, also fine in itself. But if the expectation is that the user should always provide their own values, then a .configre(max_depth, path) would make sense to finish of the builder.
It might not matter much here, but if what you need to set was more expensive struts, then defaulting to something might not be a good idea. Or you don’t need to have Option<PathBuf> and check every time you use it, since you know a user provided it. But that is only if it is required.
Lastly, builder make a lot of sense when there is a lot to provide, which would make creating a strict in a single function/line very complicated.
Example in non-rust: https://stackoverflow.com/questions/328496/when-would-you-use-the-builder-pattern
It’s hyperbole, but I learned my first language because I wanted to be a god.
I saw these magic windows that popped up, that had buttons, and I was jealous of these godly creators holding the power to make them do as they wanted. So, I learned it myself. I peeked at another program I was using, it was using python and PyQt so that’s what I set out with to become my own god of the desktop.
My first program was a GUI wrapper around the YouTube-dl CLI, and I still use it frequently.
I am very content with Riders “hide whitespace and newlines” diff option. Frankly after starting to use auto format on code, all old files that got messy in the diffs next time they were changed.
There’s some other nitpicks that some more aware diff could have but outside python few changes in whitespace matters, so seeing every new line is a waste and visual burden in any review for me.
Counter-argument: A lot of computer part brands are not viewed in the best light. From Intel and their constant upgrades of sockets and recent issues with CPUs, to mobo vendors doing anti-consumer stuff, most storage(ssd/hdd) vendors hiding details or downgrading models silently to save money at consumer cost. Nvidia is still getting hate for the price increases of their GPUs, and doing other anti-comptetitive things using their dominance.
It’s not everyone but making a good choice isn’t always easy these days. Since the post mentioned brands, I’d rather hear which brsnd is doing good rather than just a “the market in general is good”.
Quick google shows that Kanban is a method. Mainlu around picking up things as the come, but also limiting how much can happen at once.
The project I’m has a team that uses Kanban for the “Maintenance” tasks/development, take what is at the top of the board and do it. Adapt if higher priority things comes around, such as prod bugs. Our developments teams are trying to implement Scrum, where interruptions are to be avoided if possible during sprints. You plan a sprint, try to do that work, and can present it, and iterate when users inevitably changes criteria.
In the meme, kanban does somewhat make sense, since getting armrests is never going to get a high priority as part of building a rocket. Scrum isn’t exactly right, but I can see where it’s coming from. They are all agile methods though.
I kinda get where he is coming for though. AI is being crammed into everything, and especially in things where they are not currently suited to be.
After learning about Machine learning, you kind realize that unlike “regular programs” that ML gives you “roughly what you want” answers. Approximations really. This is all fine and good for generating images for example, because minor details being off of what you wanted probably isn’t too bad. A chat bot itself isn’t wrong here, because there are many ways to say the same thing. The important thing is that there is a definite step after that where you evaluate the result. In simpler ML you can even figure out the specifics of the process, but for the most part we evaluate what the LLM said or if the image is accurate to our expectations. But we can’t control or constrain the output to exactly our needs, because our restrictions largely are just input in a almost finished approximation engine.
The problem is, that companies take these approximation engines, put them in their product and consider their output fact. Like Ai chatbots doing customer support, and make up facts like the user that was told about rules that didn’t exist for an airline, or the search engines that parrot jokes or harmful advice. Sure you and I might realize that these things come from a machine that doesn’t actually think about it’s answers, but others don’t. And throwing a “*this might be wrong because its AI” on it is not an acceptable waiver of accountability.
Despite this, I use chatgpt and gemini a lot to help me program, they get a lot of things wrong but also do great. It’s a great tool, exactly because I step in after the approximation step, review and decide. I’m aware of the limits. But putting these things in front of “users” without a review step means you are advertising that you are either unaware of this flaw, or just see the cost-benefit analysis and see that if noting else it’ll generate interest during the hype.
There is a huge potential, but throwing AI into a situation where facts are needed when it’s only making rough guesses, is the wrong way about it.
Completely true, but also compression can make anything bad. I’ve seen 480p better 1080p simply because the 480p was using more bitrate, where the 1080p is encoded without enough relatively speaking.
Working on a blog(entirely for fun), found out the server backend, actix-web, does not handle early termination of a stream well. Wanted to stop an upload if the file size turned out to be too large, but you have to consume the entire upload before returning an error. If not the client will never see the connection close. I guess there is a way to check the size beforehand, but sucks that you can’t stop a stream in progress.
Apparently a long standing issue.
I use phone every day at office so I don’t need to get the wallet out of my jacket when going to the canteen to buy lunch. It’s literally the reason I started using my phone to pay. Too many times I forgot my card…
A lot of external drives are just internal devices with another controller and casing around. I had a 4TB I used with my laptop, and tore apart the casing and just plugged it into my desktop when I built one. Unless you start hammering the external case around, the drive will be fine.
Skimmed comments, but if you download and manage your music on your own on a machine you can have a super simple setup like I do. All music is synced using Syncthing to my phone. So my phone gets local storage, and then I use Poweramp (android) to play it.
I pretty much have a folder for all the music though. But I assume you can sort music into folders to have them as playlists. But perhaps not as practical as desired.