
Cheating in Programming - fagnerbrack
https://twitter.com/ben_burnes/status/1178676970609139712
======
esotericn
All of this is clearly a matter of balance.

If you were to have infinite time, you would be idiotic to _not_ spend a bunch
of time fully internalizing the entire stack; or at least, trying to
comprehend as much as possible given your non-infinite memory. Hell, whilst
you're at it, throw in a rounded education in the humanities and sprinkle a
ton of socialization in there too.

But you don't have infinite time. So instead, you try to find the balance that
allows you to perform the task you wish to perform.

And at that point it's a completely personal decision. Perhaps you spend more
on soft skills because you have managerial aspirations. Perhaps you drill down
into bit banging simply because it's of intrinsic interest to you.

There probably is some basic level that's useful for every programmer to have,
sure, but what that even means is dependent on sector. I don't know a thing*
about Windows because it's both highly uninteresting to me, but also because
it'd be a waste of time for me to bother with it. (Perhaps the two are
linked!)

* okay, I know a decent amount compared to the man on the Clapham omnibus, but not compared to a Windows developer

~~~
bcruddy
I love the infinite time explanation. It's a great way to explain how/why
tradeoffs are made. I haven't been able to put it so succinctly, so, uhhh...
that's mine now I'm stealing it. Please credit me in your original post.

~~~
esotericn
You would have come up with it but you were too busy doing something else.

~~~
bcruddy
Such is life

------
santa_boy
Writing original code is laborious, extremely time consuming and in many
scenarios unjustified (for majority of coders). It is not an excuse for
ignorance but originality in coding isn't particularly productive (IMHO).

I am reminded of an old post (from HN I think) in similar vein that stuck on
with me [https://stackoverflow.com/questions/153234/how-deep-are-
your...](https://stackoverflow.com/questions/153234/how-deep-are-your-unit-
tests/153565#153565)

I do take time to understand the code I am using, but for most part spend
finding the code (and libraries) I want to use even in the simplest cases.
I've developed a habit to give credit in my code ... in fact I have an
expansion ';c' on my mac for giving credit! :-)

I see a lot of very experienced programmers spend time writing and debugging
even simple lines of code which are perhaps completely obvious to them. I
think it is just that way coding is. It is perhaps very difficult to get it
"First Time Right".

I guess its a balance between getting things to work vs. self-gratification.

~~~
bryan2
I’m curious about your expansion. What application are you using and how did
you set it up?

~~~
santa_boy
I use TextExpander. I wanted to do some custom stuff and discovered this
recently [federico-terzi/espanso: Cross-platform Text Expander written in
Rust]([https://github.com/federico-terzi/espanso](https://github.com/federico-
terzi/espanso))

I tried espanso a bit and it seemed to work pretty well and is customizable.

------
smitty1e
It's important to know "enough" about the lower level details to accomplish
the task.

But the whole economic point of Divison of Labour[1] is that the effort is
dispersed, no?

Knowing "enough" means that, for example, I don't

\- use a page of Java to load two tables,

\- put their keys into assiciative arrays

\- loop through the arrays and build a list of unmatched keys

. . .when a single SQL statement can give me the Venn diagram output of the
two sets. (Really saw that in some code.)

