Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Thursday, March 17, 2016

What is worth spending time upfront when starting a new project

What is worth spending time upfront when starting a new project


Update:

Great answers so far everyone! Each one has been really helpful in getting to the root of the problem and helping to make sure both my partner and I are on the same page. I think a lot of it was that we hadn't talked about our actual intentions with release schedules and general work-flow.

In doing this I have come to a number of related questions that I never thought about addressing and might make more posts later on (likely over in programmers-stack-exchange)


Backstory:

I'm working on web-app with a college friend of mine.

We are developing our site using MySQL and PHP, and plan on using some jQuery for the front end. We are targeting cellphones and tablet-pc. It will eventually involve a lot of crowd-sourced data. I'd rather not say much about the specific project ideas. (Please comment on this if you think I should give more specifics.)

We have a prototype, and have some GUI mock-ups. Our idea both scratches an itch, and seems to be something never attempted before.

Our Issue:

We hope to follow principles from 37signals's book "REWORK". A big part of the book is the idea of getting a product out early. It discusses why we should focus on the core of our product and that we should ignore all the extra stuff.

Basically the idea of doing the minimal possible for a sellable product so we can ship and start getting feedback. We both have different views on what this means, and it is pulling us in different directions.

I think the book is only talking about minimal features, but he feels it is about code design too. I think that some things are worth doing now to speed things up but he wants us to rush as fast as we can and skip those issues completely.

I want to do some prep work because of the amount of time savings it would lead to later on. Like starting out with OO, Designing a thorough database schema, and spending time setting up stuff like xCSS, and breaking down our problem into individual steps.

[The way I understood him:] He wants to rush even if it means writing horrible/sloppy code as long as it gets the design out the door. He doesn't want to get stuck spending time on basic code infrastructure or refactoring as we go or DRY principles. He doesn't want to spend the time to decide what needs to get done, he just wants to do it. He thinks that committing small changes to svn is just overhead, for example.

I understand that he doesn't want us to get sucked into wasting time making a perfect system, but I think this is going way too far, and isn't what 37signals is advocating.

It's essentially a tortoise vs hare problem and I don't know how to explain to him that he will be shooting himself in the foot if he doesn't at least do some simple time saving code design choices, and break the problem down and work on it in small discrete chunks.

He is a good developer otherwise, and is capable of doing it well.

My Questions:

  1. How much prep is too much, how little is too little?

  2. What high-payoff things should we be focusing on at the start of our project?

  3. How should we judge what is worth working on, code wise (not features), at this stage of development?

  4. Is it worth spending the time implementing things like xCSS and other systems that would make it easier to write clean code from the start?

  5. How would you explain to him the value of fine-grain tasks and committing small atomic changes.

  6. What things have you done with your code that have lead to a sooner ship time?

Best Answers:

I will accept the answer that changes his/my mind the best. Feel free to answer any question I've listed, and bonus points for examples in our targeted languages. References to other 37signals' work might be helpful.

Answer by ebonhand for What is worth spending time upfront when starting a new project


I don't have specific answers to your dot-points, but in my opinion, 'too much' is anything outside of what gets you to 'working code'

Get the barest, most mean bit of the entire thing up and running ASAP!

Let the code be ugly - it'll be replaced anyway Let the design look like a dog's bottom - it'll be replaced anyway Let things be unvalidated and unsecure - it'll be replaced anyway

The idea is to get an internal prototype up and running as soon as possible. If it can be skipped and still 'use the core of the idea' in a browser or whatnot, then skip it.

Once you have something working, no matter how nasty, that's step 1 completed.

Step 2 is circular - go back to what you've already written, and make it better. Then, go to Step 2

The only part I'd not skip in Step 1 is unit tests, and that's because I use unit tests to put down my idea on what code should do, before I code it. Once the unit test passes, that part is done - NEXT!

Step 2 involves rewriting code so it's cleaner, and handles more edge cases, and it more easily updated, maintained and built upon. These all involve the unit tests (and usually involve rewriting the unit tests)

Basically, your friend is right - except when it comes to unit / integration testing

Answer by RabidFire for What is worth spending time upfront when starting a new project


Great to see another 37signals fan!

Here's a quote from their online book, Getting Real:

People often spend too much time up front trying to solve problems they don't even have yet. Don't. Heck, we launched Basecamp without the ability to bill customers! Since the product billed in monthly cycles, we knew we had a 30-day gap to figure it out

Basically, decide on a launch date. Reduce the total scope of your application to the bare minimum that is required to release on that date. This will help you get the application out there in time, and give you live data to work on.

If you've got the scope part figured out, and want to focus on the coding issues, then you should have a look at this section in particular, Managing Debt:

It's ok to [hack together some bad code that is still functional] from time to time. In fact, it's often a needed technique that helps you do the whole Get-Real-ASAP thing. But you still need to recognize it as debt and pay it off at some point by cleaning up the hairy code or redesigning that so-so page.

In short, chuck the implementation of xCSS at the start, but ensure you come back to it at a later stage. Read chapters nine and ten on "Interface" and "Code".

Finally, my favorite quote from the book:

