Programming style/habbits

How do YOU do it?

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

42 Replies - 5854 Views - Last Post: 05 April 2008 - 10:40 PM

#16 ferrari12508  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3
  • View blog
  • Posts: 1,115
  • Joined: 02-November 07

Re: Programming style/habbits

Posted 19 March 2008 - 02:12 PM

Normally i just make a slapjack program for the programming class i take. After i make the first version and make sure it works, no matter how sloppy the code, I save it. Then i go back after i have it working and i make a more elegant program which allows me to have it done my way fast and then just go back and fix it up.
Was This Post Helpful? 0
  • +
  • -

#17 Kiriran  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 60
  • Joined: 11-April 07

Re: Programming style/habbits

Posted 19 March 2008 - 03:00 PM

I don't compile everytime I add a new block, but when I add new functionality. Then I build it and run the unit tests. If they succeed I have a little test application where I use the class like in a "real" use case. Double checking.

I'm a fast coder. This is, I belive, because I have unit tests and because I refactor a lot. It goes like this:
I write some code, look at it, refactor if needed, write some code, look at it, ect. As soon I have a new function, I write the unit test, build it and test it. Double check in my little test application.

Seems like a lot of work at first glance, but because my code is clean (refactoring) and tested I don't have to debug a lot and can save a lot of time.

Of course I need an IDE (I <3 NetBeans) to support me for all the refactoring I do. I'd never do it by hand in a texteditor :P
Was This Post Helpful? 0
  • +
  • -

#18 spearfish  Icon User is offline

  • Monkey in Training
  • member icon

Reputation: 10
  • View blog
  • Posts: 746
  • Joined: 10-March 08

Re: Programming style/habbits

Posted 19 March 2008 - 06:59 PM

You C-men have it tough :)

For PHP you just reupload and refresh; HTML / CSS is just saving and refreshing.

How long does it take to compile?
Was This Post Helpful? 0
  • +
  • -

#19 Mikhail  Icon User is offline

  • Bastard Operator From Hell
  • member icon

Reputation: 58
  • View blog
  • Posts: 1,378
  • Joined: 26-October 07

Re: Programming style/habbits

Posted 19 March 2008 - 08:15 PM

For me it usually compiles withing seconds up to a full minute, depends on how big the program is as For PHP I just save it locally and preview. When its all good I upload it to the intranet server.
Was This Post Helpful? 0
  • +
  • -

#20 .Maleficus.  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 129
  • Joined: 07-March 08

Re: Programming style/habbits

Posted 20 March 2008 - 03:59 AM

I compile and run after every new block I write, mostly because I'm still learning Java and need to see if what I'm writing actually works :D. In VB.NET I don't compile that much because I'm quite comfortable with it, and with HTML/CSS I save/reload frequently when big changes are being made.
Was This Post Helpful? 0
  • +
  • -

#21 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Programming style/habbits

Posted 20 March 2008 - 04:19 AM

For making web pages I won't check the actual html until it's pretty much written because Dreamweaver keeps an eye on the structure for me. It's a very different story when I get into styling though, where I'll update the server every few rules to make sure all is well.

In Flash I'm often guilty of creating entire classes without checking them first, and in some cases I've even written several extensions before compiling and finding a fundamental floor somewhere. :rolleyes:

My biggest problem I think is not properly planning what I'm going to do before I start, especially for an OOP project. I just like to get in there and start coding! How much planning/diagramming does everyone else do before you jump in?

This post has been edited by thehat: 20 March 2008 - 04:23 AM

Was This Post Helpful? 0
  • +
  • -

#22 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Programming style/habbits

Posted 20 March 2008 - 04:51 AM

I completely plan/draw out every object I'm going to need and how they interact with the other objects before I ever write the first line of code. Some may think that slows you down, and at first it does, but it sure prevents me from getting lost later on down the road, and prevents me from having to change the path I'm currently on because the logic in my head was flawed.
Was This Post Helpful? 0
  • +
  • -

#23 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Re: Programming style/habbits

Posted 20 March 2008 - 05:07 AM

My programming style needs rectified in the sence that I should create diagrams and flow charts for every class and application I create, however I usually don't do this.

I like 1lacca, am fairly confident in the code I produce and often don't use an IDE when I provide answers to questions... sometimes even snippets. However mostly anything that requires more than two or three methods I usually I code it in an IDE, and I always use a project called Sandbox (just something I have adapted to do when I am just mucking around, I haven't bothered to find a better solution :P ).

One of my major weaknesses when I am programming however... I am always looking for ways to make my program faster. If a function can be simplified using the preprocessor etc, I am always looking for ways to make things better, until I am happy I have done enough to make it faster.

So for the most part, I compile often enough that I'm confident my code is working, but at the same time often enough that if there is a major problem I should be able to filter it out without many problems. :)
Was This Post Helpful? 0
  • +
  • -

