PDA

View Full Version : Want to write a simple (maybe) program



coldnorth
07-27-2007, 06:21 PM
I have a little project going and want to produce a small stand-alone program and was wonder if someone could give some advice on what language or code to use and maybe point me to some online tutorials. Perhaps there is even a program that could be used to create this program. Thanks

Snee
07-27-2007, 07:06 PM
Err, that's a little vague, tbh.

What do you want it to be able to do?

In general I guess C# (.net) is easy to use, and you can try VS express (http://msdn.microsoft.com/vstudio/express/) for that.

Java is ok too, and you could use Netbeans (http://www.netbeans.org/) for that, for instance.

If you need a database with that, MySql (http://www.mysql.com/) is all right.


But it'd probably help if you were a tad more specific in what you want to do, if you want good advice.

coldnorth
07-27-2007, 07:15 PM
Thanks Snee. Yes, I guess I was a little vague, sorry about that. This is what I want to do. I wish to create a simple program, a small searchable database I suppose, that can run independently on a computer. Yes, a program I can sell either via download or on a CD. I wish to produce and sell a collection of specific recipes for a particular type diet, so I want something searchable, for example by ingredient or certain nutritional values. I do have a technical background, but it is not software related-Mechanical Engineering. My code writing experience and ability is currently limited to HTML. So I am really just exploring the possibilities of doing this myself, as I would like to acquire some code writing skills. Thanks

Does anybody know anything about this? Thanks

http://www.sqlite.org/

What about Visual Basic? Would this work for what I have described? Will it create a program that will run independently on another computer? Would there be licensing issues? Thanks

Snee
07-27-2007, 08:45 PM
Well, I've done similar things (Graphic interface, searchable database) with Object Pascal (Delphi), Java and C#, in combination with SQL (SQL server, MySQL, Interbase). As for what is best of those for what you want performance-wise I couldn't tell you. What I can tell you is that it's all fairly easy to learn. Remember to do as much as possible with SQL-requests (adding, searching etc.) and personally I'd start off planning the database so you know what you'll be searching for and what you need in your GUI.

If I was doing something like that right now, I'd probably go with C# (assuming .net is cool with you), but that's mostly because I worked with it last.

I haven't tested that SQLite thing, but it sounds nice.

As for tutorials and such google is always a good place to start, I also remember checking this place (http://www.codeproject.com/). Picking apart someone else's examples is usually a good way of learning. And obviously, you can always come back here, if you wonder about details.

optimus_prime
07-27-2007, 08:53 PM
my personal opinion is that easiest thing would be visual basic 6 and access database.

it's far from ideal, but it is easy, deployable and database sure can handle anticipated volume.

on the other hand, if you're learning programming for future projects, .net is probably way to go, visual basic or c#, whatever syntax you prefer.

coldnorth
07-27-2007, 08:58 PM
Thanks Snee. Right now I am reading an online tutorial on C+ located at http://www.cprogramming.com/tutorial/lesson1.html I would be very interested in any tutorials that anyone is aware of and would recommend. This is all new to me and seems rather overwhelming but I am interested in the subject.

I do not think the project I have in mind is too ambitious for a first project but, for all I know, I could be wrong. To give you a better idea of what I want to do. I have a large collection of recipes. The user opens the program and can search for recipes, for example, Beef recipes, or recipes under 100 calories, etc. Again, I want a program I can sell, that could be downloaded or e-mailed, so license issues is something I would need to consider.

Thanks again for all of your help.


my personal opinion is that easiest thing would be visual basic 6 and access database.

it's far from ideal, but it is easy, deployable and database sure can handle anticipated volume.

on the other hand, if you're learning programming for future projects, .net is probably way to go, visual basic or c#, whatever syntax you prefer.


Thanks Optimus, I'll look into these as well. Access I have used in a business setting (engineering drawing database). Wouldn't the end user need Access in order to run the program? What about Visual Basic, wouldn't they need a copy of that on their computer as well? I envision something that would run in the windows operating system.

I am interested in hearing anyone's ideas, suggestions, or opinions so please post if you have any. Thanks

Snee
07-27-2007, 11:14 PM
What you have in mind sounds simple, and very similar to the first real programs I wrote at uni.

Access might be a good alternative assuming you don't need everything SQL can do. Haven't played around with it myself, but from what I understand an access database can be self-contained, this buddy of mine who uses it says it's brilliant in conjunction with php on websites for that reason.

As for VB, I reckon it's compilable just like the languages I suggested. It's easy to make an .exe, if I understand things correctly. Any decent environment should make that very simple for you.


EDit: Start off by downloading something like Visual Studio (if you want to go with C#, anyways) and start playing around with it. Write simple functions, something to output a string to the console perhaps, and see how that works. Also see if there are any examples you can download, and if so, pick them apart. Once you've gotten a feel for the basic syntax, everything will become much clearer.

coldnorth
07-27-2007, 11:35 PM
Thanks Snee. I downloaded a program called Just Basic. It's suppose to help you create stand alone programs in basic but, to be honest, it's lost me already. I still looking. Thanks again.

coldnorth
07-28-2007, 06:54 PM
I was wondering if anyone might know of a freeware program that I might be able to adapt to my needs? Something that would have no license issues.

optimus_prime
07-29-2007, 09:48 AM
i'm not sure what way you decided to go, but there are tons of free code dealing with database in all programming languages. just google, there are lots :)

as far as i understand, your software has only one table, the recipes one, and that's basic stuff, you can find examples for it in any programming book and on any learning site. just be patient and persistent :)

if your recipes are unsorted, maybe it would be good start to create database first and deal with the ui later. design it on paper first (like "it would have following fields: index recipe nutritional value type of diet"...) than transfer it into access or sql - whatever you feel more comfortable with. i advise you to use access because it's pretty simple and well explained, and your database is small and won't choke it. than use some visual tool to create ui (like delphi, visual studio or whatever) and connect it to database. every step of these basic operations will surely be explained in the help of apps you decide to work with.

4play
07-29-2007, 11:07 AM
I dont understand why you dont just make a php website with a mysql backend and have people login.

there are already plenty of cms's you could just edit the design of and your away. it also means that you can sell this to anyone with a web browser which is pretty much everyone these days.

you would easily be able to add more recipes and everyone would be able to view them rather then pushing out a binary update to everyone every time you want to add a new recipe.

coldnorth
07-29-2007, 03:14 PM
i'm not sure what way you decided to go, but there are tons of free code dealing with database in all programming languages. just google, there are lots :)

as far as i understand, your software has only one table, the recipes one, and that's basic stuff, you can find examples for it in any programming book and on any learning site. just be patient and persistent :)

if your recipes are unsorted, maybe it would be good start to create database first and deal with the ui later. design it on paper first (like "it would have following fields: index recipe nutritional value type of diet"...) than transfer it into access or sql - whatever you feel more comfortable with. i advise you to use access because it's pretty simple and well explained, and your database is small and won't choke it. than use some visual tool to create ui (like delphi, visual studio or whatever) and connect it to database. every step of these basic operations will surely be explained in the help of apps you decide to work with.

Thanks optimus. I'll stick with it as I do find it interesting and would like to learn a bit of programing. Thanks again for your help and advice.

You too 4play. I have considered just doing a website, and I might. Thanks

Snee
07-29-2007, 09:28 PM
as far as i understand, your software has only one table, the recipes one, and that's basic stuff, you can find examples for it in any programming book and on any learning site. just be patient and persistent :)

I don't know if just having one table is a good idea if he wants to run searches on ingredients. It might be better to store ingredients on their own table as there are more than one ingredient to one dish and not a fixed number of ingredients in dishes.

EDit: It is possible to do it with one table, obviously, by checking for a substrings in the ingredient field, or whatever. But I might do it with more tables. Maybe one table for dishes, with comments about each dish, like what they are good for or whatever, diet perhaps, then one table for ingredients, possibly with a nutritional value per gram of that ingredient, and one table linking the two other tables, with one row for each combination of dish and ingredient, with the amount of the ingredient in grams. If I needed the nutritional value of each dish I'd calculate it from the sum of the nutritional values of its ingredients. If he wanted to be very specific about what was in each ingredient I might split things up even further.

Barbarossa
07-30-2007, 08:22 AM
I agree with Snee. Nice systems design :smilie4:

optimus_prime
07-30-2007, 02:15 PM
EDit: It is possible to do it with one table, obviously, by checking for a substrings in the ingredient field, or whatever. But I might do it with more tables. Maybe one table for dishes, with comments about each dish, like what they are good for or whatever, diet perhaps, then one table for ingredients, possibly with a nutritional value per gram of that ingredient, and one table linking the two other tables, with one row for each combination of dish and ingredient, with the amount of the ingredient in grams. If I needed the nutritional value of each dish I'd calculate it from the sum of the nutritional values of its ingredients. If he wanted to be very specific about what was in each ingredient I might split things up even further.

of course you're right, and he could also add separate table for diets too :D
in the end that all depends on the data available to the op, so that's probably the major thing that will guide his design :)

coldnorth
07-31-2007, 12:17 AM
Is there a particular book that anyone would recommend for someone wanting to write code? How about one of the Idiot's books?

4play
07-31-2007, 10:32 AM
depends what sort of code you want to write?

coldnorth
07-31-2007, 01:15 PM
I'm thinking C+ but, again, this is something I'm new at and do not have a full understanding of.

4play
07-31-2007, 05:56 PM
c++ primer (http://safari.oreilly.com/0201721481) is well worth a read. just have a look on torrentspy for it.

coldnorth
07-31-2007, 07:35 PM
Thanks. Looks better than some of the tutorials I have been reading.