When you start programming, how do you start off?

Started by
27 comments, last by Zahlman 13 years, 4 months ago
Quote:Original post by Oxidda
Quote:Original post by Decrius
I always Code Like Hell. Don't try this at home.


It might work for smaller applications, but if your building an application on the enterprise level which has to have a lifetime of at least 10years, then I wouldn't use this so fast.


I know :). I've restarted my GUI project for like 4 times, and refactored thoroughly for 4 times as well. For 2 years I have the same feature set, the underlying structure is just getting better and better. But that is also part of the learning process. For any next project I'd be much better in analysing the complexity upfront, making better design decisions thereof...

Usually, I do code linearly. So for this parser I build, I first make a class to abstract the file IO, with caching etc. Next build a tokenizer, then build a semantics analyser...and as I go I optimize the previous steps, abstract them or shuffle the duties etc. Whatever needs to be done for my ultimate design (in other words, the project is never finished).
[size="2"]SignatureShuffle: [size="2"]Random signature images on fora
Advertisement
Quote:Original post by CzarKirk
"UML is great if you don't want to do any work; you just draw pictures of what it would look like if work was actually done."


UML is a notation and as such only a tool, not more.

UML is not a religion, and nobody (well, maybe except your employer) forces you to produce copious amounts of diagrams instead of doing actual work.

Whenever I need to visualize structure and process, I turn to UML because as a well-known notation most people can read it easily.

Quote:Original post by thatguyfromthething
Starts and ends in perfect symmetry with a nice cigarette.


This. [grin]
Quote:Original post by Decrius
I always Code Like Hell. Don't try this at home.

Quote:Original quote from the article you linked.
I am not proposing a code-like-hell methodology.

Umm... I guess you're aware that you're violating the advice of that article?
Depending on the complexity of the project I'm undertaking, I usually do some research first. Find some tutorials, bookmark the ones that seem good so I can come back to them.

Once I have some idea of how to tackle the problem, I'd write out some pseudo code and get to it. Thinking about design is great, but in my opinion it's better to get through a quick iteration of the project so that you actually know what kind of problems you'll encounter (as opposed to relying on pure speculation when you concoct those UML class diagrams...)
Quote:Original post by theOcelot
Quote:Original post by Decrius
I always Code Like Hell. Don't try this at home.

Quote:Original quote from the article you linked.
I am not proposing a code-like-hell methodology.

Umm... I guess you're aware that you're violating the advice of that article?


Yes, that's why I say "Don't try this at home", since it's a horrible way of coding. But once you started so, there's no stopping!
[size="2"]SignatureShuffle: [size="2"]Random signature images on fora
I normally start with notes and defining the data structures. It helps me visualize and then its just one step more to write the interface and process functions for those structures.

Thats a good start.

Quote:Original post by theOcelot
Quote:Original post by Decrius
I always Code Like Hell. Don't try this at home.

Quote:Original quote from the article you linked.
I am not proposing a code-like-hell methodology.

Umm... I guess you're aware that you're violating the advice of that article?


Not to be negative but that guy at coding horror has some amusing stuff but also some really sketchy ideas.

Especially when I hear a lot about guys throwing out large masses of code, or redesigning many times, or thinking they are done then the last 10% takes as long as the first 90%. I never simply get these issues. Obviously when this happens you are 'designing' things that you don't understand how to do if that's the case, or which depend on something else. You are going too low level without any assurance any of your ideas work, and getting into more and more elaborate things you may not need at all. Like when people simply grab a ton of design patterns and shove them in the design before knowing if they are even necessary.

It's easy in programming to add in layers of metaness, and really a good programmer's job is to figure out how to figure out things, not actually figure them out as is the case for an engineer or a sysadmin. When you get into process you step outside of that even more and for management or architecting you step outside even further, and the problem here is you are building up a bigger and bigger house of cards with a lot of assumptions about how things will work and you are not even necessarily describing what the thing actually DOES, far and away the important piece to communicate to your coworkers.

If you have 15 programmers it's just unavoidable to lose a lot to mere process overhead, and you likely have to answer to someone to say how much time something will take or what the cost will be. There's some variance for projects and data is generally important to business projects but it is a mechanical process to figure this out and should not be seen as designing your actual program. For other projects really just defining behavior is the important part. There's a million ways to answer 'design' questions like how to organize data but generally you will settle into a template for certain types of projects anyway and you can only establish the merits of various approachs by actually doing them and refining them over time.

But ultimately, yes, code like hell. That doesn't mean code blindly but you will quickly realize as you code "hey I need this. And that. And that.", all kinds of stuff that even a barebones prototype will have to address. Not to mention 99.999999999% of people who might use the software but are not programmers are totally incapable of seeing what's wrong with something (at least in their eyes) just by descriptions or even mockup screens that don't do anything. But of course reality comes in to play for things like legal contracts, or process requirements of customers or needing to have some good CYA on the estimate of the project.

This is my thread. There are many threads like it, but this one is mine.

Let's assume it's a non-trivial task.

The first thing I do is think about the end user. If you are not thinking about the end user, you're going to fail. What are they trying to accomplish? How can they best accomplish this task? Who are they? (Small/large target market, level of domain expertise, level of computing expertise). Sometimes, the end user is me, which makes these questions really easy. Other times, it's pretty nebulous.

Once I have a few key concepts in my head, I'll usually start prototyping.
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
I do nearly all of my thinking in my head; but I've always been like that, and I'm sure it's quite unusual.

On the occasion that I need to write something out, it's either in plain text in a text editor - random sentence-fragment scribblings of ideas as I go - or physically on a sheet of paper in front of me, with diagrams and everything. There's simply nothing an application on a computer can do that replaces this experience for me. The disconnect between mouse (or even drawing tablet) and screen is just too jarring when I'm working/thinking at that level.

This topic is closed to new replies.

Advertisement