« first day (3166 days earlier)      last day (1767 days later) » 

2:14 AM
@Morwenn give me your best stroustrup
 
2:45 AM
@Puppy agreed, why is it even called a pattern. It's just programming.
 
 
1 hour later…
3:56 AM
So I went to a bank branch to pick up an ATM card for the solar farm company. The lady at reception was like 'your dad picked up his on Saturday morning'. I have only been to this branch once. Maybe there are people who find this personal touch welcoming, I find it scary.
 
4:47 AM
Hong Kong's status as a financial powerhouse is under threat - and the world could suffer.
Virtual/financial world maybe. I wonder whether the real world, - ones like us who provide housing and utility (electricity) will too? Or real world will benefit when the virtual world suffers?
It's a complex problem, and complex problems interest me.
 
5:43 AM
So, what are some motivations, factors, that cause developers to make more overly engineered code?
 
lust for power
 
@Mikhail unbounded future-proofing. "If I can make this code consider all possibilities ever then no humand being will ever have to write code to solve this problem again"
 
^I don't understand that one in a professional setting, mostly because it means more work. I could never imagine myself assigning myself more work to do...
I'm somewhat personally offended by this code I got from a vendor that is not be named. Instead of code examples they packaged together a wxWidgets code that wraps ~10 C styles functions. The code has a few modern C++ features (std::threads, shared poitner) but is both over engineered and non very functional. the C API has properties that are set with setParam(handle,id,value). These guys decide to wrap every parameter so that the handle is special reference counted item...
So you can do Param B = A; and now both of them will change the same device
Among the problems here is that you don't know what owns what or which parameters are affecting which hardware device. Its also substantially more lines of code than just calling the C api. Feels like a violation of the rule of zero, and I'm personally offended by the abuse of mutable state (or really any use of mutable state).
Also 3 level deep inheritance hierarchies for classes that only have one final class. How the fuck does that happen?
So, when I was a kid I once saw that kind of monstrosity in a code that was supposed to convert between different NSG formats (CASAVA, Illumina). Except it supported very few formats. This code would crash NetBeans and MS's Intellisense. Deep down inside it converted letters ('A','T','G','C') to their binary representation. One of the senior engineers wrote a perl script that ran 20x faster.
 
6:22 AM
When you have to sit in the office 9-6 and have little to do & you love programming, you tend to over engineer code for the heck of it.
 
Also, inexperience. I was taught the whole inheritance-heavy OOP stuff in university. When i was doing a half year project on integrating a physics-sim engine I royally fucked that up. 4 levels of inheritance, abstract classes and virtual functions everywhere and actually couple of instances of diamond-inheritance.
dynamic_cast in the hot path was really some face-palm worthy stuff.
Anyway, my point is you have to learn somehow, I guess. Some people have the luxury of learning on projects with no consequence, others apparently don't
 
Always wondered what would happen if we allowed the shared fields in diamond inheritance to compile.
Cause the typical solution is to have class TA : Student, Faculty, Person :-)
 
 
1 hour later…
7:36 AM
@Mikhail what even
For some reason the directory cache on Travis doesn't work the same way in Linux/OSX VMs and in Windows VMs
One seems to cache directories based on the root of the project while the other one stores directories based on the current directory
 
what
This looks like a cursed image of some sort
Also I haven't seen shiny Bjarne in a long time :o
 
7:56 AM
Maybe it's the bluish colour. Horror movies sometimes remove red spectrum from films.
 
@Mikhail Is that a C# book on the shelf?
 
 
4 hours later…
11:57 AM
Hi guys, greetings! Can anybody tell me what ((std::string (*)(int))std::to_string) means or does? Thanks.
 
 
3 hours later…
2:49 PM
@NanashiNoGombe It's casting a function pointer, which I find suspicious.
std::to_string is a function, and (std::string (*)(int)) is a cast of that to std::string (*)(int), which is a pointer to a function that takes an int and returns a std::string.
 
@EtiennedeMartel nothing too much suspicious. He was in the help chat and it was essentially about auto fptr = &std::toString; obviously being ambiguous
 
Aah.
Yeah, I figured the cast was to resolve the right overload.
 
3:23 PM
@Mgetz Yeah, it's pretty common.
 
Yeah I saw that, it's become a bit of a meme lately
 
I mean, we all knew that a ton of code out there is shit.
But this? This is new.
A brand new dimension of bullshit.
 
3:36 PM
eh people have been misusing that operator for ages
not sure why they chose that for xor
 
4:03 PM
@EtiennedeMartel wowwwwwwwwwww
 
Worst part is that ^ is actually logic AND (en.wikipedia.org/wiki/Logical_conjunction)
 
4:24 PM
@Mikhail pretty much, I suspect the reason it was used was that keyboards at the time were pretty limited. So my guess is that the system they were using didn't support a better character
that said I don't know B or Algol
apparently ^ was not an operator in B
 
 
4 hours later…
8:10 PM
 
8:48 PM
@Mikhail Most of personal code is over-engineered somewhat from a "leave no stone unturned" POV. So I want something that will work for multiple threads - I'll design it work for a million threads when in reality it's never going to be more than a few hundred. Algorithm X is a fast algorithm, but there pathological inputs which never happen in real life but can make it take a long time. I'll spend the time to deal which those correctly and reasonably efficiently - and even add tests for them.
For corporate code, I lean a bit more practical. So if I need a unique identifier for every event, I'll use an incrementing 64-bit counter with the assumption that it will never overflow and alias the lower-numbered events. But this is something that I'd probably design out of my own personal code.
 
@Mysticial and people wonder why I'm of the opinion that they used fixed width integers too much
int works in 98% of cases
 
@Mysticial I doubt I'd design this out of my personal code, unless I honestly had a reason to believe the code might continue to be used for a long time. Even assuming you incremented at 4 GHz, it would take over 137 years of continuous operation to overflow a 64-bit number...
 
9:08 PM
@JerryCoffin Let's just say I have some strange pet peeves. :)
 
What's the solution in your personal code? Did you roll some kind of BigInt?
 
@Mikhail Depends on the failure case and the requirements. But I typically just use the pointer address since those are guaranteed to be unique for any one point in time.
Obviously only works for the lifetime of the process.
 
So its doubly stupid because you're still fucked if you exceed 2^64 events (assuming each event is size_t) and they aren't re-used :-)
 
@Mikhail That's why I said it depends on the requirements. The usecase I usually have is that there won't be a lot alive at one given time, but infinite non-overlapping instances.
 
The kind of over engineering I'm getting pissed off about isn't ricing your code for teh performance, or compliance. Its when you support complicated syntax by fully implementing the rule of 5.
 
9:29 PM
@JerryCoffin it's not so much the 64bit number as it is the 32bit
but as I said.. in most cases int is still fine
 
31bit
 
10:18 PM
@Mgetz Certainly true that a 32-bit number is not so much as a 64-bit number! :-)
 
 
1 hour later…
11:42 PM
Hi
I have a long const* char var and need to declare another variable of the same length. What's the best way to do this? e.g. const char var2[strlen(var)] I'm not sure if I should use an array or pointer?
 

« first day (3166 days earlier)      last day (1767 days later) »