Build half a product, not a half-ass product. What you really want to do is build half a product that kicks ass.

Hope you guys build a great product that you can showcase to the world. Resolving issues like these quickly is also another great way to save time! :)

Answer by sjt for What is worth spending time upfront when starting a new project


I would say the main topic that you need to focus on in order to convince your friend is "Agile Estimating and Planning". Many people believe that being Agile means strictly no planning, which is not true. Scrum - a Software Development framework based on Agile principles suggests that every project start with a Release Plan. Most of your questions will be answered based on the Scrum Guide.

How much prep is too much

Let's take a step back to understand what "prep" means, it has a more deeper meaning than just one huge planning and design session. Prep would mean - Scrum Release Planning, Sprint or Iteration Planning, Daily Scrum Meeting Planning. You really never stop your "prep" work, it goes on. The moment you fail to plan, that is the moment you plan to fail. The Scrum release planning usually requires no more than 15-20% of the time an organization consumed to build a traditional release plan. In this meeting I suggest you write up an Business EPIC user story, and Technical EPIC User story as well, and break them down into chunks fairly quickly. You don't need to go into detail, the details will be taken care of in Sprint Planning. During Sprint Planning, just groom the high priority user stories to the right detail level and commit to completing them in your current iteration. Sprint Planning should not be more than 4 hours for a 2 week iteration. And the daily Scrum sync up meetings would only last 15 minutes, since it is just the 2 of you, it could be shorter.

how little is too little?

You would know you've "prep"ed too little when you get blasted with impediments when actually trying to do the work, during the iteration. When things go just enough smoothly, you know you spent the right amount of time prepping.

What high-payoff things should we be focusing on at the start of our project?

Try focusing on answering this simple question below: ?How can we turn the vision into a winning product in best possible way?, The Business EPIC User Story, Technical EPIC Story- this would be your product vision from a technical and infrastructure standpoint. For example - are you going to use TDD, Continuous Integration plan, Version control plan, etc. You can never ignore these, how much ever you try. Another thing is figure out who are your products users. ROI, and penalty of high priority User Stories. Done Criteria for your product, which would also apply to a small slice of your product. I can go on and on, so I will stop here.

How should we judge what is worth working on, code wise (not features), at this stage of development?

Code wise, the most worthy thing to work on would be, the piece of code required to be coded, to get the most high valued feature working and

shippable. You can do this by calculating ROI and the penalty of not getting it done. You will have to know who the users will be, the benefit of the feature for the users, and the impact on the users if the feature is or is not delivered. Higher the ROI and Penalty - higher the value. I know this is easier said than done, but who said the software business was easy?

Is it worth spending the time implementing things like xCSS and other systems that would make it easier to write clean code from the start?

If you want to be Agile then yes. Clean code means lesser technical debt and higher quality of software. Agile suggests that developers pay constant attention to quality of code. Why? Because the people who wrote the Agile principles had seen far too many projects fail because of not taking care of technical debt early on in the software development process.

How would you explain to him the value of fine-grain tasks and committing small atomic changes.

A collection of fine grained tasks associated with a User Story, which when done based on the done criteria, would produce a shippable slice of software.

I would explain it like so: Think of your product as a multi layered cake. Before you start to build the whole cake, you need to know what flavor cake it is going to be, and how many different kinds of layers it will have. The flavor are the mock up screens and the EPIC user stories, and the layers come up from the Technical EPIC story. The layers would be Database, middle ware, server side code, html, skins etc. Now building the complete cake at one go would be a bad idea because the cake loving customers often change their mind on what kind of cake they want to eat. A whole cake might take longer to build than a small slice, and what if after you build the whole, say a Chocolate cake, the customer asks for a carrot cake? That would make for some throw away cake or code :) Instead why not build one small vertical slice at a time, let the customer taste it, get some feedback, modify the next piece accordingly, and keep adding slice by slice to create a whole cake, which the customer really wants!!

What things have you done with your code that have lead to a sooner ship time?

Used decoupled designs, used interface inheritance more than class inheritance, code review, TDD, PMD, Checkstyle, Pair programming, Collaboration with customer, the list goes on. All these things lead you to your product being "Done". The more of the above items you skip for later, the farther you are pushing your ship date. I would rather deliver a delicious and high quality small slice of cake to the customer, rather than a low quality, not yet done slice.

Answer by JeffO for What is worth spending time upfront when starting a new project


Find 5-10 people you think will be interested in your site to try it out. If you can't do this, you two have nothing to argue about.

Getting it in front of users should address two issues:

  1. Have enough features so users 'get' what your program will do.
  2. Make the UI attractive and the performance good enough so they will believe you know what you're doing.

Total strangers will obviously be more critical and never return to your site if put off. Those closer to you will give you as second or third chance. If you wanted to create a FaceBook clone, you at least have to upload photos and share them. Waiting 20 sec. for the main page to load a picture of your cat, requiring the user to manually type the full file path and taking 5 minutes to upload a 100 KB jpeg file will send users clicking away.

Answer by Richard Harrison for What is worth spending time upfront when starting a new project


