It's a common complaint these days that we hear a lot about people's rights but not so much about their responsibilities, so what should be on the programmers bill of responsibilities. That is things that they should do, which they may find unpalatable, but that which separate programmers acting professionally and responsibly, from those who do not.

I'm primarily interested in the unpalatable ones and the ones which tend not to happen. That is the ones that programmers tend to shirk and avoid, rather than the ones which 90% of programmers actually want to do (such as always refactor and use source control).

An important follow up might be 'how do you train yourself to be a Responsible Programmer?'
–
Stephen FurlaniDec 22 '10 at 19:31

2

This question appears to only be generating a list of items. Although the answers are rather impressive (and I commend the answerers who put the time and effort into their posts), they are centered on opinions and the wording of the question strikes me as polling.
–
Thomas Owens♦May 10 '12 at 17:07

5

@ThomasOwens strongly disagree that "This question is not a good fit to our Q&A format." This has already generated an answer regarding developer testing, development methodologies, freelancing and business concerns, quality assurance and software engineering, really starting to be uncertain why we even have this site if questions like the above keep getting closed.
–
Joshua DrakeMay 11 '12 at 15:56

17 Answers
17

A programmer has the responsibility to push back poor requirements instead of blindly implementing them. This includes telling clients that what they want is more expensive than other options or has a particular set of risks. It also includes communicating bad news in a professional way - not screaming, calling people stupid, implying they are stupid or other childish behavior. If he pushes back, he should have a set of reasons (more than, "I don't like SQL Server and won't use it") and an alternative plan to present.

However, the programmer also has the responsibility of accepting decisions and using tools or designs they may not like if their pushback was not accepted. If a report was requested in SSRS, delivering it in Crystal Reports (which the client may not have) is unacceptable. If a .net solution was required, delivering it in Haskell is unacceptable. If no one else on the team uses a tool or language that you want to use, it is unprofessional to use it if management doesn't agree that it is the best tool for the particular job.

A programmer has the responsibility to test his work. (This shouldn't be the only test, but no professional programmer should send out code he has not tested.) This includes testing even the branches of the code you don't expect to hit very often. If you have a set of nested IFs, test all possible routes.

A programmer has the responsibility to handle errors and exceptions gracefully and to write error messages that the user will see that are professional and neutral not jokes or insulting.

A programmer has the responsibility to protect private data, protect the proprietary code he writes for the company and to protect the users from catastrophe (even self inflicted catastrophe) from their use of the application.

A programmer has the responsibility to make sure his code is maintainable and is in source control.

A programmer has the responsibility to coordinate with others to make sure his changes do not adversely affect what they are doing.

A programmer has the responsibility to recommend the best choice for the client of tools or languages in the design phase not the tool/language he wants to play with and learn.

A programmer has the responsibility to work with all the appropriate personnel for a project including the ones he does not like. It is not your job to like people, it is your job to work with them and be polite.

A programmer has the responsibility to produce a product that does what was specified in a reasonable time-frame. If the time-frame is not going to be met, he or she has the responsibility to inform management of that as soon as it is known.

A programmer has the responsibility to let project management know about impediments to getting the job done. They can't fix what they don't know about.

A programmer has the responsibility to do the whole task not just the fun, interesting parts. Every job has some boring parts, they still need to be done. This includes things like timesheets and adding discussion items to project management software. It includes things like documentation, code review, etc.

A programmer has the responsibility to learn the business domain he is supporting not just programming concepts.

A programmer has the responsibility to keep his skills up-to-date.

When a programmer messes up, he has the responsibility to do all in his power to fix the problems as soon as humanly possible. This may include bearing the bad news to management rather than trying to hide that you just deleted a critical table in the production database.

A programmer has the same responsibilities of any other worker - to show up on time, to work the hours contracted, to request vacation time in advance, to answer phone and email messages (heck to read their emails), to fill in required forms for HR, etc.

I love joke error messages. The situation is bad enough already, no need to make it more serious than that - at least try to make me laugh while slapping me with an error!
–
dr Hannibal LecterDec 23 '10 at 8:45

2

I question the responsibility for a developer to personally test his code in all situations... I would rephrase that to ensure that his code is tested... If the organization has professional testers (both automated and human) and a solid process in place to make sure the code is tested, I don't see why the developer has to do it personally. If I am developing a new feature or fixing a bug, sure I will test it myself, otherwise I won't know if I'm done with my job. However, if I'm doing a large refactoring, it does not make sense for me to exhaustively regression-test the whole product.
–
JoelFanDec 23 '10 at 16:26

2

What about no exclamation points in error messages... i.e. "Date is invalid!"
–
JoelFanDec 28 '10 at 4:37

@Axidos, It's because I changed my answer once I realised what I'd done.
–
dan_waterworthDec 22 '10 at 16:12

1

"Readable" by whom? My "peers" (i.e., someone with education and experience similar to mine)? Someone who is really well-educated in the art and science? Or a Flying Code Monkey who has NO business with anything more advanced than Dartmouth BASIC?
–
John R. StrohmDec 22 '10 at 23:35

6

@John, others in this context implies other programmers. In the sentence: "The giraffe was bigger than the others.", we don't takes others to mean flying monkeys. 'Others' means "more of the same type who have not already been mentioned".
–
dan_waterworthDec 23 '10 at 9:41

Maybe for large scale systems it might be too much for one programmer to decide. But for the vast majority of sites where one or few programmers work, it is absolutely necessary to properly store data. No encryption when hashing is needed, no custom algorithms or security by obscurity. Real, tested security.
–
MalfistDec 22 '10 at 20:43

This is harder than it sounds... work is more than just "data in a file"... it's any time that the user has spent with your software.

For example, if the user filled out your 30-field form with 29 valid items and 1 invalid one, don't clear all his valid data to complain about the 1 invalid one (heck, don't even clear the invalid one... maybe it's long and just requires a minor correction, or the user won't remember what it was before if you clear it)

