Komunitas
piefed.social
At my final tech job, they were gearing up to fire me, and so they gave me the task of writing unit tests for a golang-based k8s deployer that was somewhere around 700k lines. They specifically told me to use Copilot for it, and for just about every function I tried to unit test, it tried to make sure that .onclick() was still working. Yeah they ended up firing me.
Komunitas
lemmy.bestiver.se
Comments
Komunitas
lemmy.world
Much of Mozilla’s revenue comes from Google, of course. This couldn’t be because Rust was, and is, outshining Google’s GoLang? Surely not? This article is so stupid. I’ve been following blog posts and such back then and even though nobody spelled it out, there was conflict between the Servo and Gecko camps at Mozilla. The C++ Gecko developers were afraid that they were about to be made obsolete by the Servo team. You can easily see this that this camp spread the idea that Servo was never ever meant to be a production engine, only a research playroom but OTOH a Firefox-branded VR browser fully based on Servo was slated to come out not too far after the layoffs happened (IIRC the roadmap stated a year later). The claim of Servo having been only for research and the roadmap of a production-quality Servo-only Firefox release are obviously at odds. Here’s the roadmap: https://github.com/servo/servo/wiki/Roadmap/c8c1a2fbee9fd3ea6e01943db96825516f8478e8 (“Our 2020 goals for Servo - especially the Mozilla staff - are aligned with the Mixed Reality efforts at Mozilla: Release a public Firefox Reality application to the Windows Store that is built on Servo and works with any Windows Mixed Reality headset, focused on delivering high quality immersive web experiences”)
Komunitas
lemmy.world
Also, like, fuck golang, it’s such a shit language and the compiler does very little to protect you I never understood why people like it. It’s a “new” language, and it still doesn’t seem to get the basics right. No proper null handling, and don’t get me started on interface{}. It’s like they set out to build a better alternative to C++ while ignoring the other developments outside C/C++ for the past 15 years. The compiler is damn quick, though.
Komunitas
lemmy.sdf.org
The program go is not installed. Install it by executing: pkg install golang
Komunitas
lemmy.max-p.me
It’s nicknamed the autohell tools for a reason. It’s neat but most of its functionality is completely useless to most people. The autotools are so old I think they even predate Linux itself, so it’s designed for portability between UNIXes of the time, so it checks the compiler’s capabilities and supported features and tries to find paths. That also wildly predate package managers, so they were the official way to install things so there was also a need to make sure to check for dependencies, find dependencies, and all that stuff. Nowadays you might as well just want to write a PKGBUILD if you want to install it, or a Dockerfile. Just no need to check for 99% of the stuff the autotools check. Everything it checks for has probably been standard compiler features for at least the last decade, and the package manager can ensure you have the build dependencies present. Ultimately you eventually end up generating a Makefile via M4 macros through that whole process, so the Makefiles that get generated look as good as any other generated Makefiles from the likes of CMake and Meson. So you might as well just go for your hand written Makefile, and use a better tool when it’s time to generate a Makefile. (If only c++ build systems caught up to Golang lol) At least it’s not node_modules
Komunitas
lemmy.ml
Me too. I just ran time tree across my home directory a few times. Native console (ie C-A-F3) - 54 seconds, Konsole - eight seconds. Waveterm is still installing (Arch AUR). The fan has a Gentooesque sound to it as a suspiciously complicated thing gets built. Oh God … electon … terminal shaking … golang … fans whining … lap melting … the Old Ones are stirring. The deps for this thing are many. " I watched Firefox builds on Gentoo glitter in the dark near the Tannhäuser Gate". OK, its now arrived and my laptop case is making ping noises as it cools. It takes 10 seconds or so to start up. Look pretty. Accept license agreement (wtf). Now what? Hmm lets try typing in that box. OK. time tree. Go back to Lemmy to type the last two paras of this comment, get bored and uninstall waveterm.
Komunitas
programming.dev
I’m sorry - I understand it’s free, but this is how I feel: Nextcloud stopped being a fast, reliable file sync tool a long time ago (I mean - was it ever? it’s free thats why most people use it). It’s become a bloated “groupware suite” full of useless Talk, Groupware, AI, and half-finished apps… while the core sync still chokes on large folders and locks files like it’s 2015. The Core Problem PHP-FPM and mod_php are ancient architectures - every request spins up, runs, and dies. No persistent memory, no connection reuse, and no async I/O, no coroutines, slow as molasses non scalable backend held together only with redis. Result: slow UI, slow sync, race conditions, and constant errors. Tons of open GitHub issues about sync bugs, upgrades, and no action from nextcloud. I’m sick of it. I’m done with it and I will be very direct about it. Comments and issues and proposed classical PHP solutions are shocking: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#configuring-your-web-server Nextcloud suggests you up its ram to 16Gb. 16Gb Carl! php_value upload_max_filesize 16G php_value post_max_size 16G What about 17Gb files Nextcloud? nogo? don’t use nextcloud then? Have you ever heard of TUS? opencloud can run circles around nextcloud now - it is written in GO, much better architecturally, long running, uses connection pooling, does not need redis to survive. What they (nextcloud) should do: Hyperf + Swoole Swoole turns PHP into a high-performance async server - persistent memory, connection pooling, non-blocking I/O. Hyperf+swoole - can rival GOlang. Hyperf builds on it: native WebSockets, coroutine HTTP, and microservice-ready architecture. You get live sync, push notifications, and massive concurrency with a fraction of the resource cost. Add TUS (resumable uploads) and you finally have reliable file transfer on bad connections. I don’t want bloat. I want reliable sync that just works. I’d rather self-host a lean, fast sync app than manage ten half-integrated apps. They need to switch to Hyperf + Swoole - and bring Dropbox-level sync to self-hosting without the pain. Nextcloud could fix its image by: Refocusing on sync reliability and performance. Moving core services to a persistent, async engine (Swoole / hyperf, etc). Making “Nextcloud Core” modular - separate entirely from the groupware/ai/talk - I don’t fucking need it. Until then, those who care about speed, concurrency, and modern PHP should look beyond the old PHP-FPM world. Im not the only person - people are sick of this inaction:
Komunitas
lemm.ee
This is exactly the point made in this 2010 article that’s probably one of the things I link to most often in online discussions. https://whatheco.de/2010/12/07/function-hell/ Also, the real problem with code on the right in OP is all the state mutations made to the arguments passed into the functions. Not too familiar with golang, but this really could use some sort of builder pattern or something, if you’re going to mutate the object. Or a more functional style with just a pure function mapping an input “order” to output “toppings”, etc. There are plenty of ways to make the bad design on the right better without stuffing everything into a single function, so the whole premise is a bit of a false dichotomy.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
lemmy.world
After selfhosting dozens of applications myself I am looking forward to giving something back to the community. I wanted a way to manage both my professional and personal relationships better. Especially with kids around it feels difficult to keep up with everyone’s birthdays, diets, events and whatnot . Originally I used Monica but development has stalled since quite a while and the new version was a fair bit more complex than I needed. So over the last many months I built my own solution. What it can do: You can add contacts (even with custom fields), relationships, reminders, activities and notes. Optionally you can also activate the CardDav server to sync contacts to and from your phone. What it cannot do: There is no platform sync with LinkedIn/E-Mail/Messengers and there are no AI functionalities (neither is currently planned). As of now there is no native iOS/Android app, using the page on mobile works fine for me so far. Development and use of AI: This app is not vibe coded. I do use AI assistants for programming support but code is either authored or reviewed by me (which is definitely required). I used golang for the backend (such a great language), the frontend is react. After a PR on github E2E tests are run, for each tag docker containers are built and available. Demo and links: You can try a demo here: https://meerkat-crm-demo.fly.dev/ (login with username demo and password test_12345). The demo starts on demand so it might take a couple seconds to load. Data is shared but resets as soon as the demo goes idle. Repository: https://github.com/fbuchner/meerkat-crm (the README has a screengrab to give you an impression) I am an avid user of the app myself and excited to open it up to the community now. Please be kind, I’ve been working on this for quite a while but it is my first open source project at this scale.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
programming.dev
As the title says, it’s a rather simple golang script for creating memories in Immich based on certain criteria, since there aren’t any customization options in the official app. As you may gather from the README, I created this for very personal reasons. But I wanted to share it here in case someone else finds it useful as well. Currently it can do filtering based on people, and tags. But I’m more than happy to add more options, if requested.
Komunitas
lemmy.ml
Lihat kiriman asli pada platform media sosial terkait.
Komunitas
sh.itjust.works
Yeah, insisting on things like a variable being used will result in people using work arounds. It won’t result in people not doing it. Then, because people trust the language to police this rule, the work-arounds and debug code will get committed. func main() { test := true } Oops, golang doesn’t like that. func main() { test := true _ = test } Perfectly cromulent code. If they really wanted to avoid people having unused variables, they should have used a naming convention. Any variable not prefixed by “_” or “_debug_” or whatever has to be used, for example. Then block any code being checked in that still contains those markers.
Komunitas
programming.dev
Big refactorings are a bad idea. IMO what is worst then big refactors are when people refactor and change behavior at the same time. A refactor means you change the code without changing its behavior. When you end up mixing these up it becomes very hard to tell if a behavioral change is intended or a new bug. When you keep the behavior the same then it is easier to spot an accidental change in behavior in what otherwise should be a no-op change. And if you can, try to keep your refactors to one type of change. I have done and seen many 100 or even 1000s of lines changed in a refactor - but was kept manageable because it was the same basic pattern changing across a whole code base. For instance. Say you want to change logging libraries, or introduce one from simple print statements. It is best to add the new library first, maybe with a few example uses in one PR. Then do a bulk edit of all the instances (maybe per module or section of code for very large code bases) for simply switching log instances to the new library. If you don’t know what an API should look like, write the tests first as it’ll force you to think of the “customer” which in this case is you. I think there is some nuance here that is rarely ever talked about. When I see people trying this for the first time they often think you need to write a full test up front, then get frustrated as that is hard or they are not quite yet sure what they want to do yet. And quite often fall back to just writing the code first as they feel trying to write a test before they have a solid understanding of what they want is a waste. But - you don’t need to start with a complete test. Start as simple as you can. I quite often start with the hello world of tests - create a new test and assert false. Then see if the test fails as expected. That tells me I have my environment setup correctly and is a great place to start. Then if I am unsure exactly what I want to write, I start inside the test and call a function with a name that I think I want. No need for parameters or return types yet, just give the function a name. That will cause the code to fail to compile, so write a stub method/class to get things working again. Then start thinking about how the user will want to call it and refactor the test to add parameters or expect return types, flipping back to the implementation to get the code compiling again. You can use this to explore how you want the API to look as you are writing the client side and library side at the same time. You can just use the test as a way to see how the caller will call the code. No need to start with asserting behavior yet at all. I will even sometimes just debug print values in the test or implementation or even just write code in the test that calls into a third party library that I am new to to see how it works. With no intention that that test will even be included in the final PR - I just use tests as a staging ground to test ideas. Don’t feel like every test you write you need to keep. Sometimes I skip the testing framework altogether and just test the main binary in a simple situation. I especially do this for simpler binaries that are meant to mostly do one thing and dont really need a full testing framework. But I still do the red/green/refactor loop of TDD. I am just very loose on what I consider a valid “test”. The second time you’re introducing duplication (i.e., three copies), don’t. You should have enough data points to create a good enough abstraction. This missed one big caviat. The size of the code being duplicated. If it is only a few lines then don’t worry so much. 5 or even 10 copies of a 2 line change is not a big issue and quite often far harder to read and maintain then any attempt at de-duping it. As the amount of code you need to copy/paste grows though then it becomes more advantageous to abstract it with fewer copies. if you find yourself finding it difficult to mock I hate mocks. IMO they should be the last resort for testing things. They bake far too many assumptions about the code being mocked out and they do it for every test you write. IMO just test as much real behavior as you can. As long as your tests are fast and repeatable then you dont need to be mocking things out - especially internal behaviors. And when you do need to talk to an external service of some kind then I would start with a fake implementation of the service before a mock. A fake implementation is just a simple, likely in memory, implementation of the given API/interface/endpoints or whatever. With a mock you bake assumptions about the behavior into every mock you write - which is generally every test you write. If your assumptions are off then you need to find and refactor every test you have that has that assumption. With a fake implementation you just update the fake and you should not need to touch your tests. And you can write a fake once and use it on all your tests (or better yet use a third party one if one is available (for instance I quite often use goflakes3 - a golang in memory implementation for aws s3 service).