Skip to main content
6 votes

Is it fine to Copy a big chunk of code (function of 11 lines) and past it into my own project?

11 lines isn't that much. Go ahead and copy-paste it, but... make sure you understand it! One day you may need to enhance it, expand it's functionality, or modify it in some other way. If you take the ...
FrustratedWithFormsDesigner's user avatar
5 votes
Accepted

Code platform only accepts manual copy-pasting. How to debug the code locally effeciently?

Everything should be in one file: You can use a tool like esbuild to combine ("bundle") many source files (using import to refer to each other) into a single file ready to copy and paste. ...
Jacob is on Codidact's user avatar
5 votes

Empirical software engineering case on approaches to handling multiple versions, one file with ifs or several versions of program

In my experience, the most important factor here is not necessarily a technically one, but an organizational: the number of teams and developers who are available for the maintenance of such a system. ...
Doc Brown's user avatar
  • 221k
3 votes

Empirical software engineering case on approaches to handling multiple versions, one file with ifs or several versions of program

Are there any empirical software engineering works that compare these two approaches? Yes, one option is to have a team which exist to maintain core functionality, and another to tailor it further to ...
Steve's user avatar
  • 12.7k
3 votes

practical copy/paste clipboard model of recent web HTML5 browsers?

It took a couple of readthroughs to verify I had a good understanding of where you're coming from and what you're trying to do, and I think I get it. It sounds like you're in the middle of the ...
i336_'s user avatar
  • 289
3 votes

What is the truh concerning pasting data into a browser?

Obviously, copy-paste in the browser is possible. What the security mechanisms mean is that you cannot initiate it from the browser's javascript automatically. The user has to initiate it from their ...
nvoigt's user avatar
  • 9,230
2 votes

Is it fine to Copy a big chunk of code (function of 11 lines) and past it into my own project?

Personally and professionally, I've copied chunks of code far larger than 11 lines, but I make sure I always try to read and understand what is going on or, at the very least, that it isn't doing ...
AIWalker's user avatar
  • 1,365
2 votes

practical copy/paste clipboard model of recent web HTML5 browsers?

You can use the copy and paste events which are provided on all DOM elements. Below you can see an example where the page has two boxes. If you select any part of the top box and copy it (Using Ctrl+...
Alexander Hausmann's user avatar
1 vote

Empirical software engineering case on approaches to handling multiple versions, one file with ifs or several versions of program

Using configuration files is one valid option, and you should seriously consider whether a variant can be expressed through configuration values - this shifts much of the customization work from ...
Hans-Martin Mosner's user avatar
1 vote

Code platform only accepts manual copy-pasting. How to debug the code locally effeciently?

Another way is to wrap it in a if that checks for dev/prod environment: try { //calling an object or function that is only available in the product } catch (error) { var isOnIDE = true } if (!...
Ooker's user avatar
  • 335
1 vote

Question about the tutorial purgatory in coding path

Been there and done that so I'd like to share how I moved past that stage and hopefully it will be helpful. 0) Learn the basics properly. All languages have the ability to store data, perform ...
user110866's user avatar
1 vote
Accepted

practical copy/paste clipboard model of recent web HTML5 browsers?

I'm not sure if this completely meets your needs but I think one thing that could be fairly simple to implement here is to give each part of your model its own URI. That is, every node of the tree ...
JimmyJames's user avatar
  • 31.1k

Only top scored, non community-wiki answers of a minimum length are eligible