10 Replies - 4721 Views - Last Post: 10 December 2011 - 02:26 AM

#1 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 753
  • Joined: 31-August 11

How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 01:32 PM

so I've done programming for awhile. Something that gets me; more complicated projects like yesterday I was thinking about making an application for web cam snap shots etc. and adjusting the brightness. To do this from what I've seen you need some libraries etc.

That's where the confusion begains you can use someone's libraries and Directshow etc. Opencvdotnet is another libraby and the list goes on. Now I understand c sharp but what
I don't understand is how someone knows the proper functions delegates etc. strings etc. to use in an elaborate program like a web cam recorder. So like where do you begin with projects like that? etc.

Why would you use libraries?

Also why do you technically need libraries? Could someone write there own web cam program without libraries and if so how? Again how would someone know how to go about doing that?

I know these seem like dumb questions but hopefully someone can point me in the right direction?

This post has been edited by adn258: 11 September 2011 - 01:32 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How Do Programmers Begin Complicated Programs?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,217
  • Joined: 23-August 08

Re: How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 01:38 PM

Moved to C# Programmers for discussion.
Was This Post Helpful? 0
  • +
  • -

#3 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 995
  • View blog
  • Posts: 2,386
  • Joined: 04-October 09

Re: How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 01:41 PM

I begin by deciding what it is I want the program to do. From there I break it down into classes. From there I develop each class (and sometimes have to go back and rethink my design). Once everything is done, it's done :)

I use libraries because I don't want to spend the time writing my own version of the code. Someone else already did it and I consider my time worth something.

You don't need libraries, they just help by giving you things that you don't have to spend time developing yourself. You could write your own web cam program without using a library, the people who wrote the library did! You know how to go about doing things by reading documentation. Somehow your computer 'talks' to the web cam. Figure out how it does and how you can 'talk' to it and what kind of responses you'd get. Develop code around this knowledge.
Was This Post Helpful? 3
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,357
  • Joined: 02-June 10

Re: How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 05:22 PM

I start on a whiteboard and conversing with co-workers as to the needs and features... the GUI... the way they think it should look and feel. Then I take that whiteboard and work out all the objects and communication. I try to visualize the operation from the user's stand point. I 'work' the entire application, realizing that when it comes to ... uh ... print at the end... I should have retained this bit or that object... and go back and fix that in the whiteboard plan.

Then I take all the input and all the planning and make a ToDoList breaking it all down. This give me my hierarchy, classes, methods, notes, links to images and so on.

Then I start coding, using the job timer feature in ToDoList. That way I can track how long each part takes. All bosses always want to know "How long would it take you to make a program that does x, y, z?" By timing everything I do I can keep a fairly accurate judgement of my skill and speed. When I say "It will take 120 hours"? And the boss says "Really? Why so long?" I can show him the last three projects and the times it took for each part.

Complex programs are really just lots and lots of planning first, then coding lots of smaller, not so complex parts. If one is following proper OOP principals and coding for 'black boxes' of code that do one dedicated purpose with no side affects, then everything is really just small blocks of straightforward coding.

Q: How do you eat an elephant? Its so big. It seems like a daunting and impossible task.
A: 1 little bite at a time.
Was This Post Helpful? 2
  • +
  • -

#5 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,055
  • Joined: 28-December 10

Re: How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 05:39 PM

1. Find the main problem to be addressed by the program

"Create a music site in x days"

2. Find subsets of that problem

"What do we need to implement..."(List of features, what language needs to be used, resources)
"Do we know how to do these things..."(If Y, proceed, if no, find proper solutions such as external libraries)

4. Identify classes and draw flowcharts + document

5. Code

6. Test

7. ????

8. Fail? Go back to 5(see the codes first) and 4 if necessary.

9. Success? Celebrate!

10. Oh, they didn't tell you you have to maintain it. :P
Was This Post Helpful? 0
  • +
  • -

#6 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 753
  • Joined: 31-August 11

Re: How Do Programmers Begin Complicated Programs?

Posted 11 September 2011 - 06:02 PM

View PostfromTheSprawl, on 11 September 2011 - 05:39 PM, said:

1. Find the main problem to be addressed by the program

"Create a music site in x days"

2. Find subsets of that problem

"What do we need to implement..."(List of features, what language needs to be used, resources)
"Do we know how to do these things..."(If Y, proceed, if no, find proper solutions such as external libraries)

4. Identify classes and draw flowcharts + document

5. Code

6. Test

7. ????

8. Fail? Go back to 5(see the codes first) and 4 if necessary.

9. Success? Celebrate!

10. Oh, they didn't tell you you have to maintain it. :P


Thanks for your input guys. So how do you magically know how to create libraries though? In the case of the web cam I know technically you need to be able to talk to the web cam but how would someone research writing a library for that? It's still confusing lol.
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,357
  • Joined: 02-June 10

Re: How Do Programmers Begin Complicated Programs?

Posted 12 September 2011 - 01:51 AM

There's nothing magic.
A library is just a collection a code for a targeted shared purpose.
Its all code that goes together because it makes sense to go together to serve a purpose. And probably so it can be moved together to share across projects or give to other developers.

