0

I'm just wondering. Is it okay or true that some of the best programmers once taught that to become an effective programmer is through being a lazy programmer rather than spend time memorizing lots of code and get through to deadlines? For example, a programmer relied on research and downloading libraries needed for his or her project, read some instructions or document on how to use the library, and then sometimes whether he or she knows the math will copy-paste the samples. Afterwards, he or she will review its structure's source on how this code used it. Some contribution for help and tips in effective programming to complete the project's deadline would be much appreciated.

  • 1
    While GitHub is a phenomenal repository of open-source code, you can't just copy&paste the code! You will always have to comply with the license of that code, and if there's no license, you can't do anything with it. But if you can use a library, doing so is probably sensible: Code is a liability (it takes time to write and contains bugs), so you want to maximize the code not written while still meeting all requirements. – amon Jan 29 '15 at 09:14
  • @amon So you mean to say that even if it's free and can be used for productivity, so does in business and if planning to use this library to ease the job and sell it, needs a permission? Is there anything else? – David Dimalanta Jan 29 '15 at 09:36
  • @amon Also, every same problem needs different solution. Is that mean that relying a free library, which is the answer to programmer's problem, is bad at all? – David Dimalanta Jan 29 '15 at 09:40
  • Here's the library I've used for making quick RSS feed module before deadline: https://github.com/matshofman/Android-RSS-Reader-Library – David Dimalanta Jan 29 '15 at 09:41
  • 2
    Using libraries is *good*, because it means you don't have to write code that has already been written. But there's not just a technical side to this, but also a legal side. That RSS reader is licensed under the [Apache2 license](https://www.apache.org/licenses/LICENSE-2.0). That's considered to be a business-friendly license, but it still puts certain requirements on you, the user of the library. For example, you have to show your users the license for this library, and you accept that the code comes with no warranty. Other licenses might require you to open-source your whole application. – amon Jan 29 '15 at 10:03
  • @amon How about altering or making code library nearly similar to his work? – David Dimalanta Jan 29 '15 at 10:04
  • @amon And also, you said that "business-friendly," right? That means I can publish this app with the RSS library I've used. – David Dimalanta Jan 29 '15 at 10:08
  • 1
    “Making a code library nearly similar” is walking a fine line between “reengineering” and “plagiarizing a design”. If you are not sure whether you can use some code or a library, consult your company's legal counsel. I might say that a license is “considered to be business-friendly”, but whether it's acceptable to *your* business is a different question. You need to discuss this with people at your company. – amon Jan 29 '15 at 10:11
  • 1
    @amon How about if I use this library for my app due to charity? I will sell it for free for a cause since my current project is a Christian-based related app. Will that be okay too? – David Dimalanta Jan 30 '15 at 01:10
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/20689/discussion-between-david-dimalanta-and-amon). – David Dimalanta Jan 30 '15 at 02:01

1 Answers1

4

Of course - it's not very effective to reinvent the wheel. If someone else has already solved the problem and made it freely available, why not take advantage of that?

However, that road is full of pitfalls. If you don't truly understand what the code is doing and how, or it's a trusted and well known library, you don't want that in your production code. When the system fails and the owner comes asking why is this part of the system killing our business you don't want to answer "Dunno, I didn't write that, just copied it from GitHub to get past your deadline".

I guess the lazy/smart programmer tries to optimize to write as little code as possible over a long period of time, including code written for future bugfixes, upgrades and maint.

  • So, you're mean to say that if this library is completely deprecated, then, looking either at least the most basic or the root source of the program before implement it? – David Dimalanta Jan 29 '15 at 07:42
  • Wait a minute...is that what @amon mentioned about using free library cause liability? – David Dimalanta Jan 29 '15 at 09:37