Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "c++ why obscure"
writing library code is hard.
there are sooo many details that go into writing good libraries:
designing intuitive and powerful apis
deciding good api option defaults, disallowing or warning for illegal operations
knowing when to throw, knowing when to warn/log
handling edge cases
having good code coverage with tests that doesn't suck shit, while ensuring thry don't take a hundred years to run
making the code easy to read, to maintain, robust
and also not vulnerable, which is probably the most overlooked quality.
"too many classes, too little classes"
the functions do too much it's hard to follow them
or the functions are so well abstracted, that every function has 1 line of code, resulting in code that is even harder to understand or debug (have fun drowning in those immense stack traces)
don't forget to be disciplined about the documentation.
most of these things are
deeply affected by the ecosystem, the tools of the language you're writing this in:
like 5 years ago I hated coding in nodejs, because I didn't know about linters, and now we have tools like eslint or babel, so it's more passable now
but now dealing with webpack/babel configs and plugins can literally obliterate your asshole.
some languages don't even have a stable line by line debugger (hard pass for me)
then there's also the several phases of the project:
you first conceive the idea, the api, and try to implement it, write some md's of usage examples.
as you do that, you iterate on the api, you notice that it could better, so you redesign it. once, twice, thrice.
so at that point you're spending days, weeks on this side project, and your boss is like "what the fuck are you doing right now?"
then, you reach fuckinnnnng 0.1.0, with a "frozen" api, put it on github with a shitton of badges like the badge whore you are.
then you drop it on forums, and slack communities and irc, and what do you get?
half of the community wants to ban you for doing self promotion
the other half thinks either
a) your library api is shitty
b) has no real need for it
c) "why reinvent the wheel bruh"
that's one scenario,
the other scenario is the project starts to get traction.
people start to star it and shit.
but now you have one peoblem you didn't have before: humans.
all sorts of shit:
people treating you like shit as if they were premium users.
people posting majestically written issues with titles like "people help, me no work, here" with bodies like "HAAAAAAAAAALP".
and if you have the blessing to work in the current js ecosystem, issues like "this doesn't work with esm, unpkg, cdnjs, babel, webpack, parcel, buble, A BROWSER".
with some occasional lunatic complaining about IE 4 having a very weird, obscure bug.
not the best prospect either.4
I've been lurking for a while but I had it up to here with these goddamned "js sucks" posts.
I'm not gonna deny js has severe design problems,
or that chromium is a motherfucking vampire
or that it's a goddamn pain in the ass to understand how to babel webpack + plugins correctly
that is all true.
the problem is that it's just a lazy damn circlejerk at this point where no learning is gained, with no outlook on any possible solution of these problems, let alone ANY type of actual collaboration to help the situation.
sometimes people don't even care to specify what is specifically wrong with js. It's just "js sucks" and that's it, farm ++.
slack is a ram hog, yes, yes, we know... WE KNOW.
every 5 days someone has to remind that!
is there any solution? why is it a ram hog? is electron the problem, or is the slack source code doing weird shit?
are there any lightweight alternatives to electron?
That's actual good conversation, but no, apparently it's impossible to drop the snarky tone for 2 seconds.
I think it's fine to point out defficiencies in applications, but it's not ok to shitpost on and on.
I would very ok with someone shitcomplaining about js is if they were doing something about it.
I'm still ok with people letting of some steam, I'm fine with people expressing frustration from direct work experience with js. I'm not ok with people and their ignorance and snarky comments and non helpfulness while comfortably laughing from their own camp of totally unrelated technologies.
Hearing sysadmins or people that code exclusively in c shit on js makes me feel my insides twirl.
Imagine I didn't do shit for linux, but I went around forums pointing out the defficiencies, like the lack of standards, and saying that mac is way better.
Or I if yapped on and on about openvpn and having an obscure as fuck api, meanwhile not doing a single fucking thing about it, or not even using it in a day to day basis.
do you hate slack's ram usage? me too and js isn't going anywhere in the next 5 years, so either do something or provide smart conversation, diagnosis of the problem or possible alternstives/solutions, otherwise stfu12
I work as a software developer for a small and specialized company on a very popular, albeit niche, piece of system software.
This software has been around for a while, and in that while it has ages. If there is one thing you could say to have aged gracefully--well, this thing ain't it. The codebase itself is what anyone would expect of a large-ish C++/C product started in the mid 2000s: documented poorly (and where it is documented, documented *wrong*), full of obscure bugs, full of idiosyncratic design choices that caused the obscure bugs in the first place, and a code style--or rather a general approach to software engineering--taken straight fom the 80s.
It is also fair to say that the product has been developed by marketing. What started out as a company-internal project to help others get work done was perceived as valuable for others, quickly rushed out to market, and "developed" by listening to whichever customer screamed loudest at that point in time. ("Developed", in the "duct tape and WD40" style of development similar to an early 90s web page: the result has no class, no style and everything users find "interesting" to interact with is a java applet.)
About six months ago the powers that be finally acknowledged that a codebase that has not seen a single line of refactoring since its inception over ten years ago is not a solid foundation for further business. What was once an openly hostile attitude towards refactoring and general improvement of the codebase itself rather than the set of user-visible functions slowly morphed into a secretly hostile attitude. Upper-level management continued to denigrate developers seeking to improve the system citing their own experience ten years ago as reason why things must still be done exactly as they have did. Parts of this upper-level management were soon complimented on their work and it was suggested they take the next step in their carreer.
Which they did, with two toes of one foot. The other eight remained in internal discussions and, more importantly, inside the head and arse of the new managers. Which promptly turned just as secretly hostile and blocked all attempts at improvement. Instead it is highlighted that the developers are clearly not smart enough to do their jobs.
Meanwhile the entire project is falling behind deadlines. We've failed to deliver on three accounts already and are now nine months behind on another plan that was set for 15 months nine months ago. (Yes. We have officially started working on this thing, but no work has been done. More to the point, work has been *started*, but is stalled or rejected continuously because "that's not what we would have done five years ago" or "you can't change that, whoever wrote it must have thought about this a lot.")
And now upper-level management has begun reverting changes that same upper-level management has requested and signed off on. Without communication. So that developers don't start work on things they have not signed off on (because they don't read the plans or give any feedback). Because developers are not qualified for their jobs and must be closely monitored to ensure they don't break stuff. Which was already broken. Because the product has been bitrotting since birth.
Fuck my life.3
This compiles and works in C++:
5[arr] = 42;
cout << 5[arr] << endl;
I know why it works technically. Its just pointer math. But I have to ask "Why?" Of all that is unholy, WHY?!16
Lets learn bubble sort!
Type the following code to Visual C++ 1998 and compile it. Then run it. Write the output to the paper i just gave it to you.
• Takes 5 mins to compile and run
• Too many errors in the given code so obscure output
• Teacher thinks we are so smart that we can understand c by typing and looking at the output.
The worst part:
• Different output per compiler
- Correctly compiles in the compiler in VC++ 98.
- Differs in GNU GCC, compiles wrong
- sends out obscure dummy output in VS2015~2017
- Works well in tutorialspoint.com compiler
WTF is this, guys?
Oh, and i have gone off topic...
Why does he think we are smart that we can understand bubble sort, and 4 more by only typing the code and looking at the output without knowing how does this algo work?
Answer to weekly question.
The teacher said to understand sorting algos by typing the code and looking at the output which differs per compiler.5
My two cent: Java is fucking terrible for computer science. Why the fuck would you teach somebody such a verbose language with so many unwritten rules?
If you really want your students to learn about computer, why not C? Java has no pointer, no passed by reference, no memory management, a lots of obscure classes structure and design pattern, this shit is garbage. The student will almost never has contact with the compiler, many don't even know of existence of a compiler.
Java is so enterprise focused and just fucked up for educating purpose. And I say it as somebody who (still) uses it as main language.
If you want your students to be productive and learn about software engineering, why not Python? Things are simple in Python can can be done way easier without students becoming code monkeys (assuming they don't use for each task a whole library). I mean java takes who god damn class and an explicitly declared entry point which is btw. fucking verbose to print something into the console.