There are vendors out there who makes libraries of controls. Maybe you want a bunch of controls that look like car dashboard gauges. A library works well for that.

Maybe you manufacture barcode scanners. So you need to provide a library of methods so your customers can *use* the barcode scanners.

Maybe your company makes 12 different applications and you need for them all to talk to each other over TCP/IP using your companies specific protocol. You might be able to do that with one class that all the programs use. So you export it as a DLL (Dynamic Link Library). Just because it is a library doesn't mean it has to be huge.
Was This Post Helpful? 1
  • +
  • -

#8 aklo  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 229
  • Joined: 23-January 09

Re: How Do Programmers Begin Complicated Programs?

Posted 07 October 2011 - 09:37 PM

I have the exact same question...well almost exact.

How to know what namespace i need for a particular project and the class in the name space...i mean do professionals really browsed through every single c# documentation for all these? Even so the description is difficult to understand.
Was This Post Helpful? 0
  • +
  • -

#9 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,357
  • Joined: 02-June 10

Re: How Do Programmers Begin Complicated Programs?

Posted 08 October 2011 - 06:51 AM

When you start a project it is generally in its own namespace. There is nothing to *know* as you are making it.

If I am starting a new project and the application is going to be called 'Widget' and consist of a Client and a Server portion then the namespace is probably going to be 'Widget'. The solution will probably have projects (and therefore classes of) of 'WidgetClient' and 'WidgetServer'. Then what do I need inside of those? A class of a 'Sender' and a class of a 'Listening'.

You just take one 'thing' and break it down to its smaller 'things'. Then take each one of those and break them down to their smaller components and so on.

As for the .NET framework. Well, yah it is a matter of experience and doing a LOT of reading and create of solutions and looking around and reading and research. There is no magic here. Its work.

If you know you are working with files and folders then you are in the System.IO area.
System.IO.Files
System.IO.Directory
System.IO.Paths

and so on.

After a while you just get a 'feel' for it. You start thinking the way the framework developers did. You start to think...

Quote

If I were making a bunch of commands that were all for dealing with the serial ports, where would I put them? System.IO.Ports.Serial


Then you start typing it and Intellisense shows you that you were right.

And if you look at the naming you can see it trickles down from more general to more specific.
Just like web addresses.
US.IL.Chicago.SchoolDistrict.District9.Highschool3.edu\CompLab4.Seat6

Just like object inheritance.
  • Class Creature
  • Class Mammal : Creature
  • Class Canine : Mammal
  • Class Doberman : Canine

Was This Post Helpful? 0
  • +
  • -

#10 RexGrammer  Icon User is offline

  • Coding Dynamo
  • member icon

Reputation: 181
  • View blog
  • Posts: 777
  • Joined: 27-October 11

Re: How Do Programmers Begin Complicated Programs?

Posted 30 October 2011 - 01:11 PM

To me a great help was this book although it isn't a projecting book it offers great tips and examples on creating a project... GREAT BOOK
What I do:
Think of what I want (What does the program offer, ...)
I make a quick UI prototype...
Think of what classes I need... I use the Class Responsibility Collaborator (CRC) Models... some info on them here
Think of public interfaces needed in the program (and make a prototype...) [no realization!]
Slowly provide realizations from the most simple to the most comlicated...
Also having a whiteboard helps a lot...
Make sure you invest a good amount of time into projecting (I do that usually in a day) [That leaves me time to think of all other things...]
Was This Post Helpful? 0
  • +
  • -

#11 Todilo  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 85
  • Joined: 13-November 07

Re: How Do Programmers Begin Complicated Programs?

Posted 10 December 2011 - 02:26 AM

View Postadn258, on 11 September 2011 - 02:32 PM, said:

so I've done programming for awhile. Something that gets me; more complicated projects like yesterday I was thinking about making an application for web cam snap shots etc. and adjusting the brightness. To do this from what I've seen you need some libraries etc.

That's where the confusion begains you can use someone's libraries and Directshow etc. Opencvdotnet is another libraby and the list goes on. Now I understand c sharp but what
I don't understand is how someone knows the proper functions delegates etc. strings etc. to use in an elaborate program like a web cam recorder. So like where do you begin with projects like that? etc.

Why would you use libraries?

Also why do you technically need libraries? Could someone write there own web cam program without libraries and if so how? Again how would someone know how to go about doing that?

I know these seem like dumb questions but hopefully someone can point me in the right direction?


First off, not a dumb question. I have often wondered about how .dll are made and how people can interact between applications. Still somewhat of a mystery but as you dig into this things, the magical box gets opened and you understand how it works.

For the question about writing your own webcam app I think its basically like this. First, if you did not make the webcam app yourself but have NO drivers or base-progam you pickup the Specification. The specs tells you what kind of transfer is done on the USB channel, what bits means what etc. From here you create bitwise communicatino on the usb port. When you have created functions and layered the low-level stuff you build on it to create high-level functions. From that you start using it in your application, and woalla you have your own library :D. The reason people use libraries is 1, they are lazy. 2 why re-invent the wheel. 3 libraries are often tested by multiple users so you use a stable code-base. 4 its a lot quicker! 5 if something does not work, you can get help.

Over and out.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1