Yes. It filters midwits and Black folk alike. The OOP part is the most beautifully designed thing you'll ever see in programming. It allows you to write beautiful solutions. Modern features allow you to simplify otherwise painful tasks. But you don't absolutely have to use them, you can stick to the old way and still succeed. It's pure freedom. This is the only language that satisfies my autism.
>std:: >std::
Just fricking use a use directive. No, importing the std namespace will not cause problems 99% of the time as long as you don't do it at global scope in header files.
2 years ago
Anonymous
B-but my professor told me not to!
2 years ago
Anonymous
That's because your fricking professor has never had to join a company with a legacy codebase and have to read through 1000 lines of bullshit like this
Tldr he's a tard
2 years ago
Anonymous
using namespace std is banned in my company's code. there actually are good reasons to forbid it especially with libc interop and math libraries, but at minimum, making obvious where you are using STL types and functions helps comprehension of an already complex language.
we do allow "using std::vector" and other explicit using directives, as well as chrono_literals and string_literals namespaces
2 years ago
Anonymous
>getting this upset over 5 chars
lmao what a frickin moron
Meanwhile, in a proper language
fn main() {
let words = "Hello-_-Rust-_-1.0-_-!";
for w in words.split("-_-") {
print!("{} ", w);
}
}
2 years ago
Anonymous
How do you split a generic iterator?
template<class A, class B>
void foo(const A& iter, B&& delim) {
for (auto&& x : iter | split(delim)) {
for (auto&& y : x) {
cout << format("{}", y);
}
cout << ' ';
}
cout << 'n';
}
int main() {
foo("Hello-_-C++-_-20-_-!"s, "-_-"s);
foo(vector{ 1,2,3,1,2,3 }, 2); // Prints 1 31 3
}
It's the only way that's in the standard library, besides strtok (yuck) or implementing it yourself.
Boost has something because of course it does but it makes a vector of string instead of an iterator of range, meaning at least n+1 allocations instead of zero. That and it's still ugly.
It is highly based. I no longer work in it and make way more money as a result but I still long for C++. It’s so fricking sick when you know how to use it. C++ will make you understand hardware, OS, build systems, compilers, the nature of computing. Everything.
It is, but hate learning data structures and algorithms on it. Anyone got a decent book + videos on this? I need to cover sorting algorithms, linked lists, their kinds and applications and hash tables. Also trees/graphs. Shit I can do in python easily here is pain. I literally feel like I am in a x10 gravity chamber wtf. Help.
it makes everyone seethe
I guess that makes it based
tons of legacy make it almost impossible to use 100% correctly
i say rust is the answer. it's what c++ would be had it been writtenin in the XXI century + some safety on top
>some safety on top
Safety scissors are for morons and those that don't know what they're doing.
that would be HolyC
What's the name of the browser? It looks extra lightweight.
It's just called Web, it's meant to integrate into the existing DolDoc stack paradigm (Term, Menu, etc.)
https://git.checksum.fail/alec/Web
Thanks.
Make a HolyC tutorial anon I beg you. Share your wisdom with us!
Looks comfy
nah
C
nah gays love that shit but no one likes C++
we cross ways on what we consider based so let's end this here
alright
even Bjarne knows that it is an abomination
make way comin through
Yes. It filters midwits and Black folk alike. The OOP part is the most beautifully designed thing you'll ever see in programming. It allows you to write beautiful solutions. Modern features allow you to simplify otherwise painful tasks. But you don't absolutely have to use them, you can stick to the old way and still succeed. It's pure freedom. This is the only language that satisfies my autism.
this
Yet it can't split a string.
Lies
#include <iostream>
#include <iomanip>
#include <ranges>
#include <string_view>
int main() {
constexpr std::string_view words{"Hello-_-C++-_-20-_-!"};
constexpr std::string_view delim{"-_-"};
for (const auto word : std::views::split(words, delim)) {
std::cout << std::quoted(std::string_view(word.begin(), word.end(*~~ << ' ';
}
}
It tickles me fancy when people dont add a single, simple line of code and prefer to litter the whole code with std::
Not him but in .h files (which, in your defense, that is clearly not) you can't do that
tickles me the wrong way, fricking tired
>std::
>std::
Just fricking use a use directive. No, importing the std namespace will not cause problems 99% of the time as long as you don't do it at global scope in header files.
B-but my professor told me not to!
That's because your fricking professor has never had to join a company with a legacy codebase and have to read through 1000 lines of bullshit like this
Tldr he's a tard
using namespace std is banned in my company's code. there actually are good reasons to forbid it especially with libc interop and math libraries, but at minimum, making obvious where you are using STL types and functions helps comprehension of an already complex language.
we do allow "using std::vector" and other explicit using directives, as well as chrono_literals and string_literals namespaces
>getting this upset over 5 chars
lmao what a frickin moron
That is obviously not 5 chars, more like 30
>t. actual moron confirmed
1 2 3 4 5
s t d : :
dumbass
morons
Meanwhile, in a proper language
fn main() {
let words = "Hello-_-Rust-_-1.0-_-!";
for w in words.split("-_-") {
print!("{} ", w);
}
}
How do you split a generic iterator?
template<class A, class B>
void foo(const A& iter, B&& delim) {
for (auto&& x : iter | split(delim)) {
for (auto&& y : x) {
cout << format("{}", y);
}
cout << ' ';
}
cout << 'n';
}
int main() {
foo("Hello-_-C++-_-20-_-!"s, "-_-"s);
foo(vector{ 1,2,3,1,2,3 }, 2); // Prints 1 31 3
}
Pooped on
Is there really no better way than this for C++?
It's the only way that's in the standard library, besides strtok (yuck) or implementing it yourself.
Boost has something because of course it does but it makes a vector of string instead of an iterator of range, meaning at least n+1 allocations instead of zero. That and it's still ugly.
join/split = power
no join or split on that shit?
>The OOP part is the most beautifully designed thing you'll ever see in programming
lolnope
This.
yes, it's the most c based language there is i suppose.
Python with C bindings is
Who hurt your feelings today sepplestard?
It is highly based. I no longer work in it and make way more money as a result but I still long for C++. It’s so fricking sick when you know how to use it. C++ will make you understand hardware, OS, build systems, compilers, the nature of computing. Everything.
It is, but hate learning data structures and algorithms on it. Anyone got a decent book + videos on this? I need to cover sorting algorithms, linked lists, their kinds and applications and hash tables. Also trees/graphs. Shit I can do in python easily here is pain. I literally feel like I am in a x10 gravity chamber wtf. Help.
what are you, a college freshman? STL has all the things you need except DEFLATE and that's a single library call away.
Wrap everything in unique_ptr and it's basically the same as Python.
Except linked lists and graphs, where you need to think about ownership.
Based on what?
>most based programming language
that would be C