Confuse your colleagues
-
Why should you write clean and readable code which every decent programmer could read and understand without a lot of struggle?
You are right. Better don't do so - those bad guys might take over your job some when.
Today I found in the file "App.xaml.cs" of a WPF application following method:private void Main(IReadOnlyList<string> _arguments)
Cute, isn't it? Somehow it looks like a "normal" Main method. But wait, it is not static, ehm?
Exactly. It is called fromprotected override void OnStartup(StartupEventArgs _e)
Cmon, Kevin, your code may smell worse than , but you forgot that Bernie is a master in deciphering such code anyway (though you make him almost vomit).
-
@BernieTheBernie dude... if this is rant-worthy for you, you'd kill yourself if you saw the code i have to work with currently.
dude who knows almost nothing about Unity3d brute-forced his way through making beginnings of Windows OS pretender. the data layer (json-based) is kinda... well, it has nice parts, and the rest is bad, but compared to the other stuff, still passable.
but the part that actually handles all of the "apps", and their elements (windows, buttons, etc)... that's fuckin horrible. and not only is it fuckin horrible, most of its visual elements is being created in code. imagine 10 layers of visual elements along with their autolayout properties being generated by code, to create task manager's visual.
-
@sh_code said in Confuse your colleagues:
imagine 10 layers of visual elements along with their autolayout properties being generated by code, to create task manager's visual.
Does he have a background in Java using Swing UI?
-
@sh_code
That looks like some ancient Unity3d code, I dealt with years back when the UI system is practically generated via OnGUI() call. When they finally move the load of UI design off the OnGUI call to an actual Canvas Object for designers, I threw all the UI layout work back to designers.
-
@hungrier said in Confuse your colleagues:
Does he have a background in Java using Swing UI?
i think he has no experience with programming anything visual-related, and that all his experience is pure backend stuff, databases and related server-side code.
-
@WPT said in Confuse your colleagues:
@sh_code
That looks like some ancient Unity3d code, I dealt with years back when the UI system is practically generated via OnGUI() call. When they finally move the load of UI design off the OnGUI call to an actual Canvas Object for designers, I threw all the UI layout work back to designers.yeah, except this one has been written about a month ago, and (ab)uses the canvas-based UI.
-
@sh_code said in Confuse your colleagues:
all his experience is pure backend stuff, databases and related server-side code
At least the GUI isn't generated by database.
-
@_P_ said in Confuse your colleagues:
@sh_code said in Confuse your colleagues:
all his experience is pure backend stuff, databases and related server-side code
At least the GUI isn't generated by database.
Hold your breath, I'm porting over a convention's registration site to be mobile friendly, and the first part will be eliminating the hand-generated-html portions with an API request that simply gets the data and formats it accordingly...
-
@Tsaukpaetra said in Confuse your colleagues:
an API request that simply gets the data and formats it accordingly...
That's witchcraft!
-
@Carnage said in Confuse your colleagues:
@Tsaukpaetra said in Confuse your colleagues:
an API request that simply gets the data and formats it accordingly...
That's witchcraft!
It's also going to be an SPA.
Bring on the torches and pitchforks!
-
@sh_code said in Confuse your colleagues:
if this is rant-worthy for you, you'd kill yourself if you saw the code i have to work with currently
You're right. That's a rather minor gem in the code he produces. I'll add some more later on, but often the code snippets would require to much background knowledge.
His naming capabilities are great, as you could see from the example above. He created an interface for reading data from a database.
Can you guess its name?
IDataRead, of course, And a function for reading the entries in a table: ReadEntries.
He is fond of changing the values of parameters passed to functions. So a function may have both a return value, and get some of its parameters manipulated. Why should he use read-only or even immutable types? If you pass a List<object> inputValues to a function, you can replace all its contents! And of course, that's why it is called inputValues.
And so on.
-
@BernieTheBernie said in Confuse your colleagues:
He is fond of changing the values of parameters passed to functions. So a function may have both a return value, and get some of its parameters manipulated. Why should he use read-only or even immutable types? If you pass a
List<object> inputValues
to a function, you can replace all its contents! And of course, that's why it is calledinputValues
.That really should be a crime.
-
@BernieTheBernie said in Confuse your colleagues:
Can you guess its name?
IDataRead, of courseMissed his opportunity to call it
IReadData
; that's what I would have done.
-
@dkf This is why learning Haskell makes us 15x engineers. We don't have to debug our own excrement. :-)
-
@dkf said in Confuse your colleagues:
@BernieTheBernie said in Confuse your colleagues:
He is fond of changing the values of parameters passed to functions. So a function may have both a return value, and get some of its parameters manipulated. Why should he use read-only or even immutable types? If you pass a
List<object> inputValues
to a function, you can replace all its contents! And of course, that's why it is calledinputValues
.That really should be a crime.
Sounds to me like a hardcore C programmer (i.e. sending a
foo*
to a function to have it fill the array offoo
s if you don't want tomalloc
and return it yourself due to whatever reasons, though valid ones certainly exist in this case) or a not-really-up-to-date C++ programmer from the days when returning astd::vector<foo>
(or any other complex type, really) was considered bad due to performance problems (which were unofficially solved by compilers around 2006-2007 anyway, and officially by C++11, but I digress) and the best way to counteract was to send astd::vector<foo>&
and fill it, essentially explicitly doing what brainier compilers did automagically, but by hand.
-
@strangeways It might be a legacy of working with C, where passing back results larger than 64-bits (e.g., bigger than a
long long
uint64_t
ordouble
) was always a bit uncertain (I happen to know that it's OK up to 4 machine words on the ARM platform I use at work, but that's because I've stared at the generated machine code). Given the legacy of mess involved (which sometimes involved using a global space to store the struct; better not have two threads both returning the same thing!) intelligent programmers would do (the equivalent of)out
parameters instead, but it takes a special kind of jerk to describe such as aninputValues
.Tarring, feathering and horse-whipping them out of town: that's the right approach.
-
@levicki Or, it's an array or collection (so the values being changed aren't the actual parameters, but contained by the parameters, which to most developers is a distinction without a difference) or calling mutators (again, not the paremeters themselves but stuff inside, but that's something Bernie should have told us), neither of which require
ref
orout
.
-
@levicki said in Confuse your colleagues:
It's been a long week.
I don't think there's been any leap seconds, so I expect it's actually been the usual length…
-
@levicki said in Confuse your colleagues:
@BernieTheBernie said in Confuse your colleagues:
He is fond of changing the values of parameters passed to functions.
You sound like this is some invisible mechanism for changing parameters that are passed into a function when there has to be a
ref
(orout
) keyword (assuming it is C# we are talking about) in front of the parameter both at the place of call and in the function itself.It may not be a good practice but it works for his use case.
Some people really really hate the fact that an argument to a function passed in from a variable could be accessed from a variable with a different name inside that function. (Why they find the concept of the difference between actual and formal arguments so hard… )
-
@heterodox said in Confuse your colleagues:
Missed his opportunity to call it IReadData; that's what I would have done.
His native language is German, and in German it's "Daten lesen", i.e. in such short phrases the object may come before the verb. Of course, Kevin is fluent in English too (at least, he thinks so).
-
-
@levicki said in Confuse your colleagues:
the perceived passage of time seems to be inversely proportional to the amount of shit you have to deal with during said week.
I had to deal with a lot of shit this week, but it makes for a perceived very short week (and paycheck) because I missed 3 days of work.
-
@Tsaukpaetra said in Confuse your colleagues:
Hold your breath, I'm porting over a convention's registration site to be mobile friendly, and the first part will be eliminating the hand-generated-html portions with an API request that simply gets the data and formats it accordingly...
Both approaches are good design, aren't they? You're just moving part of the logic from the server to the client.
-
@dkf said in Confuse your colleagues:
@BernieTheBernie said in Confuse your colleagues:
He is fond of changing the values of parameters passed to functions. So a function may have both a return value, and get some of its parameters manipulated. Why should he use read-only or even immutable types? If you pass a
List<object> inputValues
to a function, you can replace all its contents! And of course, that's why it is calledinputValues
.That really should be a crime.
In some old, stupid, obsolete programming languages, that's the only way they can do it.
Oh wait, the other reply already mentioned C.
-
@anonymous234 said in Confuse your colleagues:
@Tsaukpaetra said in Confuse your colleagues:
Hold your breath, I'm porting over a convention's registration site to be mobile friendly, and the first part will be eliminating the hand-generated-html portions with an API request that simply gets the data and formats it accordingly...
Both approaches are good design, aren't they? You're just moving part of the logic from the server to the client.
I've been told SPAs are icky.
-
@Tsaukpaetra said in Confuse your colleagues:
@anonymous234 said in Confuse your colleagues:
@Tsaukpaetra said in Confuse your colleagues:
Hold your breath, I'm porting over a convention's registration site to be mobile friendly, and the first part will be eliminating the hand-generated-html portions with an API request that simply gets the data and formats it accordingly...
Both approaches are good design, aren't they? You're just moving part of the logic from the server to the client.
I've been told SPAs are icky.
They are once you get out of the toy app stage. Seems that many developers don't understand this and wind up with kitchen sink scripts and forward-only navigation.
Edit: I'm not saying it's the wrong choice for a small application, though I wouldn't go that route myself, but if you build, say, the state's entire professional licensing platform and its 13M+ lines of code as an SPA, you've fucked up.
-
@Zenith said in Confuse your colleagues:
I'm not saying it's the wrong choice for a small application
Yeah, this essentially has one flow: Gather customer information for a badge, and... that's about it. Three screens (not including the PayPal purchase flow redirect thing) total.
-
@HardwareGeek said in Confuse your colleagues:
very short week (and paycheck) because I missed 3 days of work.
You don't get any sick days?
-
@Zerosquare didn't you read? His entire week was sick!
-
@Zerosquare said in Confuse your colleagues:
@HardwareGeek said in Confuse your colleagues:
very short week (and paycheck) because I missed 3 days of work.
You don't get any sick days?
Billable hours. If my time can be billed to the client, I get paid. If not, I don't.
California mandates 3 days a year of paid sick leave, but I've never found any way in our payroll system to claim it. I've never needed it enough to dig through the bowels of Payroll to find out what arcane enchantments one must cast to obtain the divine blessing of sick pay.
-
@HardwareGeek said in Confuse your colleagues:
Billable hours. If my time can be billed to the client, I get paid. If not, I don't.
How... nice. I assume there are other benefits? Otherwise, how is that better than being an independent HPC?
-
@Zerosquare I'm employed by WTF Consulting, so I don't have to worry about creating an S-corp or whatever. Taxes are withheld just like any other employee. Fairly standard employee medical/dental/vision insurance. 401(k) (but no match).
Perhaps the biggest benefit is that I don't have to drum up my own business (at which I would suck to the point of starvation). Their recruiters do the hard work, and they both speak English and seem to be able to understand, or at least keyword match, job descriptions and resumes, which is a nice change from all the emails and cold calls I get from recruiters who can do neither.
-
@levicki You'll note it's not a maximum. And there's also unpaid sick leave.
-
@pie_flavor said in Confuse your colleagues:
@levicki You'll note it's not a minimum. And there's also unpaid sick leave.
Don't you mean that 3 days is the minimum, not a maximum?
-
@JBert fake news
-
@levicki I get more PTO than that, but I have taken exactly 1 sick day in 6 years at my current job. And that's working with kids, who are disease incubators, and not exactly being great at eating well or exercise.
-
@levicki said in Confuse your colleagues:
work you into the ground
@levicki said in Confuse your colleagues:
Who didn't have time to raise a normal family
@levicki said in Confuse your colleagues:
always stressed from work and accident prone
@levicki said in Confuse your colleagues:
which dump them as soon as they get sick
There are a whole lot of extra things you are inserting out of nowhere.
-
@levicki said in Confuse your colleagues:
With current technology it is absolutely not necessary to work more than 4 hours a day yet they willingly slave away
I think I might have made that argument once or twice, but I don't sincerely believe it myself. I've been thinking a bit on it, and not anymore.
I mean, can you imagine things people are likely to be doing instead of slaving away? Enjoying fine arts, taking up crafts, activities, spending time with family, just resting? Fuck no! More Facebook and twitterasty, for starters! I'm convinced most people actually like being constantly on the hamster wheel, doublethinking. They'd have no idea what to do.
-
@Applied-Mediocrity said in Confuse your colleagues:
I'm convinced most people actually like being constantly on the hamster wheel, doublethinking. They'd have no idea what to do.
I'm pretty sure that you're right, and that makes me sad. Because I'd love to see a world where useless/bullshit work didn't exist. Life has so much to offer beside office jobs.
-
@Applied-Mediocrity said in Confuse your colleagues:
@levicki said in Confuse your colleagues:
With current technology it is absolutely not necessary to work more than 4 hours a day yet they willingly slave away
I think I might have made that argument once or twice, but I don't sincerely believe it myself. I've been thinking a bit on it, and not anymore.
I mean, can you imagine things people are likely to be doing instead of slaving away? Enjoying fine arts, taking up crafts, activities, spending time with family, just resting? Fuck no! More Facebook and twitterasty, for starters! I'm convinced most people actually like being constantly on the hamster wheel, doublethinking. They'd have no idea what to do.
Idle hands are the devil's workshop. It's an old aphorism for a reason. There's a reason why the "idle rich" are associated with degenerate, self-destructive, or wild behavior. I know that personally, the times when I don't have anything to do (even if it's not super productive in and of itself) are the times when my depression and other issues raise their heads the most. Keeping busy doing things is a piece of advice given to those who are grieving--staying busy diminishes the ability to dwell on the grief as much.
-
"Not working" doesn't have to mean "idle". Besides the stuff @Applied-Mediocrity mentioned, you could also work on your own projects, learn new things, organize events and teach stuff to people as a volunteer, reconnect with friends you haven't seen in a long time... Not only would you stay busy, it could also have positive impact on others.
-
@Zerosquare said in Confuse your colleagues:
I'm pretty sure that you're right, and that makes me sad. Because I'd love to see a world where useless/bullshit work didn't exist. Life has so much to offer beside office jobs.
I'm pretty sure there's a false dichotomy here, though. Not all office jobs are useless/bullshit work. Many are regularly challenging and rewarding when you meet the challenges.
-
That's not what I meant.
I was trying to say that if we get rid of useless/bullshit work, we could achieve way better work/life balance.
-
@Benjamin-Hall said in Confuse your colleagues:
And that's working with kids
Older kids. It's the kindergarteners who are the worst.
-
@heterodox said in Confuse your colleagues:
Not all office jobs are useless/bullshit work.
True, but does being present in them for very long hours really improve productivity at those tasks?
-
@heterodox said in Confuse your colleagues:
I'm pretty sure there's a false dichotomy here, though. Not all office jobs are useless/bullshit work. Many are regularly challenging and rewarding when you meet the challenges.
I rarely find any challenge in doing my day job as a developer. I find joy and challenges in my ridiculously expensive hobbies instead. Not to mention dangerous. If I worked 4 hours a day instead (or rather 2.5 days per week) I'd spend more time on stuff I actually like doing and feel challenged by.
But from interactions with normal people, I think most would spend their first months with the extra time just gawping at the TV, or social media instead. Most people don't seem to want challenges.
-
@dkf said in Confuse your colleagues:
@Benjamin-Hall said in Confuse your colleagues:
And that's working with kids
Older kids. It's the kindergarteners who are the worst.
Yes, but you're still in a petrie dish. There are waves of sickness that hit several times a year.
-
@dkf said in Confuse your colleagues:
@heterodox said in Confuse your colleagues:
Not all office jobs are useless/bullshit work.
True, but does being present in them for very long hours really improve productivity at those tasks?
After 50 hours per week your productivity takes a sharp downturn. There's also a reason why more than 8 hours of work in a row is frowned upon.
Sadly, it's also handled very inconsistently - truck drivers have to take a break after 8 hours and are facing stiff fines if they're caught going over the limit. Whereas doctors and nurses in a clinic are pulling hours way beyond that and noone important really gives a shit.
-
@Carnage said in Confuse your colleagues:
normal people, I think most
Thanks again for the reminder of my abnormality.
-
@Tsaukpaetra
You're welcome