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 still find it amazing people believe the same constant child like lying.

Everyone says... A close friend of mine said... A professor said... Everyone knows...

...That I have the bestest (health/speech/IQ/humbleness/big hands)

[-] BehindTheBarrier@programming.dev 24 points 3 days ago* (last edited 3 days ago)

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 FormattedUsers, 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 Users.

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.

It's not the fart (speed) that kills you it's the smell (crash). A Norwegian English joke.

Looks very Norwegian, and there seems to be a crossing on the road used to prevent sheep from leaving the area (while cars still can drive over it) which is also something we have in Norway.

[-] BehindTheBarrier@programming.dev 26 points 1 month ago

I'm not sure if many children = bad in the comic, or if it is more nuanced.

But triplets fight on average a lot more, and imagine 3 mini Everett Trues going et eachother! I'd jump out the window too.

27

Some background, I work full stack while we also man the support email from users. I'm manning the support email this week, but today I was also tech support for a fellow developer.

We use HP docks to connect everything from screens to keyboards. But today a dock would not do anything when my colleague attempted to use it.

Being the nosy kind, I went and asked the usual

  • Did you reboot?
  • Did you remove the power to the dock?
  • Try messing with the drivers?
  • lock the screen before unplugging?
  • Tried another dock?

All yes, none worked. Our IT support hadn't opened for the day yet and he was looking into updating the specific dock driver.

So I asked, did you try the other USB-C port? And what do you know, that worked. Then he just plugged right back into the first USB-C port and everything was back to normal. I don't know who made the drivers, but it's pretty danning when they can brick a specific USB port until it's forced to redo whatever config that messes it up, by using another USB port...

If anyone wonders, the docks have a magnetically joined charging and USB plug, so it's fairly natural to plug them in together side by side. It's also almost uniquely a dock issue and not a dead USB port, so it's funny that the enite thing uncloggs from just using another port for a second. But a reboot does not...

[-] BehindTheBarrier@programming.dev 24 points 1 month ago* (last edited 1 month ago)

Everyowkring from home and access to on-site locations are limited, imagine the chaos of everyone at their office having to travel to IT to fix their PC, or IT traveling to locations with problems while trying to maintain isolation rules.

[-] BehindTheBarrier@programming.dev 47 points 4 months ago

Not to completely spring to IKEAs defense here, but I heard they really were affected by production and shipping problems during covid. It's reasonable prices would go up, and at least good that they are going down again.

[-] BehindTheBarrier@programming.dev 25 points 5 months ago

I don't think shorts are bad, but they aren't the reason I go to YouTube at all. They are just in the way.

[-] BehindTheBarrier@programming.dev 37 points 5 months ago

Why wait and hope for C++ to get where modern languages are now? I know there's value in the shared experience in C++ that if adapted would make it stronger, but I can only see a development of C++ having to force a drop of a lot of outdated stuff to even get started on being more suitable.

But the language is just not comfortable to me. From large amounts of anything creating undefined behavior, the god awful header files which I hate with a passion, tough error messages and such. I also met a fun collision of C++ in Visual Studio and using it with CMake in CLion.

I've just started looking at rust for fun, and outside not understanding all the errors messages with the bounded stuff yet, figuring out what type of string I should use or pass, and the slow climb up the skill curve, it's pretty nice. Installing stuff is as easy as copy pasting the name into the cargo file!

Rust is just the prospective replacement of C++ though, people act like the White house said that C++ should be replaced by rust now. But the just recommend it and other languages, C# will do for a lot of people that does not need the performance and detail that the aforementioned languages target. Python is targeting a whole different use, but often combined with the faster ones.

C++ will live a long time, and if the popularity dies down it will surely be very profitable to be a developer on the critical systems that use it many years from now. I just don't think an evolution of C++ is going to bring what the world needs, particularly because of the large amount of existing memory related security vulnerabilities. If things were good as they are now, this recommendation would not be made to begin with.

This is also the reason I'm all open source. Not just games, but seeing someone abandon a program hurts. Or just wanting to make a change on your own to suit your needs. I don't have any big fancy programs, but I at least put my code openly on github.com for that reason. Both my "big" ones are just me using another program and realizing I could make something that worked better for me. At like 100x the time investment, but programming is fun.

21
submitted 1 year ago* (last edited 1 year ago) by BehindTheBarrier@programming.dev to c/rust@programming.dev

I'm super new to Rust, like a day old really.

But I tried a program made in Rust on Windows, and it refuses to work.

Never prints anything. Just straight up instantly dead. Long story short, this thing relies on some linked stuff like ffmpeg in some form. So, I did my best trying to gather all the things it needs per github issues, reddit and other souces. And the end result was that it now spent 0.1 s longer before crashing, actually leaving time for some error in the Windows Event log. Nothing useful there either as far as I can see.

So I clone the repo and get the required things to compile Rust, and I managed to build it from source at least. The executable doesn't run, but the Run in VS Code works, somehow. It prints the error messages corresponding to missing input. So i try to debug it, but nothing happens. No breakpoint is hit, and nothing is printed in the terminal, unlike when using Run or cargo Run. I can also just strip out everything it does in the file the main function is in, and it will hit breakpoints. But that didn't help me find out what is missing/broken though.

So what the difference, is there a way to catch and prevent Rust from just going silent, and actually tell you what dependencies it failed to load?

My entire reason for getting it running locally is to fix that. Because no one sane wants to deal with a program that doesn't tell you why it will not run... And when debugging also does nothing... I'm out of ideas.

The program is called Av1an for reference, and it's a video encoding tool. I used a python version before they migrated to Rust, and wanted to give it a try again.

Edit: Wrote linked library, but i think the proper term is dynamic libraries. I'm really not good with compiled programs.

Update: Figured it out. Had to copy the out files from the ffmpeg compiled stuff back to the executable. Apparently Cargo Run includes that location when looing for the files, while running from the command line clearly doesn't.

But the biggest whiplash, was that I got a full windows dialog popup when i tried to in the exectuable in CMD instead of Powershell. Told me the exact file I was missing too. I know PowerShell is a bitch when piping stuff, but I'm amazed no other program or error message could hand me that vital information. Fuck me, I wish I had tried that from the start....

view more: next ›

BehindTheBarrier

joined 1 year ago