#24 ScottBrady  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-January 08

Re: Programming style/habbits

Posted 20 March 2008 - 05:22 AM

Your not the only one.

I too do this much to my bosses distaste. But my argument to my boss is what is todays proof of concept is tommorrows full production application. Besides most
managers that see a proof of concept application automatically think its ready for production even if the developer(me) says it isn't.

When I write a class I like to get all CRUD functionallity done first( CREATE REMOVE UPDATE DELETE) then integrate these classes into the front end application
be that web or windows forms.

I am a pedantic programmer and will often choose getting the done right the first time rather than getting it done fast and full of errors and incomplete.

Regards

ScottyB

View PostNickDMax, on 19 Mar, 2008 - 07:44 AM, said:

Another thing I tend to do that seems to irritate my boss (in that way where you can't tell someone they did wrong, but you wish they would have more sense) is that when I write a class I tend to write a complete class.

To explain what I mean by this I will give an example: In a recent POC (proof of concept) I had to write a class that would write auditing information to a database. Now the only requirement was that entries get written -- since it is a POC and not a solution the code was never expected to function past testing. BUT I went ahead and added other functions to update entries, to delete entries, to delete old entries etc. -- a complete auditing class. Nice to have, but now I have a class where only about 20-25% of the code was actually used/required.

I understand that sticking to the requirements document is important since "added functionality" leads to support problems later. But I can't help it, when I am building a class I tend to add in all the functions I think that Object needs.

Was This Post Helpful? 0
  • +
  • -

#25 jeronimo0d0a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 146
  • Joined: 03-March 08

Re: Programming style/habbits

Posted 20 March 2008 - 07:49 AM

I'm a firm believer in planning your code before writing it. I think it saves time and aggravation. At work now, design is done before a language is even selected sometimes. Code is just code. I'm also like NickDMax in that I like to write complete classes. I just finished one where the spec only called for overload on > and == (in C++) but that seemed to confuse clients of the class who didn't understand why they couldn't use <. Good design requires anticipation of future needs but usually pays off. When do people come ask me to take some features out? That would be easy!

This post has been edited by jeronimo0d0a: 20 March 2008 - 07:51 AM

Was This Post Helpful? 0
  • +
  • -

#26 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: Programming style/habbits

Posted 20 March 2008 - 08:51 AM

I like to see how well I can write the code, so I try to write everything out first, then compile and work through errors if there are any. The programs I have been working on are small, usually around 100 lines of code, so it's easy to fix it up.

As soon as my skillz develop and I'm writing some crazy code, then I will probably compile after each function at least.
Was This Post Helpful? 0
  • +
  • -

#27 thepeon  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 04-February 08

Re: Programming style/habbits

Posted 20 March 2008 - 02:54 PM

I am very new to coding, and even newer to classes, so in the main program, I will usually compile and test each part of my classes, but I normally write out all my classes before I compile. If I'm using local functions, I will compile after I write each. I am still learning how the different files in a C++ solution fit together and link, which is why I write them all first. I want to know that I made a mistake and not that the compiler is looking for code I haven't written yet.
Was This Post Helpful? 0
  • +
  • -

#28 _net  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 146
  • Joined: 23-September 07

Re: Programming style/habbits

Posted 20 March 2008 - 11:22 PM

I do what most of the guys here mentioned already, compile, text and debug.

In programming in C++, I dont compile so much as it takes sometime. I am not the fastest coder, but I guess your speed depends on how well you know what your making.

I usually think over, manage my programs before actually coding them. I use a piece of paper, or a sticky note on my machine or something. This saves me from writing header files then staring at the screen for what-to-do next.

in C++, basically I compile whenever I make a big change, or start to get unsure of how this code might run.

In php/html scripting its different, I sometimes test when I'm done 25% of it done, and most of the time 50% of the script. I write my codes local server first, test, then upload :D
Was This Post Helpful? 0
  • +
  • -

#29 captainhampton  Icon User is offline

  • Jawsome++;
  • member icon

Reputation: 13
  • View blog
  • Posts: 548
  • Joined: 17-October 07

Re: Programming style/habbits

Posted 21 March 2008 - 07:04 AM

I test and compile constantly to ensure any mistakes that are made are easily accessible to find and fix.
Was This Post Helpful? 0
  • +
  • -

#30 Jingle  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 317
  • Joined: 20-October 07

Re: Programming style/habbits

Posted 24 March 2008 - 04:11 PM

it depends on what computer im working on and how extensive the program is.
when im compiling off my thumbdrive it will tack at least a minute to do the hello world.
so you can imagine what it is like when it gets bigger. sometimes i will compile and test blocks separately.
if im on a faster computer and i'm not using the compiler on my thumbdrive i build every thing very frequently
and often write code to test my code.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3