Without going into too much detail, my thesis was criticised for developing a web service with C++. I It was questioned why I didn't use #NodeJS or #Java for the web service. "It's not performance critical" said the professor.
Dude, have you used the internet lately?
EVERYTHING is performance critical!
This sort of teaching explains why most aps/websites run like absolute dogshit.
I want to take a moment to talk about code #accessibility. Like How accessible your source code is for your fellow #programming
Practically speaking I count as a "Low vision" user. My need for larger fonts means that lines wrap earlier for me than most users. Wrapping sucks, so when i write code I typically use 80 characters as an upper limit to width. There are computing history reasons for 80 but it also just works.
Here's some hard truth about C - It's not going away. It's not that it's perfect, but it is immensely portable and useful. More importantly, no other #programming language has come close to its ubiquity. I'm not saying other languages don't do some things better (they definitely do!), but we're going to be stuck with C for a while yet.
⭐ What programming language do you use most of your life? Why exactly?
Most of my time I worked with almost the entire .Net stack, and in recent years it's Unity, so my language is C#
There were episodes in my life with mobile, many web stuff, java, c++, databases, etc.
In #embedded software, the #C#programming language rules—and for many good reasons, too. I have loved C for more than four decades. But I admit that C is woefully dated, inherently unsafe, and imposes a high cognitive load upon the #programmer.
Newer languages vying to knock C off its perch—Rust, Nim, Zig, Odin, etc.—are overly cute and complicated to suit the real-time, embedded work.
The embedded sector needs a new language with C's simplicity, efficiency, semantics, and determinism and Haskell's safety, effectiveness, syntax, and dash.
Comprehensions are currently compiled as nested functions, which provides isolation of the comprehension’s iteration variable, but is inefficient at runtime. This PEP proposes to inline list, dictionary, and set comprehensions into the code where they are defined, and provide the expected isolation by pushing/popping clashing locals on the stack.
Last: F Strings will support some common use cases that broke interpolation in the past, like f'{ myDict['myKey'] }' and f"{'n'.join(a)}"
When you've spent hours writing a lot of code, and you figure out that most of it doesn't work they way you'd though together with the rest of the code base, so you revert most of it and are left with a small chunk of useful stuff ...
I am once again considering to write my own window manager
...unless the setup I am thinking of is already possible, let me construct this in your head:
On the top of the screen, there is narrow status bar, which is split into two parts. On the right side of the bar, you have your clock, your battery, your signal strength and so on.
On the left side, there is a clickable tab for every window you have opened. It's like browser tabs: Every window always uses the entire space below the status bar.
On the far left, there could be an icon which opens a searchable list of applications, kind of like #dmenu but vertical. Everything supports mouse input as you would expect.
Does that exist? Should I make it? It would be awesome for smaller screens, like phones.
Edit: I should add that I'm planning to run it on a Nokia N900 with a single 600 MHz CPU core, 256 MB RAM and a resolution of 800×480 pixels. Existing full desktop environments like Xfce4, LXDE, and so on are way to heavy to run.
I'm curious to hear if anyone has successful strategies for debugging shader compile time issues (specifically #GLSL in #Vulkan in my case but still interested in hearing about others).
I've got this shader that takes over a minute to compile. There's various things I could do to prevent loop unrolling etc. but I still have to use trial and error to find the right place.
Do you have any better strategy than changing random places and seeing what makes a difference?
I've been working a lot with #glsl for a while now, writing complex code. Overall, I feel like the single improvement that would make the most difference for the language would be support for pass-by-reference instead of copy in/copy out syntax, as suggested here https://github.com/KhronosGroup/GLSL/issues/84
This would make it possible to do a lot of things that are either not possible or ridiculously inefficient to compile, including object oriented programming.
Please help #Coding question 🖥️
I am trying to install #Mountainsort (4) on Windows (10) (I know, I know).
It works on one of my Win10 computers, but doesn’t on any other ones that I’m trying to install this on.
When running ‘pip install mountainsort4’ I get this error: “command ‘some_path_on_my_comp\cl.exe’ failed with exit code 2”
I also get this error: " C:\some_path\Local\Temp\pip-install-kykt_efl\isosplit5_3fce77eb41cf47b4a1d4ca22afae35a2\src\isocut5.h(19): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory"
I have googled this to death and tried everything and it just won’t fix itself. The cl.exe path exists. I added it to the environment variables (but maybe not properly?). It’s a Visual Studio function.
Seen this before? Any suggestions? 🙏 #Python#Programming
Edit (and thank you for all answers so far!):
I have tried running it in the visual studio console, it shows the same error.
I have tried running it in as administrator, same error..
I have tried replicating the conda environment from the computer that works onto the others, but it comes up with the same errors as when I install manually. The only detectable difference is that the working install has an older version of conda / anaconda.
I asked the repo owner and they said to use it on Linux (or using the windows subsystem for Linux), but I’d like to try and keep things as simple as possible (both for me and other users), and this is NOT simple. I know it can work on Win10 so I just want to replicate that.
Edit 2: I reinstalled Visual Studio stuff using these instructions
NOW I do not get the error about the missing stdlib.h anymore, and I can actually install isosplit5 which is a dependency of mountainsort, BUT - when I go back to running pip install mountainsort4 it now has new errors! (progress?) They look like syntax errors as described in this issue and they still end in the cl.exe error. At the end it said that it did build mountainsort4 but not isosplit5 and when I try to actually run mountainsort functions they say it's not installed. so Fail.
Edit 4: Am I just using the 'wrong' version of those Visual Studio functions for the code? Like the code has not been adapted to current versions? But how can I know which version the code wants?
Edit 5: if I manage to install isosplit5... why does mountainsort try to 'build the wheels for isosplit5'? Is there a way to tell it to use the one that is already installed?
Edit 6 (Aug 15): I tried my pipeline in the Windows Subsystem for Linux. It had a C++ problem at first, but it worked after I ran sudo apt install build-essential.
Anyone knows about an equivalent to that instruction in Windows?
I think that would fix my problem... if it exists
Ya know the more I reflect on the languages I know the more I realize that outside of functional languages none of them really handle immutability well.
Consider that you want most of your objects to be immutable most of the time. Thats all well and good till you realize you want to be able to edit the objects in such a way that it creates duplicates that have some data changed but are likewise immutable.
This tends to stop working, almost entierly, once you get into subclassing. If you parent class has a method that returns a copy of itself with some data modified, this will break in children classes, since you want children classes to return instances of itself, not its parent.
Its not that you cant fix that, but the code gets very ugly very quickly. Generally you are forced to let the code handling the classes do the copying and editing itself, but that is pretty ugly too.
I have had this pattern problem in almost every OO language i messed with, Java, Ruby, Python, etc.