12 ms·
Cheating in Programming
- gmiller123456 7y agoThat'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.
- djmips 7y agoAnd Bike-shedding ensues...
- ginko 7y agoSeems like this is about "cheating" in music.
- richrichardsson 7y agoI'm sure you're aware of the word "analogy", right?
- ghgr 7y agoThat'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.
- WilliamEdward 7y agoThe whole crux is that it's 'cheating' if you don't actually understand the tools. So long as you don't run into any problems where not understanding an algorithm stops your entire development process, who really cares?
- smitty1e 7y agoI mean, I took a graduate level Biochemistry course and got destroyed. Nevertheless, I fathered two children.
- huffmsa 7y agoGreen 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 7y agoMy 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.”
- JustSomeNobody 7y agoUse anything you want from GitHub. Once you have something working start removing what you got from GitHub.
- TrackerFF 7y agoOk, 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 7y agoWere 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!
- bitwize 7y agoComing 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?
- tybit 7y agoAt first I thought the “libraries, not frameworks” mantra* was silly for drawing an arbitrary line in the sand. Over time it’s lined up well with my experiences though. * e.g http://tomasp.net/blog/2015/library-frameworks/ http://tomasp.net/blog/2015/library-frameworks/
- stjohnswarts 7y agoThis is my experience with web stack work.
- nrb 7y agoI 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.
- CapsAdmin 7y agoThis is very true if you want to make a game, but that's not always what a "gamedev" wants. I used to think I wanted to make games, but I really just enjoy making game systems and game engine related things.
- darekkay 7y agoObligatory XKCD: Real Programmers. https://www.xkcd.com/378/ https://www.xkcd.com/378/
- CapsAdmin 7y agoI 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 7y agoI 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 7y agoSo 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 7y agoCorrect. 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 7y agoDoctors 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 7y ago
- DavidWoof 7y agoLooping 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 7y agoYou’ve got to start somewhere, why not learn quote-unquote “deeper” skills on an as-needed basis.
- huffmsa 7y agoThis 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.
- username90 7y agoLazy learning is a lot less efficient, in order to get good you need a ton of deliberate practice on the basics, practice which wont happen as long as you are "cheating".
- al_form2000 7y agoThe analogy between coding and music is actually quite flawed.
- smitty1e 7y agoIt'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
- fnord77 7y agotwitter - someone else's platitudes with additional useless commentary.
- cotelletta 7y agoRule 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.
- esotericn 7y agoAll 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
- Pigo 7y agoI like to roam around the projects I use the most on Github and see if there's a bug I can work on, or someway to help out, when I have the time. It took me too long to realize that I could help open source projects out without being the chief architect at Microsoft, or have a well established coding blog, etc...
- bcruddy 7y agoI 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.
- ruin09 7y agoInteresting. 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?
- brobdingnagians 7y agoI 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.
- flir 7y agocmd+f yak shaving. hmm.
- z3t4 7y agoSchool 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.
- jeen02 7y agoSchool wouldn't be too useful if all you learnt was to copy others code.
- deleted 7y ago[deleted]
- Intermernet 7y agoThe whole idea of open source is to remove barriers to building on other's code. This isn't cheating. Ignore what school taught you, but make sure you follow the ideals of the license, and try to pass it on if possible. Also, if you import a library, try to actually understand what it does. This is sometimes an unreasonable request (for example libsodium is a gateway to madness/enlightenment) but you should make an effort to understand the code you're importing!
- jedisct1 7y ago> for example libsodium is a gateway to madness Nod.
- cercatrova 7y agoHowever, 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 7y agoI 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.
- vxNsr 7y agoCan’t see the original tweet, is it deleted or did the user just block me for some reason?
- qnsi 7y agoI guess deleted, can't see it as well
- trentnix 7y agoHow 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.
- bluedino 7y agoWe 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 7y agoWhat's your take-away?
- Psyladine 7y agoPeople who can work will be put to work.
- rb808 7y agoTo 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 7y agoI 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."
- 1996 7y agoA-level players won't stay in C-level companies C-level companies will prefer B-level players
- username90 7y agoNever hire programmers who demonstrated that they don't care about the boring stuff. Also don't hire programmers who demonstrated that they don't care about the fun stuff unless you have no other options.
- dclowd9901 7y agoI 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 7y agoThe problem is not cheating, but that abstractions _leak_.
- santa_boy 7y agoWriting 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-unit-tests/153565#153565 https://stackoverflow.com/questions/153234/how-deep-are-your... 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 7y agoI’m curious about your expansion. What application are you using and how did you set it up?
- santa_boy 7y agoI 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.
- the_jeremy 7y agoKeyboard (System Preferences -> Keyboard or Spotlight -> Keyboard) -> Text, add whatever expansions you want, though this wouldn't be able to automagically figure out the actual attribution; you'd have to type that in after whatever template you set up.
- austincheney 7y agoYour comment mistakes the nature of your work. As a software developer you don’t get paid to provide code. You are paid to provide enhancements to business products. Changes to a product should be tested before they are shipped to the customer regardless of who makes them. Avoiding writing original code is primarily an excuse to limit personal liability through diverting blame. Organizations that care about product quality would blame that developer/team for poor product quality regardless of who wrote the code.
- LarryMade2 7y agoI 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 7y agoCalculator-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?
- lelf 7y agoPerhaps 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
- k__ 7y agoI 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.
- protomikron 7y agoReminds me of the following quote: > If you wish to make an apple pie from scratch, you must first invent the universe. - Carl Sagan
- deleted 7y ago[deleted]
- debt 7y agoPeople that thought this way use to be referred to as a “hipster”.
- jedimastert 7y agoThere is, as always, a relevant xkcd: https://xkcd.com/378/ https://xkcd.com/378/
- tylerjwilk00 7y agoPut simply. Life is an optimization problem.
- firefoxd 7y agoIn 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 7y agoI 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 7y agoBecause webservers were not covered in class.
- dr_zoidberg 7y agoSo basically the rationale was, because you studied on your own, over what was covered in class, you cheated? Way to incentivize learning...
- joenot443 7y agoTwo years later they threatened to revoke your grade?
- haecceity 7y agoI also think using loops is cheating so I only use gotos.
- craftinator 7y agoI 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!
- imtringued 7y agoIsn'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.
- kdeldycke 7y agoThis 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.555206991212765/679408552125941/?type=1&theater https://www.facebook.com/spliceofficial/photos/a.55520699121...