|
|
|
|
| View previous topic :: View next topic |
| Author |
Message |
Johny Fake
Daedalian Member
|
Posted: Tue Jan 11, 2011 11:38 pm Post subject: 1 |
|
|
I've searched other forums for the answer to this question. I discovered that is the most hated question, due to its unanswerable nature...at least as it is usually asked. I hope to clarify enough to make it answerable.
What is the best programming language to learn?
I am attempting to learn a computer programming language. Instead of trying to learn the currently popular, or least expensive (assuming PERL or Python), I've decided to chose a program that I want to create, and then choose a language that can help me do it. I am not doing this for work, this is only a hobby. I've tried learning a language before but given up as I had no clear objective...hopefully the new approach will help.
I've decide to design something for my wife. A GUI program with Windows that will allow her to input recipes, or multiple recipes (say for a month of meals). I'm picturing lots of drop-down menus, with new fields that she can add. After she chooses from some recipes, it can generate a shopping list. That's the basics without getting into too much detail. There are existing programs out there that already do this. But again, the primary purpose is for me to learn a language with this type of functionality. Price is a consideration. Any ideas?
BTW, I've only programmed with very basic stuff in college (creating basic web sites). I am a true beginner. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Tue Jan 11, 2011 11:45 pm Post subject: 2 |
|
|
Perl is my favorite, but it's borderline useless for what you want.
If you want to go the "easy" route, I'd suggest Microsoft Access for that.
If you want to go a bit more difficult, get Visual Studio and write it in Visual Basic.
If you want to really "get something out of it" then go with C++ (or, to a lessor degree C#.)
If you want to write it in PHP, I can hook you up with a website on glpics (something like jf.glpics.com.) The nice thing about php is that you can run a sqllite database (or mysql if you *really* want to) and it can be accessed anywhere that has internets.
IMHO... "programs" are going away and "webapps" are coming to be.
Google Docs has some pretty sweet interfacing (you can even do public forms that accept data and insert the data into spread sheets.) _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Tue Jan 11, 2011 11:47 pm Post subject: 3 |
|
|
BTW... the route you're taking is the "correct" one. The reason the question is so hated is because it really depends on what you want to do with the program, who your audience is, and how much work you want to put into it. _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Tue Jan 11, 2011 11:51 pm Post subject: 4 |
|
|
Thanks Chaz!
I am leaning toward C++ or C# now. Would either seem more appropriate? |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Tue Jan 11, 2011 11:52 pm Post subject: 5 |
|
|
| Oh, and what kind of cost should I be anticipating? |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Tue Jan 11, 2011 11:59 pm Post subject: 6 |
|
|
Either way, I'd go with Visual Studio... you probably don't need the latest version, so check on Ebay for previous versions that are on sale. (2005 should be adequate.)
If I had to guess, I'd say you should plan on spending about about fifty to a hundred bucks. You could also look into the student editions if you're a student (though you can't sale the app if you use that version.) _________________ The enemy's base is down. |
|
| Back to top |
|
 |
wordcross

|
Posted: Wed Jan 12, 2011 12:37 am Post subject: 7 |
|
|
The nice thing about C++ (and I assume C#, but I've never used it) is that you can generate an exe file to use even if you don't have a compiler for C++.
If you have done some simple html programming before, that could be a good starting point for getting into php and sql. That's how I got into it, and something like you're describing wouldn't be too difficult to do in a browser. And html is already set up to do things like menus and form submission. php and sql are generally very compatible with html (php especially). _________________ Has anyone really been far even as decided to use even go want to do look more like? |
|
| Back to top |
|
 |
Zag
Unintentionally offensive old coot
|
Posted: Wed Jan 12, 2011 12:54 am Post subject: 8 |
|
|
Eclipse is free and at least as good as Visual Studio. www.eclipse.org
It is originally intended for Java, but there are C++ and C# plug-ins. |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 1:19 am Post subject: 9 |
|
|
Thank you Zag and word. Eclipse sounds very affordable, thanks for the link. Is the Eclipse IDE for C/C++ Developers the sort of thing I need. There's not much description with link (not that I want to complain about a free download, it's just that for a beginner it is sometimes hard to understand).
I plan to look into php. However, I am leaning toward a non-web based app. But perhaps I'm not thinking this all the way through. I would want the app to be usable without online access. I would also like it to maintain the recipe files on the hard drive. (this does sound like something that Access is built for as Chaz mentioned, but that would defeat my primary purpose) |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 1:35 am Post subject: 10 |
|
|
I think I tried Eclipse a while back, but it seemed flaky. I'll have to check it out again. Visual Studio seems to have the best interface, but it's so bulky (and I'm not a huge fan of Microsoft.)
If you're going to do PHP, then I would fully suggest Notepad++. It doesn't have the auto-complete that Visual Studio et al have, but it's fast and simple.
For what you want, I would suggest PHP. It's not easy to do stuff offline (though more and more web apps can stand offline now), but it is nice to have access to it from any random computer (or phone, now.) Then one day when your wife is at the grocery store, she could use her fancy smart phone to check a recipe. You could even buy a fridge that keeps inventory for you some day. =D
If it *has* to be offline, there probably isn't a better start for you than MS Access (or Open Office has one called.... Base that is free (and awesome.) _________________ The enemy's base is down. |
|
| Back to top |
|
 |
JFake*
Guest
|
Posted: Wed Jan 12, 2011 1:48 am Post subject: 11 |
|
|
| Chaz wrote: |
| You could even buy a fridge that keeps inventory for you some day. =D |
Nice
The ability to do this from a phone! I had not considered that. Then she could make changes/swap recipes while at the store based on deals that were available. Now I have to consider php. This would require me to have a server though, right? |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 3:09 am Post subject: 12 |
|
|
Like I said. You're welcome to a glpics account. I have to pay for the account anyway (for other sites I have), so I don't mind at all.
It would have to be something like http://jf.glpics.com or http://jf.itsafact.org or one of the other domains I have. You could even register your own domain and I'll set you up. I wouldn't charge you for the hosting, of course, since glpics is free for all GLers, but you would have to pay for the domain (if you wanted something other than a subdomain of glpics (jf.glpics.com) or one of the other twenty or so domains I already own.)
In other words, I would let you have a free place to try this out. If you wanted to use your own domain jfwifesrecipes.com for example, then you would have to register and pay for your own domain. _________________ The enemy's base is down. |
|
| Back to top |
|
 |
MNOWAX
0.999... of a Troll
|
Posted: Wed Jan 12, 2011 6:03 am Post subject: 13 |
|
|
Cobalt is the wave of the future!
in 1970. _________________ The Man The Myth The Legend
MNOWAX |
|
| Back to top |
|
 |
Antrax
ESL Student
|
Posted: Wed Jan 12, 2011 7:45 am Post subject: 14 |
|
|
Perl is completely ass. Visual Basic is mostly ass. PHP belongs to a completely different domain. Cloud computing is a rehash of the 60s.
With that out of the way, I can address the original question. I normally recommend people learn Python. The reason is that there are good, free development environments, that you get results relatively quickly and that it's incredibly flexible so you can get to do a whole bunch of stuff that would be difficult with other languages. That being said, from your description, it sounds like Java or C# would be more suited for that recipe program, so if that reflects your expected usage, one of them would be better. Since you don't already know C, there's no reason to prefer C#, so I would go with Java, even though I personally hate Java and Eclipse like the plague. _________________ After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick! |
|
| Back to top |
|
 |
Lepton*
Guest
|
Posted: Wed Jan 12, 2011 9:26 am Post subject: 15 |
|
|
Chaz, why are you sitting on itsafact.org?
Since no-one has said it yet, I feel compelled to point out that graphics are not a great deal of fun. It might be easier (from the making-it-look-nice angle) to go the PHP route with web pages/etc. I like the Google Docs suggestion, although I don't think it's quite powerful enough for this. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 2:05 pm Post subject: 16 |
|
|
It's a fact has an intent, that I may someday fulfill...
We (my brother and I originally) want to build a site of "facts" that link with citations to other "itsafact" domains.
It would have only obvious truths (like the world is round), obvious lies (like dragons exist), and obvious "points being made by Chaz or Joe."
It never really amounted to much (it would really need to be a wiki style site with users contributing), and just ended up being the sub-domain of choice for some of my friends who wanted a website.
-------------------------------------------------------------
Also, while I don't disagree with Antrax's idealism... I do disagree that perl is rubish. If you want manipulate strings (like a flat file of text) or run an AIM mafia bot, or just make a program that can practically guess what you wanted it to do even when you get the code wrong.... perl is where it's at; it just isn't at all useful for anything gui related. If you want to "script" something, there isn't a better platform than perl.
Although, Antrax's post did remind me of one thing, JF, if you're going to go the PHP route (and I think you should), then I'd suggest learning JavaScript as well. That's your key to "offline" pages that can live outside the cloud. Just have them check for a connection every now and again to "sync up." _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 3:48 pm Post subject: 17 |
|
|
Thanks to everyone for helping me make this decision. I am thinking PHP. It sounds like it wouldn't hurt to also learn Javascript and Java. Once I get a toe hold in each, then I can work out the path from there. Is there a certain order I should digest these?
Do I need the Eclipse for Java, Javascript, and PHP CGIs to program in each? I assume I use Eclipse or a similar program to make my "Hello world" programs along the way. |
|
| Back to top |
|
 |
Antrax
ESL Student
|
Posted: Wed Jan 12, 2011 4:04 pm Post subject: 18 |
|
|
Haha you lose, trying to code PHP without a dedicated server is a pain in the ass, good luck setting up an environment.
And Chaz, I wouldn't wish perl on my enemies, let alone to people who are trying to STUDY PROGRAMMING. May as well send him to learn whitespace. _________________ After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick! |
|
| Back to top |
|
 |
Chuck
Daedalian Member
|
Posted: Wed Jan 12, 2011 4:29 pm Post subject: 19 |
|
|
| I used assembly language on my TRS-80. Does anyone use assemblers any more? |
|
| Back to top |
|
 |
Antrax
ESL Student
|
Posted: Wed Jan 12, 2011 4:40 pm Post subject: 20 |
|
|
I can't think of a clever way to say it, but I do. _________________ After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick! |
|
| Back to top |
|
 |
JFake*
Guest
|
Posted: Wed Jan 12, 2011 5:22 pm Post subject: 21 |
|
|
| Antrax wrote: |
| Haha you lose, trying to code PHP without a dedicated server is a pain in the ass |
So now what? Any recommendations. |
|
| Back to top |
|
 |
JFake*
Guest
|
Posted: Wed Jan 12, 2011 5:22 pm Post subject: 22 |
|
|
| Antrax wrote: |
| Haha you lose, trying to code PHP without a dedicated server is a pain in the ass |
So now what? Any recommendations? |
|
| Back to top |
|
 |
Antrax
ESL Student
|
Posted: Wed Jan 12, 2011 5:27 pm Post subject: 23 |
|
|
Chaz said before he'll give you an account on his server, and I'm sure he knows of SOME development environment for PHP. I haven't found one I liked, which is in part why I code so little for the GL - because I have to debug it live on the GL  _________________ After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick! |
|
| Back to top |
|
 |
mith
Pitbull of Truth
|
Posted: Wed Jan 12, 2011 6:10 pm Post subject: 24 |
|
|
I use EasyPHP (Apache/MySQL/PHP install), which is fine for what little coding and debug I do these days. Might work if you want an offline solution, though Antrax will no doubt mock and ridicule it.  |
|
| Back to top |
|
 |
wordcross

|
Posted: Wed Jan 12, 2011 6:23 pm Post subject: 25 |
|
|
I taught myself php by writing in notepad (although Chaz's recommendation for Notepad++ is a good idea) and then uploading to my glpics account. php is what's called a server-side script since all of the script processes are done by the server rather than the local computer. So glpics is already set up to handle php code. And the way i did it it's free.
[Also, Chaz is super awesome for hosting =) ] _________________ Has anyone really been far even as decided to use even go want to do look more like? |
|
| Back to top |
|
 |
Jack_Ian
Big Endian
|
Posted: Wed Jan 12, 2011 6:59 pm Post subject: 26 |
|
|
I would not go the PHP route if you want to get something standalone running with the minimum amount of fuss.
There are too many things that need to be working in order for your application to work.
If it's purely for your own education then sure, you'll learn a lot about things you never thought you would need, as you check server parameters etc.
On the plus side though, there is an existing project in SourceForge that would do most of what you need and you can use it to learn while you tinker with it to get it to do what you want.
(see http://sourceforge.net/projects/phprecipebook/)
If you want to build it from scratch yourself, then Visual Studio Express and SQL Server Express are available free to download, but if you are only beginning to learn, then this might be a bit much to bite off as a first attempt.
I'd suggest starting with a small step. Use MS Access to set up a database with an ugly, but functional, interface. Although many here would say this is a simple step, if you don't know about database design, there will already be a lot for you to learn even at this juncture.
Once you can get the database designed the way you want, you should have a good idea what your ideal interface should look like. At this point you can scrap the project (while keeping the database and the knowledge you've gained) and build the snazzy interface you really want.
At that point you can decide which route to go for programming a snazzier interface. You can even still go the PHP route locally by installing Apache and you can still use it to be the front-end for the existing MSAccess database, though I would recommend you export it to another format (e.g. MSSQL or MySql)
Personally I would go the C++ route with SQL, but I've been programming so long I've forgotten how daunting a task that might be. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 8:38 pm Post subject: 27 |
|
|
To really answer your question, I think we need to know "why" you're doing this. What are you hoping to accomplish by building this?
Is it just to entertain you?
Are you hoping to one day use these skills in the work place?
Does your wife need the database, so you want to make it for her?
Do you want to be able to do stuff like this in the future?
Answer those questions, and I'll tell you which one I think is best for you. A lot of it depends on what you hope to gain from it.
Antrax's suggestion of C++ and SQL is probably the worst if you want the database and you want to make similar things in the future., but it's probably the best if you're looking to resale the skills or if you're interested in how programming works... _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 8:40 pm Post subject: 28 |
|
|
Oh. And Antrax's take on perl is very accurate.
It is my favorite language, but it's really not useful as a "programming" language. It's a scripting language.
The GL runs on php and mysql (though the old ubb forums ran on perl and text file databases (flat files).) _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 8:50 pm Post subject: 29 |
|
|
I finished my first tutorial on PHP. It seems like the perfect solution for an online edition of what I'm trying to create. I plan to continue the PHP lessons.
I (or more accurately, my wife) is a bookseller on Amazon. I just raided my basement for any texts I thought might be useful. There was nothing on PHP, but the online class I found seems adequate to get me started.
I did find a Programming with Microsoft Visual Basic.Net Core Reference (it includes a copy of Visual Studio.net for a 60 day trial use), as well as a couple of other tutorial books, including one titled Database Programming with Visual Basic.net. I also found some JAVA books, but they're over my head by a good bit at the moment.
The VB books were published in 2002/2003, so this is not the top of the line stuff. Still, they are free.
Chaz, you are the only one who mentioned VB. Are there any pitfalls I would encounter taking this path? |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 8:55 pm Post subject: 30 |
|
|
| Chaz wrote: |
To really answer your question, I think we need to know "why" you're doing this. What are you hoping to accomplish by building this?
Is it just to entertain you?
Are you hoping to one day use these skills in the work place?
Does your wife need the database, so you want to make it for her?
Do you want to be able to do stuff like this in the future?
Answer those questions, and I'll tell you which one I think is best for you. A lot of it depends on what you hope to gain from it.
Antrax's suggestion of C++ and SQL is probably the worst if you want the database and you want to make similar things in the future., but it's probably the best if you're looking to resale the skills or if you're interested in how programming works... |
It is somewhat to entertain me...but more to further my education. I like to learn new stuff, and programming has always been close to the top of the list of things I want to learn. It will not be a career, but it could be a good hobby.
To learn programming, I decided to choose the program to create, and then choose the language. My wife and I wrote down several ideas, and chose this program as the best. My wife could use the database, and will likely use it (assuming I can do it well) for many years, possibly decades.
I definitely want to be able to do stuff like this in the future. That is the primary point. But without the program as a goal, I'll eventually give up the education. It's happened before. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 8:58 pm Post subject: 31 |
|
|
Visual Basic is super easy to learn, but it can be very limited when you want to do things "out of the box." It's also significantly slower than C++ apps are, and, sometimes, requires runtime libraries (.Net programming is especially vulnerable to this pitfall.)
The major downside is that most programmers consider it to be a "beginner" language (which it is), so you won't have as much opportunity for collaboration efforts. The C++ communities are a lot stronger (which means more online resources) and the PHP online communities are even stronger than that.
If you're planning to do it online, I think I'd suggest javascript first... that way you will know what can be done client side, and what has to be server side.  _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 8:59 pm Post subject: 32 |
|
|
And, don't forget, you're welcome to a glpics account. Free of charge. I get nothing for doing it, I just do it because I'm a nice guy like that.  _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 9:23 pm Post subject: 33 |
|
|
Thanks again, Chaz.
I'm leaning two directions here, and probably will go both ways. I want to develop something on my machine at home that I can use without the net. Then I can recreate it for the net.
I am preferring the at-home version first, as the more control I have, the more likely I'll finish!!!
Once I have something she can use, then the PHP version can be a new project, with a new set of challenges.
If I do this at home, should I pick C++/VB...? Are any of these options free? how? Would it be enough to download Micro. Visual Studio Express for free and work with the books I have? Or would it be more beneficial in the long run to do this in C++? and is there a free compiler download that I can use? |
|
| Back to top |
|
 |
wordcross

|
Posted: Wed Jan 12, 2011 10:17 pm Post subject: 34 |
|
|
There are (or a least were, it's been a while for me) free compilers for C++ that are entirely adequate for a beginner. _________________ Has anyone really been far even as decided to use even go want to do look more like? |
|
| Back to top |
|
 |
Johny Fake
Daedalian Member
|
Posted: Wed Jan 12, 2011 10:55 pm Post subject: 35 |
|
|
Free compilers in C++ adequate for a beginner....fabulous. As I research these languages, C++ keeps coming up a a reoccurring theme. So I am inclined to try my hand at it.
Wikipedia has provided me with a list of compilers. It appears that Open Watcom is free, and works with all operating systems. GCC is also listed as free, and uses the Eclipse (among others) IDE.
So... if I download an IDE from Eclipse....I need to download a compiler as well? Or, if I download a compiler from Open Watcom, will it be an IDE all-in-one? (I've downloaded Notepad++ BTW)
The last time I learned to program, I was 10...there was no Windows (at least on my computer), I created BASIC files in DOS. I feel like an old man trying to speak into the mouse "computer ON!" |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Wed Jan 12, 2011 11:50 pm Post subject: 36 |
|
|
Old man with mouse...
C++ will be more difficult (and interesting.)
Visual Basic will be easier (but less functional, and less intriguing.)
If you configure it, Notepad++ can call GCC to compile the currently open document by hitting F5. I'm sure there are instructions on how to do this with a simple google search.
There are some better environments for writing code (some dev env have auto-complete so you don't have to remember every little command.) On the whole, it's hard for me to say what the best way to "learn" how to program is, since I had to learn it without auto-complete. _________________ The enemy's base is down. |
|
| Back to top |
|
 |
wordcross

|
Posted: Thu Jan 13, 2011 12:55 am Post subject: 37 |
|
|
When I was learning to program, I often coded in notepad for two reasons. One reason is that I could set the notepad font to a fixed-width format so I could tell by indention what was nested in what. The other was that it forced me to pay close attention to my syntax. If I missed a semicolon or a bracket, there was nothing to catch it for me before I compiled. This is a much more frustrating way of coding, but I think that I'm glad for it now. _________________ Has anyone really been far even as decided to use even go want to do look more like? |
|
| Back to top |
|
 |
Chaz
Vote: Zag
|
Posted: Thu Jan 13, 2011 1:11 am Post subject: 38 |
|
|
I agree with word.
Notepad++ isn't as unforgiving as Notepad.exe, but most of my websites were build using notepad.exe (it's even credited on http://www.chaz.name )
Mostly Notepad++ just makes it easy to compile (with the F5 key) and it lets you know when you've used a function that doesn't exist for whatever you're coding (because it's a different color.)
But if you really want to "learn" the language... use notepad.exe. _________________ The enemy's base is down. |
|
| Back to top |
|
 |
Jack_Ian
Big Endian
|
Posted: Thu Jan 13, 2011 1:48 am Post subject: 39 |
|
|
My first programs on the PC were written with EDLIN
Basic, PASCAL, Fortran77, 8086, C and even COBOL.
COBOL and FORTRAN were particularly difficult to edit because the column number was important for comments etc. and there were no cursor movement to allow you to count whitespaces.
Then a friend got a copy of WordStar for me. I felt like I'd died and gone to heaven.
I still know programmers that configure their editors to use the WordStar keyboard shortcuts. Ctrl-KB (block begin), Ctrl-KK (block end), Ctrl-KC (block copy) etc. (weird that I still remember them) |
|
| Back to top |
|
 |
Zag
Unintentionally offensive old coot
|
Posted: Thu Jan 13, 2011 1:49 am Post subject: 40 |
|
|
Baaah!
If by 'learn' you mean memorizing the specific signatures of specific functions that you need to call certain API's, then you will limit your learning to what I expect from a software engineer with 2 or 3 years' experience. That's the sort of learning that writing code with a simple text editor like notepad.exe will buy you. Even when calling APIs I have written, I don't always remember the exact names of methods, nor the order of the arguments, etc. Does that mean I haven't 'learned' those APIs? Hardly -- I wrote them.
Learning to program is a lot more than getting the syntax right. In fact, getting the syntax right gets in the way of learning to program, and a tool such as Eclipse or Visual Studio that helps with that part only frees you to do the actual learning. Instead, the much more valuable skill is learning to make good abstractions that enable your programs to appear very simple but, in fact, do very complex things.
I would liken the difference to two ways to learn to solve dropping problems in Physics. You can 'learn' the formula
s = 1 /
2
a t 2 + v
0
t + s
0
and how to plug numbers into it correctly, or you could understand that this is the second integral of a=a, why it is so, and how to derive it. I would argue that the latter is learning and the former is just memorizing. (I had to derive the formula in my head to write it above.)
----------
I've been trying to come up with an easy enough example of the sort of abstraction I am talking about that would be something JF could understand. I finally came up with this idea from his own program he has planned.
One of the elements you will need for your recipe is a list of ingredients. You might, as one choice, present this list as a set of text fields where the person entering the recipe would enter, for instance,
and the data would be stored as a string, just like that.
The problem is that another recipe that she is making the same night might call for
or even
and these would end up as separate items on the shopping list. If you have a lot of these, then it makes the shopping list unnecessarily unwieldy.
Another approach might be to have each ingredient have three fields on the screen, one for a number, another for the units, and a final one for the actual item. This enables you to add up the total amount for common items when making a shopping list. In fact, I know that a lot of commercial recipe programs do just that. When you want to enter "one pineapple" or "zest of one lemon," however, you end up putting something stupid in the units column.
An even better approach would be to have the user enter it as a single string, but then have the program parse it out and store it as separate things, adding them up appropriately when making the shopping list. You have a little bit of an issue with the user sometimes typing "half and half" and sometimes typing "half & half" but for the most part, this works pretty well.
So there are two abstractions here. The first is the data abstraction, in which it is clearly better to store each ingredient in a recipe using three fields. The second is the UI presentation abstraction, in which it is probably better to give a single line for entry of the entire ingredient. Then there is some programming to get from one to the other. Part of this involves understanding the special cases that come up and making sure that they are allowed for in your data abstraction without causing special case code to crop up in places where it has no business. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|