What are you working on, Jow Forums?
Old thread:
What are you working on, Jow Forums?
Old thread:
Tell me things about programming complexity /dpt/.
Opinions, techniques, advice, whatever.
Should you be considering big o during the design phase? Do you prioritize the CPU or human maintainers? Is there anything you can do to improve yourself in this area (data structures and algorithms books, project design lessons, etc.)?
I'm going to bed but will read this tomorrow.
What's a good lang for embedded besides C?
C is pretty much the onlu universal embedded lang. You could try assembly, but it's pointless having C.
everyone except me is retarded and i can prove it programmatically
I bet it's Forth.
Literally nothing. (I was going to say "the target machine's assembly", but I doubt you'd be interested in that if you're looking for alternatives to C.)
Is this the true power of C++?
template
requires std::is_arithmetic_v T sqrt(const T &Number) noexcept[[
expects:Number >= 0]][[ensures Ret:Ret >= 0 && Ret < Number]] override final
noexcept {}
omfg i was like an hour debugging whhy i couldnt change an unordered_map inside a function. Turns out i had a const hidden in my function.
Jesus christ why cant they say like hey you cant edit this shit nigga ur in a const function.
Complexity is important to consider but make sure you benchmark and consider your requirements too. An O(n) algorithm with a huge constant factor could be a worse choice than an O(n^2) algorithm with a small constant factor if your input data is always small. Caching and read patterns matter too. Linear search might be faster if you can pull all the data into a single cache line than binary search if the nodes are fragmented all over the heap.