What makes a "production code"? [closed] - production-environment

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am a Research Scientist, and definitely the way we code is not considered "production code" that's prototypical code, but then what makes a production code ?
Testing for scalability, ability to handle real time traffic and testing all edge cases ?
But what else, for instance I also hear Python is less of a "production language" that Java or C#, what is the criteria for them to be production-able.
Any books/references drawing this point home or to sublime it, would also be great!
Thanks in advance

Production code generally means its ready to ship out to a client.
Most obvious bugs are fixed
code is well-structured and self-documenting
Automated Tests are written and have a sufficient level of coverage
It's gone through a peer review process before being incorporated into the main code base.
It will pass the "build system" may automatically check rules like: coding conventions, complexity, linting, testing, compilation. Sometimes this may include deployment success to a testing environment.
How would this compare to non-production code?
Nearly all developers start with prototype/non-production code, even developers that use Test Driven Development (TDD). The goal of their code is to "just make this work" so they can develop a first pass approach to a problem. Often this will lead to poorly named variables, excessively long (number of commands) functions, improperly formatted and often little or no tests.
Once a developer has a satisfactory working solution, they go back and clean up the code. They fix spelling errors; use design patterns, if they see one that's helpful; they make their code fit the teams coding conventions and style guide, some of which lead to real heated debates on using tabs vs spaces.
The best way to think about it is:
The first pass at writing code is a software draft that is to get the developers ideas on the page until they have their "Story" or functionality set. The goal is for them to understand it.
The second pass, i.e., getting it ready for production is refining it so that other people can understand their code. In paper writing terms, you're giving it a more coherent structure and improve trying to convey your meaning to other people better.
That's not all.
While this will generally apply to writing code, part of saying something is "ready for production" is including all the steps not involved with the actual application code.
Often it's all the steps needed to get the code into the clients hands or live.
This could be creating a Continuous Integration and Continuous Deployment system. Setting up servers, deployment groups, monitoring systems and so on.
Without these things your application may not be considered production ready by your organization.

Related

Is Test Driven Development Agile? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
From the agile manifesto, agile values:
Individuals and interactions over processes and tools,
Working software over comprehensive documentation,
Customer collaboration over contract negotiation,
Responding to change over following a plan
Yet doesn't TDD create a plan and almost structure out a contract negotiation?
"What are the features you want?"
"1,2,3"
Developer writes tests for 1,2,3 -> Team delivers code
"Here's 1,2,3 give us our money"
It's also a form of comprehensive documentation and also a process. Once the tests are written individuals and interactions no longer matter as much because the "source of truth" is no longer with people but ironed out in the code.
Just wondering how they fit together, if they're opposed or do they work together?
TDD is more like a practice for individual contributors, instead of a process. Test here usually refers to unit test, which is part of development work, instead of comprehensive test suits such as performance, functional, and integration tests.
TDD in certain cases should help individual contributor really think about requirement and implementation (respond to change and come up with working software). I personally do not adopt this practice, but it is an agile practice that can be adopted by a single contributor. Do not confuse it with higher level tests and related documents.
Yet doesn't TDD create a plan
Nope. TDD does not mean "write tests up front" it means "write tests before writing code". The whole "Do as much as you need and no more" comes into play. You are not expected to write the tests for all your features before writing any code, just the feature you are currently on. And then (depending on the level of testing) just a small subset of the feature will need tests now.
It's also a form of comprehensive documentation and also a process
It also aids with working software.
Working software over comprehensive documentation,
Over, not instead of. If you can get both, great.
the tests are written individuals and interactions no longer matter as much because the "source of truth" is no longer with people but ironed out in the code.
The oracle for what it does is always the code. The oracle for what it should do is always people.
TDD done well also aids with the communication.
Any insight as to why some people seem to be getting mad at the question?
The question comes off as very troll-y. You are twisting the manifesto to make it sound like anything that aids the latter is "bad" and you are twisting the definition of TDD to be an all-encompassing, completely up-front process. Neither of which are true.
Individuals and interactions over processes and tools,
BDD is a great tool for aiding interactions at a dev/BA/stake holder level. TDD (xUnit and alikes) are great tools for aiding interactions at a dev level.
Working software over comprehensive documentation
TDD helps create working software.
Customer collaboration over contract negotiation
(BDD) Being able to describe in a common language the specification and have that execute is awesome.
Responding to change over following a plan
A well tested code base can change with ease. An untested or badly tested code base is fixed.
That is, while there is value in the items on
the right, we value the items on the left more.
I also agree with Tom’s answer, ‘if it is possible to do agile well, then I believe that is always a good thing. If it is not possible to do it well, then I believe that it can be harmful.’ Agile simply isn’t the right answer for every company. It is different to do well in a large company and it’s lack of focus on software architecture can really affect the usefulness of the resulting technology. Digital Animal have written an interesting article on Agile and why it doesn’t work for them. http://digitalanimal.com/blog/slaying-the-agile-dragon-the-game-of-thrones-methodology/?AT=D8c953

