12 Replies - 3371 Views - Last Post: 21 December 2016 - 09:29 PM

#1 Redjo  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 1
  • Joined: 18-December 16

When is a piece of code considered succesful?

Post icon  Posted 18 December 2016 - 10:47 AM

Hello world,

My name is Andrew. New to the coding world and this forum. On a mission to learn code by myself and I'm having a question regarding when a piece of code is considered succesfull. Not sure if this is a legitimate question but asking nonetheless. For example is it considered succesful when the code does what you want it to do? Or does it also have to be written in de most efficient way possible(in the most possibly simple way)?

My (incomplete) opinion on this is that it doesn't matter if it's as simple as possible, because when the program works it is already something logical so therefore it doesn't matter. I have a feeling that your own personal ability to solve problems(creativity, ability to use logic, but especially creativity :P/>) is at the core of programming.

I hope I am not too unclear with my choice of words. I like to hear from you all! Caio!

This post has been edited by macosxnerd101: 18 December 2016 - 07:40 PM


Is This A Good Question/Topic? 3
  • +

Replies To: When is a piece of code considered succesful?

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5313
  • View blog
  • Posts: 18,099
  • Joined: 05-May 12

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 11:13 AM

Success is achieved when the end user can easily use it to do the task for which the software was created. The problem is that users tend to be fickle creatures.

You could have three apps that does exactly the same thing with the same feature set, but somehow the app that has the Apple logo on it will be hauled by the industry, the one with the Android logo on it is deemed acceptable, and the one with the Microsoft logo on is considered junk.

There is also the power of mind share. Things are so much easier to learn and do, and operations run so much faster on Mercurial, but git is considered more successful despite its arcane and sometimes inconsistent commands and slower performance.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5313
  • View blog
  • Posts: 18,099
  • Joined: 05-May 12

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 11:20 AM

But that is all taking the general market as the label for success. As a starting programmer you should consider success as the increasing scale of:
Does it do things correctly?
Does it do things correctly and make it easy for the user easy to use and understand the output?
Does it do things correctly, efficiently, and make it easy for the user easy to use and understand the output?
Does it do things correctly, efficiently, and make it easy for the user easy to use and understand the output, and easy for other developers to understand?
Does it do things correctly, efficiently, and make it easy for the user easy to use and understand the output, and easy for other developers to understand, and maintain?
Was This Post Helpful? 0
  • +
  • -

#4 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 128
  • View blog
  • Posts: 723
  • Joined: 15-October 09

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 02:02 PM

Hi Andrew,


View PostRedjo, on 18 December 2016 - 05:47 PM, said:

For example is it considered succesful when the code does what you want it to do?


If often is, if it is good enough. “Good enough” means that it not only does the job, but you don't have to come back and fix it every 2 min.

View PostRedjo, on 18 December 2016 - 05:47 PM, said:

My (incomplete) opinion on this is that it doesn't matter if it's as simple as possible, because when the program works it is already something logical so therefore it doesn't matter. I have a feeling that your own personal ability to solve problems(creativity, ability to use logic, but especially creativity :P/>) is at the core of programming.



My (not so incomplete opinion, thanks for asking) is that it doesn't matter if it is as simple as possible, as long as it is maintainable. It can do what it says on the tin, if somebody (and that includes you) has a tough time figuring out what's going on and what needs to be done to fix it, then that somebody (and that includes you) is going to think that this code is pile of U+1F4A9. And that's the opposite of successful code, I think.
Was This Post Helpful? 4
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 12563
  • View blog
  • Posts: 49,473
  • Joined: 12-June 08

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 02:05 PM

Well look who it is! Welcome back EdwinNameless!
Was This Post Helpful? 0
  • +
  • -

#6 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 128
  • View blog
  • Posts: 723
  • Joined: 15-October 09

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 02:07 PM

View Postmodi123_1, on 18 December 2016 - 09:05 PM, said:

Well look who it is! Welcome back EdwinNameless!


I am surprised someone even remembers me! :)
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 12563
  • View blog
  • Posts: 49,473
  • Joined: 12-June 08

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 02:10 PM

Pfffsst.. Please.. You may be "nameless" but hardly forgotten!
Was This Post Helpful? 1
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5313
  • View blog
  • Posts: 18,099
  • Joined: 05-May 12

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 02:25 PM