A non-obvious but important example is what Windows and practically every other "file manager" software gets wrong.... if I spent a half hour carefully Ctrl-Click'ing to select a set of files and I accidentally do Click instead of Ctrl-Click, it should not clear all my previously selected files, making me start over.

Another one that they got wrong... if I accidentally hit Ctrl-A (instead of Ctrl-S right next door), it should not lose my place in the file and put the cursor at the beginning.... I call finding the right place in the file "work" which the program has "lost".

Yet another: TortoiseSVN's "commit" dialog has a long list of files. Before hitting "Commit", you can go down the list of files, double-clicking on each one to see its changes in a 2nd dialog. To do this quickly I sometimes use the keyboard only, hitting <Esc> to close the 2nd dialog and go back to the 1st. If I accidentally hit <Esc>
twice, it also closes the 1st dialog, which results in me forgetting which file I was up to.

Try not to make keyboard shortcuts that do oppositie things assigned to the keys right next to each other (CTRL-C and CTRL-V for example, can't tell you how many times If copied when when I intended to paste and vice versa)
–
HLGEMDec 22 '10 at 19:33

5

@HLGEM, Paradoxically, whoever designed this probably thought he was doing us a favor by putting them next to each other
–
JoelFanDec 22 '10 at 19:39

4

And he wasn't? I mean, you don't have the full power of Emacs or anything, but you can copy and paste without moving your hand around a lot.
–
compmanDec 22 '10 at 20:24

1

Use Total Commander. Right click to select, and right click to unselect. Unless you navigate somewhere else or lose focus for a long time while the current folder being watched is changed, you won't lose your selection.
–
configuratorDec 23 '10 at 0:49

1

For the last example (Ctrl-A loses my place in the file), I have recently found a partial workaround that works in many programs... Ctrl-Z, Ctrl-Y.... that will undo my latest edit to the file contents, then "redo" it, with the result that the contents are the same as before, and I'm located at the place of the edit. This is not necessarily the same as the place my cursor was right before my mistaken Ctrl-A, but it's often close enough... this of course does not excuse the program's bad behavior on Ctrl-A... it's only a partial workaround and took me a while to hit upon
–
JoelFanDec 23 '10 at 13:51

A programmer has the responsibility to respect the system his program will be running on. After development and testing is finished, the program will be deployed to be used for its intended purpose, and that usually involves other people running it on their computers. The programmer needs to keep this in mind: his program is running on someone else's property, not their own, and needs to behave itself as a guest in their home instead of barging in like it owns the place.

assume that it is the only significant program running on the system and hog system resources accordingly. (Exceptions can be made for actual single-tasking machines, of course, or for programs that the user could be reasonably expected to run alone, such as heavy fullscreen games.)

jump out in front of the user with a popup window while the user is doing other things in other programs. (I'm looking at you, Yahoo Messenger!)

I really like those both as a user and a programmer. Bouncing icons in my dock are my number one cause of rage towards people I never met.
–
AgosDec 23 '10 at 0:05

7

I like all of them except "update itself without the user's consent". I find the way Chrome updates itself refreshing - I love just finding new features. The way other programs do it, however, is abominable. I'm looking at you, Java, and at you, Acrobat Anything. Do not ask me if I want to update you every day. I said no once, take a hint!
–
configuratorDec 23 '10 at 0:46

2

If a program is to update itself automatically, at least it should ask the user for consent the first time.
–
gablinDec 23 '10 at 13:27

The programmer should know and use the core libraries and platform used.

Specially when the programmer comes from other platform/language. Is terrible to find the programmer struggling for something the core library provide or to misuse the platform advantage due to ignorance.

The programmer should create self documenting code

It's very important to have the code documented for other to use, but when it comes to maintainability, self documenting code may literally save hours and hours of frustration.

Question anything - A programmer should have the responsibility to inquire on anything that a system may be required to do or handle. This can include asking what users may see as silly questions as there are various sites devoted to showing just what users can be capable of doing. Daily WTF and SharkTank being a couple of examples though I'm sure there are others.

A programmer should not do or implement anything which is unethical or illegal, such as write viruses or hack others' systems (unless it is to discover security holes and then inform the victim about it and what he or she can do to avoid this from being exploited by any malicious hackers).