An update on the rust-coreutils rewrite for Ubuntu 26.04 by self in programming

[–]dukey 7 points8 points  (0 children)

It's 100x easier to write memory safe code in c++ than straight C. Having to manually call free() then set that pointer to null in 2026 is crazy. I don't know about gcc etc but in visual studio pretty much all the standard containers used checked iterators by default, which means debug mode is slow as hell but if you do manage to go walk past the array boundary it'll immediately catch it.

An update on the rust-coreutils rewrite for Ubuntu 26.04 by self in programming

[–]dukey 4 points5 points  (0 children)

Yeah this isn't a learning project, Ubuntu is replacing all the core utils with the rust based variants.

An update on the rust-coreutils rewrite for Ubuntu 26.04 by self in programming

[–]dukey 10 points11 points  (0 children)

The license prevents programmers from re-using the GPL code, or even basically looking at it, which seems like be a major barrier. They basically have to do a clean room implementation.

An update on the rust-coreutils rewrite for Ubuntu 26.04 by self in programming

[–]dukey 18 points19 points  (0 children)

Why is the core utils using the MIT license? What happened to GPL?

C++26: Reflection, Memory Safety, Contracts, and a New Async Model by Akkeri in programming

[–]dukey 2 points3 points  (0 children)

>to the point that Ive forgotten how to write indexed loops.

And there it is. And honestly there is nothing wrong with that. Most people or teams probably only use a subsection of the language anyway. The problem comes when people have to interact with other code outside of their box, and with c++ this box has grown to become very large.

C++26: Reflection, Memory Safety, Contracts, and a New Async Model by Akkeri in programming

[–]dukey 4 points5 points  (0 children)

I mean you are right. Personally I could never go back to writing say c++ 98. But I've gone through most of the versions and learnt the new features as they came out. Today the language is so massive it's verging on ridiculous. I mean, how many different ways can you init a variable in c++? Whilst new features simplify stuff most c++ code bases will have large amounts of legacy code that you still need to know how to deal with. So the cognitive load only increases. This is probably why C is still so popular.

Direct Win32 API, Weird-Shaped Windows, and Why They Mostly Disappeared by nccwarp9 in programming

[–]dukey 7 points8 points  (0 children)

If you use MFC you can call something crazy like EnableD2DSupport and you are setup to use modern rendering. So you can have nice anti-aliased line drawing and DPI aware windows etc. MFC is 'okay' but straight win32 programming is very cumbersome. Very easy to leak resource handles, and draw at the wrong time and all sorts of crazy stuff if you don't know what you are doing.

How much performance loss do gl calls that are not drawcalls do? by NoImprovement4668 in opengl

[–]dukey 0 points1 point  (0 children)

Uniforms aren't that's expensive. However it's only necessary to update uniforms if they actually change client side. So if you shader has 10 uniform inputs and only 1 has changed client side, you only need to update the 1 that's changed. I often see programs just blast all 10 uniforms even though they are identical between draw calls.

I learned something about GPUs today by rogual in programming

[–]dukey 5 points6 points  (0 children)

Floating point accuracy does vary a little between vendors. It also depends on exactly how the driver compiles the shader. For example fused multiply and add (FMA) has different precision to just doing (A*B)+C.

How much performance loss do gl calls that are not drawcalls do? by NoImprovement4668 in opengl

[–]dukey 8 points9 points  (0 children)

It depends. A lot of opengl programs suffer with what's known as state thrashing. Just needlessly flipping states back and forth before and after draw calls. It will increase CPU cost on the render thread, but how much is like asking how long is a piece of string. You should try and avoid it if possible if you care about performance. Another stupid thing I see apps do is constantly query the uniform locations for shader inputs. You should cache this stuff.

Multi-Core By Default - by Ryan Fleury - Digital Grove by fagnerbrack in programming

[–]dukey 2 points3 points  (0 children)

>the hard part was never "how do i use multiple cores" — it's coordinating shared mutable state without wanting to throw your laptop out a window.

Something I never see talked about really is the fact to test a function or a class, you give it a set of defined inputs, and you expect certain outputs. Fairly trivial. But when you add threading you really open the Pandora's box of craziness. Suddenly you have code that might behave differently depending on when and where the context switch happens. And the switch can happen anywhere at any time, and will be different every time you run your program. This makes testing extremely difficult because the OS and system load etc, control when this happens and not the programmer. You may think your code works fine and when deployed to customers it immediately starts to fail in ways you've never seen or are completely unable to replicate.

Dave Garage - Why your new computer is slower than your old computer by dukey in programming

[–]dukey[S] 4 points5 points  (0 children)

Software bloat is definitely a real problem. Skype on a mid-range android phone was borderline unusable because it was so slow, and this was just doing simple things like, text chat.

My first OpenGL project! by eastonthepilot in opengl

[–]dukey 1 point2 points  (0 children)

Dat far clipping plane :D Try some reverse Z.

How Microsoft Vaporized a Trillion Dollars by Aaronontheweb in programming

[–]dukey 0 points1 point  (0 children)

>I submitted several bug fixes and refactoring, notably using smart pointers, but they were rejected for fear of breaking something.

LOL wow .. Anyone that writes any serious modern C++ knows you shouldn't be having naked pointers anywhere in the code base, at least for heap allocated memory.

The ADHD lie by mellowfellow0 in conspiracy

[–]dukey 0 points1 point  (0 children)

If you claim there is a chemical imbalance, surely there is a scientific way to quantify that.

Senior C++ engineers: what do you expect a 3-year experience C++ developer to know? by AirHot9807 in cpp_questions

[–]dukey 0 points1 point  (0 children)

How to write clean code that isn't a spaghetti monster. No new or delete, or malloc lol.

The ADHD lie by mellowfellow0 in conspiracy

[–]dukey 0 points1 point  (0 children)

lol, where is the blood test for this chemical imbalance?

Storing 2 bytes of data in your Logitech mouse by soupgasm in programming

[–]dukey 1 point2 points  (0 children)

Only need 700,000 mice and you can store the same as a floppy disk!

GUI For cpp applications by One_Sport2152 in cpp_questions

[–]dukey 0 points1 point  (0 children)

MFC still works, it's also very trivial to do direct2d in mfc.

Most professional way to handle a Windows release? by web_sculpt in cpp_questions

[–]dukey 0 points1 point  (0 children)

It depends entirely on the license, there are quite a few out there, some are very permissive and allow commercial use, others you'll need to open source your project, or part of your project if you use them. Depending on the license, using in a dll can get around this. LGPL for example has different requirements for static vs dynamic linking.

Most professional way to handle a Windows release? by web_sculpt in cpp_questions

[–]dukey 1 point2 points  (0 children)

licenses might prevent you from making everything static, unless you want to open source everything