Good practices for handling project over to another developer [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
What are some good procedures to follow when handing a project to another developer, in cases of when the original developer will still be around for a couple of months to aid in the transition? Let's assume a medium-sized web application if a concrete example is necessary.
As a junior developer, I have gotten several projects assigned to me for maintainance that were written by others. I believe the easiest projects to continue are the ones where the code is clean and well documented (meaningful var names and formatting as well), the archetecture is relatively strightfoward, and the developer took some time to write some notes on the use of his components. In Java this would include class-level javadoc; in other languages it may include a header at the top of the source code.
Also, if the original developer is available and open to questions, it makes learning the archetecture much simpler - no puzzling out what he was thinking.
I've been on both ends. Taking over a code base and handing it off.
You should:
Identify areas that aren't completely
obvious. So, if you have a directory
called "xml" but all your flash
object get their data from
"flash/swfs/xml" you should document
that.
Identify parts of the database which
are no longer in use. If there are
tables that simply have no use
anymore.
Identify areas of concern such as
speed/performance of certain pages.
If you have some really backwards
logic on certain pages, explain why,
if it's not been commented in the
code directly.
Any third party vendors should be
identified along with their cost and
use on the site. So if you're using
a delivery network to stream your
flash videos, definitely let that be
known.
If you have pages still in the
project, but aren't being used
anymore, identify them, or simply
remove them.
If you know for a fact that your
database was poorly designed,
contains no constraints or indexes
and has no primary keys on many
tables, mention it. It will let the
new developer know they need to
optimize the database.
If you hardcoded e-mail addresses
within the code and didn't put them
in .config files, identify that as
well.
I'm sure there are more but there are things I wish were brought to my attention on a project I had taken over at one point.
If you have written your code from the start so that it is sensibly architected and fairly simple to understand, and provided adequate documentation, transitional problems should be minimal.
But training is always nice.
For anything that requires a build environment (certain compiler, 3rd-party libraries, opensource libraries, paths, etc.,), have the original developer sit down with the new developer, at the new developer's workstation, and walk through the process of making a simple change, committing to the source control, building, smoke test, etc.. Lots of times projects that are out of the mainstream may have odd procedures for testing, or they may come from an unfamiliar repository branch, may need a specific compiler version, libraries, etc.. Bugs may be tracked differently, it may require specific logins or endpoints for testing, etc.. By walking the new dev through the process, on their workstation, you'll uncover all of those issues, saving the new dev lots of frustration.

How to tell person he should improve his skills? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
You are working with someone in one project and this someone writes bad code. Not that bad to fire him ar you can`t work with it,
but
person do not follow coding conventions
code is not always covered with unit tests (and it should be)
code is sloppy and do not have comments where it should have them
person do not know design patterns well/do not know at all
put his clothes on your table just as he needs some space.
So how to tell one he need to upgrade his skills, without hurting him? I described something that is a problem. But imagine everything is just fine, except some things that really hurt the project. What to do so that you are still friends, but guy really understood he need to change something?
This is a good candidate for having the entire company do code reviews for a month. You won't single him out (which is good, unless all else fails), and you're better engineers can help him along.
Just stay professional, and point out the problems in your bug tracking, code reviews, or whatever means you have for tracking work items and bugs.
It's the responsibility of the person's manager and the project's PM to determine who is responsible, and to inform the person politely. That is their job, and if they are unable to do this, your project (and probably company) is likely not a very good one to work for.
I would recommend "failing" any code that does not meet the quality criteria. For example, if there are missing unit tests, "fail" the code so that it goes back to the developer to be rectified. This would be similar to having the code fail UAT or something, except it's more of an internal review from team leaders in the development team.
As an example, in one place I worked, I was leading a team of developers. We had PHP production code that was writing unnecessary warnings to the log files, which eventually caused disk space problems and difficulties in debugging the real bugs.
So, to rectify the problem, I laid down the rule: if any code that you've written writes warnings to the log file, the release will fail testing, and you'll need to fix it before it goes any further.
We had almost no warnings being logged on the next release. Now, it wasn't technically a bug, just a code quality issue. The point is that someone needs to be the gatekeeper that reviews and enforces quality controls at some point in the development lifecycle.
Even better, write some automated integration tests that check unit tests exist and code is styled correctly. There are some tools that can check this for you (not sure of the names of them, someone else may be able to enlighten us on that). That way, the build fails an automated, reproducible test. Code would get cleaned up quick smart if that was happening I would say.
You can implement code analysis/styling tools into your build process that enforce certain design and style guidelines. The benefit of this approach is it doesn't single anyone out and it applies to everyone.
Depending on the language your project is using, there are probably tools out there to do this for you. Ex. StyleCop and FxCop for C# projects.
Relax, just invite him for a drink go out and get stoned then explain him the whole situation. The next morning if hopefuly he can still remember, he's gonna understand. If not
this time he's gonna take off all his clothes and put them on your damned table :)
Anonymously leave some books on his desk, like "Code Complete" or "Refactoring".
Assuming you're not his lead, inform his lead of your concerns and let that individual take responsibility for the problem.
write some unit tests that covers his code. He may not know how to write good tests, so he can use yours as an example. Set up automated scripts that regularly run these tests, and send out mail detailing what failed, so that he cannot simply ignore the presence of these tests.
We had a guy at work who only bathed once a week (and no, he wasn't French). And towards the end of the week his BO got pretty bad. We left a bunch of hygiene products on his desk for him to try and give him a clue. Didn't work. I think he started going 2 weeks between baths after that. Phew. This was 20+ years ago.
Coding conventions? Like what? Where to put curly braces?
Missing/bad comments? Well, sometimes no comments are better than gratuitous or wrong ones.
Sloppy code? Maybe so. Post an example or two. Maybe he's a good coder, and you're not that bright. After all, PM's aren't usually that bright, they just know how to kiss ass better than some of us care to.
Design patterns? Bullshit bingo fodder.
But taking his clothes off and leaving them on your desk is strange. IMHO.

How do you mitigate the inherent risk of a one-person team? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
What steps can one take to mitigate the risk of a one-person team working on a project, especially when that one person is a rather junior programmer?
I ask because I am that junior programmer, and there is no one available/willing to do things like code reviews. Part of the problem, I suppose, is that I am working on web applications in an embedded software company, so most employees' expertise is in a different area.
Recognising this as a problem is more than most "junior programmers" would be able to do :)
Unfortunately most employers don't see the benefits (only the downsides) in multiple people on the same task.
With lack of understanding from your employer on this point, just stick to all the usual rules, such automated testing, documentation, and source control. I know too well that when working alone on a project, it is all too easy to become complacent.
The truth is that the documentation is not just to help others know what your code does. It helps you too. Source control is not just to enable multiple people to work on a project and merge changes, it helps productivity (in the sense that you can easily revert changes), enforces backups, and gives you good tracking of where your time and effort has been spent.
Source control and automated tests are two things that will help in any environment. Those two things alone will mitigate some of the major disasters (lost work, buggy code resulting from constant changes and refactoring).
Beyond that, stick to the basics: K.I.S.S. Keep your code design as simple as possible, keep your classes simple, follow the Single Responsibility Principle and above all, avoid duplication (which will greatly guide your designs). Make use of every resource you have: message boards, other programmers at other companies, friends from school, whatever you have available to you. Even having a mentor you can send e-mail to is helpful.
Best practices aren't much different than for a larger group. Source control, unit testing, follow a style guide for your language, script everything instead of using manual processes, and try to have at least some high level documentation and comments in the tricky parts of code. For specific decisions that are important and hard to change, like how your code interacts with the database, try to find out what approach a well-designed project uses, if necessary by checking on this site.
Unit tests especially are a great way for other people to quickly figure out how your code is supposed to behave, and to check whether their changes have broken anything.
StackOverflow is full of available and willing people to help solve problems and give advice.
Other than that, be prepared to make mistakes and learn from them.
Oh yeah, and get a copy of Code Complete!
As #MattJ mentioned, the fact that you care enough to try to mitigate that risk implies much more seniority than your current job title purports.
I would say that you should do all of the normal things you do to mitigate risk and, where it's not possible to get another resource, just either do it yourself, or skip that step.
It's the best you can do.

Which Agile software development methods have you had the most success with? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
There are numerous Agile software development methods. Which ones have you used in practice to deliver a successful project, and how did the method contribute to that success?
I've been involved with quite a few organisations which claimed to work in an 'agile' way, and their processed usually seemed to be base on XP (extreme programming), but none of them ever followed anywhere near all the practices.
That said, I can probably comment on a few of the XP practices
Unit testing seems to prove very useful if it's done from the start of a project, but it seems very difficult to come into an existing code-base and start trying to add unit tests. If you get the opportunity to start from scratch, test driven development is a real help.
Continuous integration seems to be a really good thing (or rather, the lack of it is really bad). That said, the organisations I've seen have usually been so small as to make any other approach seem foolish.
User story cards are nice in that it's great to have a physical object to throw around for prioritisation, but they're not nearly detailed enough unless your developer really knows the domain, or you've got an onsite customer (which I've never actually seen).
Standup meetings tend to be really useful for new team members to get to know everyone, and what they work on. The old hands very quickly slack off, and just say things like 'I'm still working on X', which they've been doing for the past week - It takes a strong leader to force them to delve into details.
Refactoring is now a really misused term, but when you've got sufficient unit tests, it's really useful to conceptually separate the activity of 'changing the design of the existing code without changing the functionality' from 'adding new functionality'
Scrum because it shows where the slackers are. It also identifies much faster that the business unit usually doesn't have a clue what they really want delivered
Scrum.
The daily standup meeting is a great way to make sure things stay on track and progress is being made. I also think it's key to get the product/market folks involved in the process in a real, meaningful way. It'll create a more collaborative environment and removes a lot of the adversarial garbage that comes up when the product team and the dev teams are separate "silos".
Having regular retrospectives is a great way to help a team become more effective/agile.
More than adhering to a specific flavor of Agile this practice can help a team identify what is working well and adapt to a changing environment.
Just make sure the person running the retrospective knows what he/she is doing otherwise it can degenerate into a complaining session.
There are a number of exercises you can take a team through to help them reflect and extract value from the retrospective. I suggest listening to the interview with Linda Rising on Software Engineering Radio for a good introduction.
Do a Google search for "Heartbeat retrospectives" for more information.
I've been working with a team using XP and Scrum practices sprinkled with some lean. It's been very productive.
Daily Standup- helps us keep complete track of what and where everyone is working on.
Pair Programming- has improved our code base and helped remove "silly" bugs being introduced into the system.
iterative development- using 1 week iterations has helped up improve our velocity by setting more direct goals which has also helped us size requirements
TDD- has helped me change my way of programming, now I don't write any code that doesn't fix a broken test and I don't write any test that doesn't have a clearly defined requirement. We've also been using executable requirements which has really helped devs and BAs reach requirements understandings.
kanban boards- show in real time where we are. We have one for the Milestone as well as the current iteration. At a glance you can see what is left to do and what's being done and what's done and accepted. If you don't report in your daily standup something pertaining to what's on the board you have explaining to do.
co-located team- everyone is up to speed and on page with what everyone else is doing. communication is just-in-time, very productive, I don't miss my cube at all.

Resources