[1]
[https://en.m.wikipedia.org/wiki/Division_of_labour](https://en.m.wikipedia.org/wiki/Division_of_labour)

------
CapsAdmin
I used to think the same with music and programming but I stopped caring at
some point.

In my spare time I find joy in writing things from scratch but I see it more
as challenging myself rather than "not cheating"

If I write a compiler purely to challenge myself, I'm much more confident in
using an existing one in the future. However with a cheating/not cheating
mindset I'd be reinventing the wheel every time.

------
emsy
I agree with the gist of the quote ("you're not a real x unless you do y" is
silly). But it lacks nuance. From what I got to see, a lot of programmers
never bother what's happening underneath their code. For them, Spring, node.js
etc. will always be magical black boxes. Here's another analogy for you: Would
you go to a doctor that knows how to remove an appendix, but doesn't know how
the circulatory system works?

~~~
nonsince
So what? You don’t understand what’s going on inside your CPU because at this
point they’re too complex for anyone to fully know, and probably your
understanding of the OS is on an as-needed basis. Why hold others to a
different standard.

~~~
huffmsa
Correct. A surgeon or gastrointerologist might only have an understanding of
the circulatory system insofar as it helps their surgeries and
gastrointestinal work.

So yeah, I'd probably go to a doctor who's really good at removing appendixes
over the guy with comprehensive medical knowledge.

~~~
TheOtherHobbes
Doctors all acquire broad medical knowledge as part of their training. They're
not allowed to specialise until they've shown adequate competence in basic
general medicine.

An eye specialist who is absolutely clueless about heart or kidney function
would be unusual, and not particularly useful. Not only do most drugs have
multi-system side-effects, but many conditions affect multiple systems.

So Dr Appendix Removal will almost certainly do all kinds of surgery.

Consultants tend to have a more limited focus, but you don't get to be a
consultant without doing a lot of other medicine first. Usually they either
work as supervisors/managers, or they're called on to consult/advise and maybe
operate on more challenging cases.

~~~
huffmsa
Yes I know the reality of the situation.

So let's rephrase. Do you trust an AI controlled robot specialized in appendix
removal (with a very good track record) but zero knowledge of other systems or
procedures?

~~~
ayende
Why _would_ it have zero knowledge of other systems? Unlike people, you can
just upload the information to it over high speed interface.

~~~
z3t4
Surgeons spend a lot of time studying. Its not like some employers in tech
that expect the dev to operate on different kind of patients all day long with
100% productivity and no prior training except what they already knew from
school. So information is constantly being uploaded. But developers need to
rely on abstractions because the field is constantly changing. After 10 years
a framework would be obsolete or undergone major changes. Meanwhile the human
evolution won't change much in 10 years although there will be a lot of new
research the anatomy stays the same.

------
z3t4
School teaches us that reusing someone elses code is cheating, and using a
library would be cheating in a work interview. But using a library is actually
standard practice, even when you are paid per hour. Doing anything from
scratch will take a lot or research and or trail and error. Even basic stuff
we take for granted, like putting text on the screen. eg fonts Unicode
graphical driver, etc.

~~~
cercatrova
However, is this how we get into situations like npm, with everyone using
other people's libraries and having so much bloat? Where is the balance if
any? I don't have an opinion either way, just putting it out for discussion.

~~~
z3t4
I will write here that you should use libraries. Then next week you will see
me complain about an app having two million dependencies... Here's how I find
balance: I try to use "battle tested" code rather then writing my own. eg.
other people's libraries. But I try to keep the dependencies down. If a
package has 10,000 files I rather just rip out the functionality I need. (So I
hate when you can not do that, eg. if every function in the code is dependent
on every other function.) Often I find issues and are either too lazy to send
a "merge request" or the maintainer refuse to merge it. So in many
dependencies I often end up using my own fork.

Dependencies are a two edges sword. It's good that you get security updates.
But if you can't review all the changes, security issues can also sneak in.
Like if someones npm account get hacked and the hacker sneaks in a remote
shell or backdoor. Those can be hard to find if you got millions of
dependencies which get tons of updates every day. So I usually lock down
dependencies, and NPM becomes a fancy tool for copy/pasting.

------
imtringued
Isn't "cheating" already a well solved problem? The only way you can cheat is
by using code you didn't write without the owner's permission. If you violate
someone's Copyright you're "cheating". Let's take an extreme example. Your
product is just a 1:1 copy of an existing product like IntelliJ with a reskin.
You're cheating if you haven't negotiated a license with JetBrains but if you
do have such a license and sell an identical product then you are not
cheating.

There is no shame in using a library or tool to solve a problem that you do
not understand. A "real" software engineer knows when it makes sense to
outsource the work to an existing tool or write their own.

When you have to interoperate with other programs through an open standard
then it may be counterproductive to write the code yourself. I've personally
seen way too many hand written CSV parsers/writers that were just plain wrong.

------
ghgr
That's the problem I have when making a toy project from scratch in order to
learn a technique (be it databases, blockchain, or deep learning). I'm always
wondering if I'm allowed to use such algorithm or clone such github repo. Or
if copy/pasting an auxiliary function is cheating or not.

To avoid such moral dilemmas I try to come up with projects that solve a new
problem (which also comes with its own set of challenges). And then use all
the means at my disposal.

As a bonus it also keeps me motivated, since it has a shot at being a
profitable business idea.

~~~
huffmsa
Green lumber fallacy. You don't need to know much of anything about lumber and
trees to be a good commodities trader.

Likewise, you don't need to know the exact algorithmic details of something if
you're still achieving your desired outcomes.

If you're not getting the outcome you want, you need to dig deeper into the
components you don't fully understand to get them to perform as expected.

Real life results are best judged on metrics one step removed from the work.

~~~
allenrb
My favorite quote from work, somewhat apropos:

“I know people making good money trading corn who would be shocked to learn
that it’s a plant.”

------
DavidWoof
Looping isn't "cheating" if you know what you're doing. But if you blindly do
that from the beginning without ever learning how rhythm really works, then
you're going to be lost when things get more complicated.

And the same is true of the dev who copies tons of code from stack overflow
without really understanding it. When issues like thread safety of the app
come up, that dev is going to be lost.

Experienced musicians choose loops and samples understanding full well the
trade-offs of quantization and timbre. Experienced devs bring in libraries
understanding the trade-offs. Answering the question "how well do I need to
know this library before introducing it in production?" is a really, really
hard problem.

In practice, I see junior devs blindly copying code that subtly won't work
more than I see them writing their own DI system because of not-invented-here
syndrome. But, admittedly, the latter tends to be more destructive.

~~~
nonsince
You’ve got to start somewhere, why not learn quote-unquote “deeper” skills on
an as-needed basis.

~~~
huffmsa
This is the difference between an enthusiast and a professional.

The enthusiast can afford to learn the "deeper" stuff first, then move up.

The professional needs to know enough to ship a safe, stable, on time product.

------
bitwize
Coming from a gamedev perspective, I've personally decided to draw the line at
the following for my projects:

* Using your platform's graphics/sound/input/etc. APIs, or wrappers like SDL, is not cheating

* Using a third-party engine is cheating

Other programmers may draw the line elsewhere and that's fine. I think for me
it's a question of, using a library to achieve <hard task> is fine, but using
a framework puts on me the burden of understanding and then extending someone
else's half-completed program. And when that someone else made a decision that
I wouldn't have made that fucks with my workflow, it also puts on me the
burden of, is it okay to go in and change it or implement a low-level
hackaround? Or is _that_ cheating, and should I do everything in the
framework's own terms?

~~~
nrb
I don’t think players care about the architectural purity of your product.

Some baseline of performance is sufficient as long as you can deliver the
proper experience, which is really the only thing they’re seeking in your
game. If that same experience can be delivered MUCH more quickly and easier
why would someone deny themselves and their users those benefits?

I understand there is nuance in this decision but it feels dangerous as a hard
and fast rule. I think especially so when team size > 1-2 and common
understanding becomes important.

~~~
clarry
> I don’t think players care about the architectural purity of your product.

But we can kinda see how the "quick and easy" approach with modern engines is
leading to lots and lots of sloppy games with leaky seams.

I always appreciate it when a gamedev writes their own engine, and IME these
tend to come out as the more polished games. Doing your own engine would also
enable open sourcing it, which is something gamers can be quite grateful for
10-20 years down the road.

~~~
reificator
> _I always appreciate it when a gamedev writes their own engine, and IME
> these tend to come out as the more polished games._

Of the ones that finish perhaps.

------
protomikron
Reminds me of the following quote:

> If you wish to make an apple pie from scratch, you must first invent the
> universe.

\- Carl Sagan

------
firefoxd
In my Web programming class in college, our final project was to make use of
everything we learned to create a website. In class we didn't get past chapter
9. I however, read and completed all chapters. I made use of Ajax and a
webserver which was only taught in chapter 12.

Fast forward two years, the teacher is trying to run the project to showcase
an example project her students can do. She can't run it. She remembered it
being a great project, but now for some reason some parts won't work.

I get a call to come help them. I dust up the old project, edit it, and get it
running in front of the whole class. "What was the issue?" She asks.

"I used a webserver, now I hardcoded all the data since it's just a demo"

"Oh, so you guys cheated?"

Long story short, I was threatened to get my grade revoked, but because I have
made things right I was forgiven.

As far as school is concerned, I cheated.

~~~
dr_zoidberg
I don't get it (probably neither do you). Was using the webserber what she
considered cheating? If so, why? You said it was covered in Chapter 12. If it
was part of the course, why would it be considered cheating?

~~~
firefoxd
Because webservers were not covered in class.

~~~
dr_zoidberg
So basically the rationale was, because you studied on your own, over what was
covered in class, you cheated? Way to incentivize learning...

------
lelf
Perhaps this is link is better than a blurry screenshot (of HN):
[https://news.ycombinator.com/item?id=11083296](https://news.ycombinator.com/item?id=11083296)

------
TrackerFF
Ok, so this is actually a topic which I've been thinking about quite a lot
over the years.

Back in college there was naturally a strong emphasis on writing your own
code, after all, you're supposed to be learning. In the end, we had to roll
out everything on our own - rarely, if ever, did we get to use libraries or
frameworks.

They were extremely strict on plagiarism too, so you were constantly afraid of
your code getting flagged (for whatever reason).

All of this really created a mindset that using libraries = cheating. Same
with looking up help on the web.

It took me years to get rid of that mindset, simply because it didn't feel
right.

~~~
Stratoscope
Were you allowed to use a compiler?

If so, you weren't writing your own code. You were just writing a description
of the code in some human oriented programming language, and the compiler
wrote the actual code for you.

Also, the compiler almost certainly linked in a runtime library - more code
you didn't write.

But let's skip the compiler and its runtime, and even any assembler, and just
write raw binary machine code.

Now you're writing your own code, right?

Well... On any modern processor, your so-called "machine code" is just a high
level language that the processor compiles into its own internal operations -
which don't look anything like your machine code and don't even get executed
in the same order. So you're not writing the code the machine runs.

You could avoid this issue by writing code for an older processor like the
6502, where your code bits go straight into the logic circuitry as is.

In fact, that would be a darn good idea - you would learn a lot doing it!

~~~
runeks
No, no. Compilers don’t _write_ (their own) code, they _translate_ (our) code.

~~~
growse
> No, no. Compilers don’t write (their own) code, they translate (our) code.

No, no. Developers don't write (their own) code, they simply translate the
(customer's) specifications.

~~~
Gibbon1
> simply translate the (customer's) specifications.

LOL no! If I did that my customers would go out of business.

------
bluedino
We hired a guy who 'made cool games'. They weren't really fun, they were
buggy, and they were all made with Unity.

We also hired a guy who made simpler Javascript games, but his code looked
great an he understood how it all worked.

One is still here, and isn't very useful, the other left for greener pastures
as management wanted him to work on only the boring stuff.

~~~
ewidar
What's your take-away?

~~~
rb808
To me its: If you do a good job with simple tools you'll be given boring work.
If you work in cool technology you get to work with cool technology even if
you're producing junk.

~~~
Tcepsa
I rather interpret it as "If you do a good job with simple tools you'll be
given opportunities." (I'm interpreting the parent post to be implying that
the simpler, solid hire is the one who is no longer there because they were
able to leave for a better place). Also, as cautionary tale for managers: "If
you give folks who write solid code boring work, they _will_ find something
that suits them better."

------
vxNsr
Can’t see the original tweet, is it deleted or did the user just block me for
some reason?

~~~
qnsi
I guess deleted, can't see it as well

------
brobdingnagians
I think part of the issue is in knowing how you would go about learning and
implementing a thing. There is a lot of code that I don't need to bother
writing because someone else has done it, but I could write it if I needed to,
or could learn the algorithms and implement it. A programmer who has a breadth
of knowledge and general understanding of how they would go about writing
Node.Js will do a lot of things in Node.js a lot better, especially
optimizing. I could figure out how to write a lot of software. And when I see
something, I can usually run through which language, architecture, etc. to
make it. That's useful.

------
trentnix
How about copy/paste from Stack Overflow? Is that cheating?

Most of the code I write these days is put together like a ransom note but it
sure makes it easier to get things done.

------
haecceity
I also think using loops is cheating so I only use gotos.

~~~
techolic
Sounds like cheating to me no less. You unroll the loops to uncheat.

~~~
haecceity
Guess I'm still a cheating bastard.

------
kdeldycke
This comment is shared around for a couple of years now, but finally sourced
it from Splice's Facebook at;
[https://www.facebook.com/spliceofficial/photos/a.55520699121...](https://www.facebook.com/spliceofficial/photos/a.555206991212765/679408552125941/?type=1&theater)

------
gmiller123456
That's a really poor analogy. This guy is making equivelant tools to tools
that already exist. When someone chooses not to use a framework, they don't
rewrite the framework, they write something more specific to their needs.

------
LarryMade2
I thought it was about coding. I remember doing some paging data entry screens
with FoxPRO (generating screen form code then adding in additional code to
handle the paging), and letting another user know how to do it on a forum, and
I got a "That's cheating" response. heh.

------
Psyladine
Calculator-in-the-pocket problem. Why learn if we can externalize memory, etc.

Of course application becomes the concern, but can we really be assured that
someone who can perform the calculations mentally also knows when best to use
them?

------
ruin09
Interesting. I've been heard that there should be no 'black magic' since I
just tried to do something in this field. But yes, everytime I cheat more or
less, though. So what's the standard here?

------
k__
I like making music with computers.

You can draw the line where you want at a concert.

If you only need some background music for vocals, press play and be done with
it.

If you are good enough to play something live while singing, you can gradually
change the way.

------
dclowd9901
I think the sweet spot is knowing enough to know how something works, in
essence, if not how to do it necessarily yourself without a whole bunch of
bootstrapping.

------
kerblang
The problem is not cheating, but that abstractions _leak_.

------
craftinator
I don't think that cheating exists, unless you are prosecuted for it. For
example, you don't fail a final for cheating, you fail a final for being
caught doing something that someone paid by the Uni thinks is cheating. So
unless you are punished by an active authority, you have not cheated. And
thus, you can't cheat at software unless you are censured for it!

------
debt
People that thought this way use to be referred to as a “hipster”.

------
cotelletta
Rule of thumb: You should only include code that you could write yourself if
you took the time. Otherwise you don't understand your own software.

~~~
trungdq88
According to this, I don't think any of us (or a very small percent)
understand our software.

------
fnord77
twitter - someone else's platitudes with additional useless commentary.

------
tylerjwilk00
Put simply.

Life is an optimization problem.

------
djmips
And Bike-shedding ensues...

------
flir
cmd+f yak shaving. hmm.

------
jedimastert
There is, as always, a relevant xkcd:
[https://xkcd.com/378/](https://xkcd.com/378/)

------
darekkay
Obligatory XKCD: Real Programmers.

[https://www.xkcd.com/378/](https://www.xkcd.com/378/)

------
ginko
Seems like this is about "cheating" in music.

~~~
richrichardsson
I'm sure you're aware of the word "analogy", right?