A side note about efficiency. Your CS teachers will press you to pick and write the most efficient algorithms (particularly if it is an algorithms and data structures class).

In job interviews, top end companies like Microsoft, Amazon, Google, etc. will press you to come up with efficient algorithms during the technical interviews, but once you are hired, they will expect you to follow the modern (agile?) approach of using the simplest thing that could possibly work until it is identified to be a bottleneck.
Was This Post Helpful? 0
  • +
  • -

#9 jon.kiparsky  Icon User is offline

  • Fuck Trump
  • member icon


Reputation: 10216
  • View blog
  • Posts: 17,371
  • Joined: 19-March 11

Re: When is a piece of code considered succesful?

Posted 18 December 2016 - 07:37 PM

View PostSkydiver, on 18 December 2016 - 04:25 PM, said:

In job interviews, top end companies like Microsoft, Amazon, Google, etc. will press you to come up with efficient algorithms during the technical interviews, but once you are hired, they will expect you to follow the modern (agile?) approach of using the simplest thing that could possibly work until it is identified to be a bottleneck.


This is true - mostly. You do want to avoid writing aggressively bad code. For example, DB access should be minimized as a reflex - even if you can't point to it as a specifically profiled bottleneck, you would like to make as few round-trip calls on the database as possible. The paradigm case of this problem is the "N+1" query - you do one query to get N objects, then you do one query for each object. You don't want to have to go back later and figure out whether this is bad - it's just bad, don't do it.
Similar issues occur in code that doesn't touch a DB - if you see that you've written a triply-nested loop over some structure, you should probably be asking yourself some pointed questions. But once you've avoided the hard traps, yeah, you don't want to spend a lot of time trying to shave cycles until you have benchmarking that identifies this region of the code as an important time sink.

Quote

For example is it considered succesful when the code does what you want it to do?


That sounds like one sort of success for me. I would say that success for code is defined in terms of usage, so a piece of code might be considered successful when you're fielding bugs against it. If nobody's reporting bugs, that probably means nobody's using it, so it's not really "succeeding" at much.
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6431
  • View blog
  • Posts: 30,267
  • Joined: 10-May 07

Re: When is a piece of code considered succesful?

Posted 19 December 2016 - 08:24 AM

I consider my code to be successful, when the client signs off on it. Regardless if it's contract work, or for 9-5, when the conveyed request has become agreed upon work, the code is successful (imo) when the client is happy that it satisfies their request, & accomplishes the task requested of me to automate or perform.
Was This Post Helpful? 0
  • +
  • -

#11 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5313
  • View blog
  • Posts: 18,099
  • Joined: 05-May 12

Re: When is a piece of code considered succesful?

Posted 19 December 2016 - 08:56 AM

I forgot... In this modern world of security hacks and malware, add on security as another dimension to my scale in post #3 the following:
Does it do things correctly, securely, efficiently, and make it easy for the user easy to use and understand the output, and easy for other developers to understand, and maintain?

View Postno2pencil, on 19 December 2016 - 10:24 AM, said:

I consider my code to be successful, when the client signs off on it. Regardless if it's contract work, or for 9-5, when the conveyed request has become agreed upon work, the code is successful (imo) when the client is happy that it satisfies their request, & accomplishes the task requested of me to automate or perform.


+1

I couldn't resist also adding this oldie but goodie:
Posted Image
Was This Post Helpful? 1
  • +
  • -

#12 aidenkael  Icon User is offline

  • D.I.C Regular

Reputation: 52
  • View blog
  • Posts: 252
  • Joined: 22-October 13

Re: When is a piece of code considered succesful?

Posted 21 December 2016 - 08:33 AM

It depends on a lot of things I think. For me, I work in an agile environment and make use of user acceptance criteria. My code is complete when I fulfill the UAC.
Was This Post Helpful? 0
  • +
  • -

#13 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 878
  • View blog
  • Posts: 1,877
  • Joined: 30-January 09

Re: When is a piece of code considered succesful?

Posted 21 December 2016 - 09:29 PM

When Is A Piece Of Code Considered Successful?

  • Write code
  • ??? <-- about here
  • Profit!

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1