As the intention is to release quickly and build upon it, I would say that it is of paramount importance to use the technologies that you know best. If you are a great OO programmer then use OO. If you really understand databases spend a few hours designing the schema.

The one thing that you can absolutely guarantee is that the code will change. IME bashing out a load of code and then throwing half of it away is a much better approach than trying to design elegant code for a problem that is not yet fully understood. The sloppy code will get replaced and serves a dual purpose of getting something released and aiding you to understand what you're doing.

Too much prep is when you spend hours/days looking into something and don't find an answer. Solution: Go with your first impression.

To decide what to work on codewise it is the code that is directly related to the key features.

No it's not worth learning anything (e.g xCSS) that you don't already know well. Better to use something that you do understand and refine this knowledge over time and then hire real experts.

Having said all of the above the one thing that I'd always start with is to have layers to keep the DB the Logic and the UI separate. When I started with PHP I wish I'd a small framework to do all of the tedious stuff (Db etc.) I didn't have one, so eventually I published my work as opensource. I would of course suggest reading how I'd build Db/Logic/UI using my framework as an example.

Answer by c0rnh0li0 for What is worth spending time upfront when starting a new project


How much prep is too much, how little is too little?

Depends on experience and project complexity/size. With an agile approach, you should plan for the most simple application that gives your customer (or user) some value and fits into a short release cycle (1-3 weeks). You have already a prototype and mock ups, so your use cases and requirements are somewhat clear. But you should still plan a subset of your app that will be done within a defined deadline. If you plan big up front, you'll face some hard problems that will likely slow you down. That's because you try to design your software towards the problem. But often enough you'll find a much simpler solution if you really have to cope with the problem or it will disappear because some requirements have changed or simplified. Imagine you write a blog app. Obviously you want an WYSIWYG widget for it. Up front you spend time to evaluate existing solutions or even write one yourself. In the end it turns out the majority of users like to stick with plain text or asking for simplified markup. You've spent 3 days to several weeks for nothing. Start out very basic and simple, you will know when the people need something more fancy.

What high-payoff things should we be focusing on at the start of our project?

Not sure about that question. If you talk about database and OO design, then it souldn't be a high pay off. Usually an simple db schema is put together within minutes and evolves over time (including re-factoring, normalization). Same goes for your achitecture. This again depends on you experience, if you don't know much about data normalization or how to apply MVC (even on a very low level), then you should educate yourself a little.

How should we judge what is worth working on, code wise (not features), at this stage of development?

Keep it simple. Learning a full stack framework (like Symfony or Cake) might save a lot of time, but they all have a decent learning curve and you will run into issues that are not trivial (at least for scaling/performance). An decent abstract codebase isn't always needed nor useful, for me it is sufficient if it's testable. With small hobby projects or experimental things I embrace php's simplicity.

Is it worth spending the time implementing things like xCSS and other systems that would make it easier to write clean code from the start?

Don't get me wrong, it's always a good thing to learn something new. But clean code starts in your head, the way you think, handle and abstract problems. xCSS is just a toy that will consume time to learn and will introduce other problems. Also keep in mind that you need to find someone able to use it if you want to delegate design tasks.

Over the years I've got more and more conservative over such tools and libraries. Usually you will encounter some limitations or issues and have to implement ugly workarounds or you have to dig and understand the whole source. If it gives you some huge value, it might be worth it, but as I said, xCSS is a toy.

How would you explain to him the value of fine-grain tasks and committing small atomic changes.

Maybe this is a misunderstanding from one of you or both. Fine grained doesn't mean that you should commit every getter/setter or any new method separately. It is usually some logical coherent commit (that should work).

Examples:

  • bug #2134 fixed: admin password empty
  • added basic Book model with tests
  • added logic to Book model, all tests passing
  • added another Book test
  • migrated codebase to Book
  • deleted legacy funcs_book.php file
  • refactored front controller to support functions as controller

The commits and comments should make it easy to find out when bugs got introduced or when a specific codebase has changed. A good rule is to have one liners as comments, which is pretty helpful to analyze SCM logs. With large and incoherent commits that have verbose or even anonymous comments you are practically forced to look at the changesets. Also it's possible to export specific changes as patches that are easy to apply to other branches or even repositories.

What things have you done with your code that have lead to a sooner ship time?

  • don't be afraid to toss legacy or unreadable code (with SCM)
  • use vendor libs only for tasks that are hard or complex
  • refactor regularly
  • don't make it look fancy, make it simple
  • embrace your language. sometimes function > class

I think the book is only talking about minimal features, but he feels it is about code design too.

Think holistic. A simple GUI with concise features works well because it's accessible and easy to understand. It's easy to understand a basic for loop in three lines, but an abstract object tree that involves dozens of indirections is hard. Many developers won't admit it, but it is really hard. Greatly planning code design up front is dead. Refactoring and unit testing should drive your design in an evolving application. However, having pen and paper at hand to brainstorm for a few minutes for a solution is always healthy.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

Related Posts:

0 comments:

Post a Comment

Popular Posts

Fun Page

Powered by Blogger.