Please critique my program design

In summary: I anticipated.In summary, this program will allow the input and retrieval of recipe data from a .txt file. It will also allow the user to switch from cups to grams when cooking a recipe.
  • #1
JonnyG
233
30
I am writing a simple program for my wife and would like some critique on some general design decisions I've made. The program will be able to store a recipe she enters (in a .txt file), retrieve a recipe that she had entered in the past, and allow the input and retrieval of ingredient densities (to allow her to switch from cups to grams, for example).

At first I decided on making a class called Recipe, whose data members would be string name, vector<string> ingredients, vector<double> amounts, and vector<string> units. However, I am starting to think that making a Recipe class would be unnecessary. The purpose of a class, as far as I know, is to store information that is logically related and to define behaviour (methods) for this set of information. However, because I need to store the recipes in a .txt file, it seems as if the text file is acting as my class, so to speak, because it is storing my information for me (each recipe has its own unique file name, so it's as if each file name is an instantiation of a Recipe object).

If, for example, I want to retrieve an old recipe and convert its units, I would first have to use the information in the recipe file to construct my recipe object and then convert the units. What's the point in doing that when I can just read the information in the recipe file into a primitive types (or a vector of primitive types) and manipulate the information? There seems to be no advantage to constructing a Recipe object.

Is my thinking along the right lines here or am I missing something?
 
Technology news on Phys.org
  • #2
My recommendation is to keep it simple. If you do not see a use for OOD, don't use it.
 
  • Like
Likes Chris Miller and JonnyG
  • #3
Thanks for the reply mate.
 
  • #4
FactChecker said:
My recommendation is to keep it simple. If you do not see a use for OOD, don't use it.

Quick question. If I am not going to have a class, what is the best way to logically organize all of my functions? Or do I still have a class but just have every function be a non-member?
 
  • #5
What language? My choice would be python.

Is there a GUI interface? My choice would be java.

For the recipe file: my choice would be a properties file if java or a markdown file if python.

Your original idea of recipe as a class isn’t a bad idea especially since you need units of measure conversions. You could package file read write routines inside as save / load calls.

You might also consider a model view controller design where the recipe is part of the model.

For GUIs: python has tkinter or Flask if web based.

Using Java you could make a nice gui interface but it will be a learning curve to get it right.
 
  • Like
Likes JonnyG and FactChecker
  • #6
jedishrfu said:
What language? My choice would be python.

I just started learning c++ from c++ primer, and I just finished chapter 8 (how to read/write files), so functions and classes are pretty much all that I'm working with at this point. The program will be a console program, and as I am currently studying c++, I'd like to write the entire program using that.

jedishrfu said:
Your original idea of recipe as a class isn’t a bad idea especially since you need units of measure conversions. You could package file read write routines inside as save / load calls.

Converting the units of measure would be the only behaviour that my class would need (I think). But this method (and any other method) would first require me to construct the recipe by reading from a .txt file, then displaying the data members (name, ingredients, etc). But why not just skip the construction of the object and just load the data from the .txt file directly into vector objects and display the data that's in the vector objects?

I am not trying to be argumentative, but this is the first real program I am writing, so I am trying to understand the usefulness of OOD here. I am trying to avoid redundancy, but please point out any gaps in my thinking.
 
  • #7
The notion behind OOD is basically packaging relevant code with the object that needs. Its a means to free yourself from spaghetti code.

It allows you to develop the recipe class separate from your program hiding the recipe code in the recipe class.

Your program can now hold multiple recipes simultaneously and ask the recipe to do some action.

So with a console program you could check out curses or just use ansi screen codes in prints to paint the screen with color and position things.
 
  • Like
Likes JonnyG
  • #8
Why are you writing this yourself? Why not use an off-the-shelf database?
 
  • #9
Vanadium 50 said:
Why are you writing this yourself? Why not use an off-the-shelf database?

Just for practice. It's turning out to take much more thought (away from the keyboard) than I originally imagined it would.
 
  • #10
First, I would try and understand the data structures you want. What is a recipe? It's a list of ingredients and a procedure (maybe more than one?). What's an ingredient? Something that has a description, a unit, and a number of those units - e.g. {"Peanut butter", "Tablespoons", 2.0}. Is the procedure just free-form text?

Does a "recipe" contain other recipes? If so, how do they relate? Is the recipe for meatloaf copied into the recipe for meatloaf supreme or meatloaf a la king, or linked? If the meatloaf recipe changes, what happens to meatloaf supreme and meatloaf a la king? Do they change? Do they stay the same? Does one change and the other stay the same?
 
  • Like
Likes jedishrfu and JonnyG
  • #11
Vanadium 50 said:
First, I would try and understand the data structures you want. What is a recipe? It's a list of ingredients and a procedure (maybe more than one?). What's an ingredient? Something that has a description, a unit, and a number of those units - e.g. {"Peanut butter", "Tablespoons", 2.0}. Is the procedure just free-form text?

Does a "recipe" contain other recipes? If so, how do they relate? Is the recipe for meatloaf copied into the recipe for meatloaf supreme or meatloaf a la king, or linked? If the meatloaf recipe changes, what happens to meatloaf supreme and meatloaf a la king? Do they change? Do they stay the same? Does one change and the other stay the same?

Thanks mate. This has given me a lot more to think about. I'm going back to the blackboard (or in my case, my notepad).
 
  • #12
Vanadium 50 said:
Why are you writing this yourself? Why not use an off-the-shelf database?

Why use recipes when you can order anything online?
 
  • Like
Likes JonnyG
  • #13
JonnyG said:
Just for practice. It's turning out to take much more thought (away from the keyboard) than I originally imagined it would.
I don't think this would make for very useful practice. This is not the sort of thing that c++ is good at and so you will learn a lot about how to force it to do something it is not very good at but learn very little about how to use it for what it is good at.

If you want to learn how to write this sort of application, learn another language (Python has already been mentioned and is a good general purpose language).

If on the other hand you are learning c++ to write a different sort of application then we can perhaps recommend a better application to practice with: why are you learning c++?
 
  • #14
pbuk said:
I don't think this would make for very useful practice. This is not the sort of thing that c++ is good at and so you will learn a lot about how to force it to do something it is not very good at but learn very little about how to use it for what it is good at.

If you want to learn how to write this sort of application, learn another language (Python has already been mentioned and is a good general purpose language).

If on the other hand you are learning c++ to write a different sort of application then we can perhaps recommend a better application to practice with: why are you learning c++?

First a bit on why I am learning programming: I very much enjoy it. I have done it on and off since I was a kid, but I never stuck with it long enough to get very deep into anyone language. I've decided to start learning it now out of both self interest and to become an employed programmer (who's self-taught). Due to my current life situation (currently need to work full time as I have a family + mortgage) I am unable to go back to school, so the self-taught route is the only way I can go. Even if I don't end up getting a job doing it, I will still be happy learning it.

Now as to why I have chosen c++: Before starting it, I read about how challenging it would be. I like that. I want to challenge myself. I also read that although it can be overkill for a lot of applications, it is very powerful. It's also relatively easy to pick up another language after you've already learned c++. At this point I've already devoted some time to c++ so I don't want to switch to another language. I understand the fallacy of sunk costs, but I've always given up early on things in my life; like never sticking to one specific language to learn it deep enough, not finishing my math degree, and so on. So that's why I am pretty set on seeing this through.

Given what I've just said, is there any advice you could give me?
 
  • Like
Likes yungman
  • #15
If one of your main goals is to learn C++, then continue. It is a great language to learn. If your main goal is to accomplish a database task, then there are better languages and ways to get it done. A professional programmer has seen dozens of languages and is always picking the best one for a particular situation.
 
  • #16
Often as programmers, we choose the best language that gets the project done. However on large projects, someone else chose the language based on the needs of the project and experience of the leading programmers.

For your project, I would look to a scripting language and a simple means of storing recipes so while a database is an effective means of storing your recipes, I would go with a simpler text file approach. The thinking is that should you abandon the project, you’ll still have the recipes readily available hence the idea of using markdown format.

@Vanadium 50 brings up a good point of recipes within recipes or recipes sharing steps. You should decide if and whether you might want to support this kind of feature. Personally though it may lead you into rabbit hole of possibilities where you’ll wish for a simpler approach hence markdown comes to mind again.

While markdown is good for making a text file into a web page, it won’t cover issues of identifying values to be converted. This is the realm of domain specific languages where values might carry a units of measure.

One example, I saw recently was a DSL based on groovy where numeric values had dotted extensions describing the units of measure.

25.m for 25 meters vs 25.ft for 25 feet

or

2.tsp for 2 teaspoons vs 2.g for 2 grams.

then you’d have extract them from the recipe text.

Of course, this means parsing text to find these fields and changing them to the preferred units of measure.
 
  • #17
Saving the recipes in text files is indeed the approach that I have already decided to use. Ingredients, amounts, and units are all saved in vectors (as there is a natural one-to-one-to-one correspondence between the ingredients, amounts, and units). I use the text files to construct Recipe class objects which have methods such as display and convert units.

@jedishrfu @FactChecker I know this is not the career advice subforum, but you two seem knowledgeable and since I have you here, I figure I'll ask...Given the fact that I want to eventually become employed as a software developer (and going back to school is not an option for me), am I going down the right path? I figure that I need to know a few languages for back-end stuff, as well as a few languages for front-end stuff. I'll also need to learn more about data structures and algorithms. Frankly, I don't know exactly what I want to develop, so it is hard to choose an exact stack to learn, but I do know that I would like to land a lucrative job some time in the future.
 
  • #18
JonnyG said:
First a bit on why I am learning programming: I very much enjoy it. I have done it on and off since I was a kid, but I never stuck with it long enough to get very deep into anyone language. I've decided to start learning it now out of both self interest and to become an employed programmer (who's self-taught). Due to my current life situation (currently need to work full time as I have a family + mortgage) I am unable to go back to school, so the self-taught route is the only way I can go. Even if I don't end up getting a job doing it, I will still be happy learning it.

Now as to why I have chosen c++: Before starting it, I read about how challenging it would be. I like that. I want to challenge myself. I also read that although it can be overkill for a lot of applications, it is very powerful. It's also relatively easy to pick up another language after you've already learned c++. At this point I've already devoted some time to c++ so I don't want to switch to another language. I understand the fallacy of sunk costs, but I've always given up early on things in my life; like never sticking to one specific language to learn it deep enough, not finishing my math degree, and so on. So that's why I am pretty set on seeing this through.

Given what I've just said, is there any advice you could give me?
Go for it, challenging is one of the reason I chose to learn C++. I just finished Class, Inheritance and Polymorphism, I am happy someone in the learning stage is here. Just use C++ to write whatever you decided to write. I just wrote a program using class in people directory that store the names, phone, address and email address into file. The program sort input and put it in order according to last name and then firstname. I can add new names and it will sort and add into the file, I can search names also. Who cares whether it's the perfect language to do the job? The point is to practice.

Just work on those small sample programs in the book really doesn't help you understand, only when you actually design and write a real program that you really learn. I did, Against people's advice, I pushed ahead and completed the program and I learn so much from that experience.

Go for it.
 
  • Like
Likes JonnyG
  • #19
JonnyG said:
Saving the recipes in text files is indeed the approach that I have already decided to use. Ingredients, amounts, and units are all saved in vectors (as there is a natural one-to-one-to-one correspondence between the ingredients, amounts, and units). I use the text files to construct Recipe class objects which have methods such as display and convert units.

@jedishrfu @FactChecker I know this is not the career advice subforum, but you two seem knowledgeable and since I have you here, I figure I'll ask...Given the fact that I want to eventually become employed as a software developer (and going back to school is not an option for me), am I going down the right path? I figure that I need to know a few languages for back-end stuff, as well as a few languages for front-end stuff. I'll also need to learn more about data structures and algorithms. Frankly, I don't know exactly what I want to develop, so it is hard to choose an exact stack to learn, but I do know that I would like to land a lucrative job some time in the future.
I was in your boat 40 years ago, graduated in Chemistry, hated it, got married, need a job, couldn't afford to go to school again. Difference is I found my passion of my life...electronics. Going to school is not an option and resort to work my way up, self studied on my own at the mean time.

My advice to you is find something that you REALLY LOVE, don't look at programming just because of good pay. You literally marry to the job, you better love it. I would put money as secondary. There is always a price to pay to get good pay....YOU EARN IT. The long hours, the dedication and the pressure of the job in high tech. I started out as a test programmer writing assembly language to test pcb, then converted totally into electronics. But I can speak for both programming like electronic engineering, they are all high pressure environment. You better love it to go into it. I retired 15 years ago, I still love electronics and still work on electronics at home designing very high end hifi amplifiers. C++ is a mental exercise for me, ultimately, I'll still go back to electronics.

Good luck in your journey of life. Just remember, find what you truly love, don't compromise, don't look at money to choose. Life is too short. I looked very hard for my true love, I was even a pizza delivery for a little while and still refused to look for a job in Chemistry, if I were to do it all over, I would not change a thing how I did it. Find your true love.
 
  • Like
Likes sbrothy, fluidistic and JonnyG
  • #20
yungman said:
I was in your boat 40 years ago, graduated in Chemistry, hated it, got married, need a job, couldn't afford to go to school again. Difference is I found my passion of my life...electronics. Going to school is not an option and resort to work my way up, self studied on my own at the mean time.

My advice to you is find something that you REALLY LOVE, don't look at programming just because of good pay. You literally marry to the job, you better love it. I would put money as secondary. There is always a price to pay to get good pay....YOU EARN IT. The long hours, the dedication and the pressure of the job in high tech. I started out as a test programmer writing assembly language to test pcb, then converted totally into electronics. But I can speak for both programming like electronic engineering, they are all high pressure environment. You better love it to go into it. I retired 15 years ago, I still love electronics and still work on electronics at home designing very high end hifi amplifiers. C++ is a mental exercise for me, ultimately, I'll still go back to electronics.

Good luck in your journey of life. Just remember, find what you truly love, don't compromise, don't look at money to choose. Life is too short. I looked very hard for my true love, I was even a pizza delivery for a little while and still refused to look for a job in Chemistry, if I were to do it all over, I would not change a thing how I did it. Find your true love.

Thanks for the advice mate. I don't want to give the impression that I am only going into it for the money. I really do love it. But I wouldn't be trying to become an employed programmer if it weren't for the money - at this time in my life, money means a lot. My life has been very turbulent for the last 12 years or so. Now that my life is stable and I have a different mindset, I need to make up for wasting the last 12 years...
 
  • #21
JonnyG said:
Thanks for the advice mate. I don't want to give the impression that I am only going into it for the money. I really do love it. But I wouldn't be trying to become an employed programmer if it weren't for the money - at this time in my life, money means a lot. My life has been very turbulent for the last 12 years or so. Now that my life is stable and I have a different mindset, I need to make up for wasting the last 12 years...
Are you in US? You use "mate" that prompt me to ask this. If you are in US, my suggestion is learn hard and look for a programming trainee job right away. Time is good, companies might hire and train you if the wage is cheap. My prediction is the economy is going to go down soon as the corporate tax is going to go up and company will again leave the country and taking the job with them to another 3rd world country. If you wait a year or so, even if you have a degree at that time, you might not find a job. Get your foot in the door.

I got in in 1979 because of that, time was good, I wrote some stupid test program and I got promoted. This is how the high tech industry is, when they need people, they take anyone that can breath with a pulse. When economy changes, they fire all the people. Once you get your foot in the door, work double time, learn and get you experience and knowledge. Get your foot in the door even if you have to be a trainee and earn peanuts.

If you are in Ausi, forget what I said. I don't know your country.
 
  • #22
yungman said:
Are you in US? You use "mate" that prompt me to ask this. If you are in US, my suggestion is learn hard and look for a programming trainee job right away. Time is good, companies might hire and train you if the wage is cheap. My prediction is the economy is going to go down soon as the corporate tax is going to go up and company will again leave the country and taking the job with them to another 3rd world country. If you wait a year or so, even if you have a degree at that time, you might not find a job. Get your foot in the door.

I got in in 1979 because of that, time was good, I wrote some stupid test program and I got promoted. This is how the high tech industry is, when they need people, they take anyone that can breath with a pulse. When economy changes, they fire all the people. Once you get your foot in the door, work double time, learn and get you experience and knowledge. Get your foot in the door even if you have to be a trainee and earn peanuts.

If you are in Ausi, forget what I said. I don't know your country.

I am in Toronto, Canada. There seems to be plenty of coding jobs available in Toronto, although I don't know if there are a lot relative to the number of potential employees...
 
  • #23
@JonnyG so here's the dope and @FactChecker, @Mark44 and others can comment further as my information may be skewed or worse dated.

ONE you need an undergrad degree in STEM subject like CS, Physics, ME, EE or Math. Sometimes however, liberal arts with CS minors can make it too. IBM was famous for hiring English majors back in the day before CS degrees were available.

IBM felt at the time that programming was part coding and part documentation. If you've ever seen programmer written docs you'd be appalled (depends on the programmer).

ME and EE students routinely use Matlab and something similar in school and so for jobs requiring some engineering and programming skills they make the grade. Matlab has astutely realized that offering cheap licenses to students results in hefty investments from engineering firms later on as new hires profess the benefits of Matlab.

TWO its good to have some demo code to show in interviews if requested. My last job wanted some sample code in one of five languages they used routinely in their projects so I provided examples for all five and got hired quickly.

Some folks gain experience by developing their own game or other personal project that they then share on Github. Others join Github collaborations and contribute bug fixes and other things to Github projects.

THREE age matters, companies are more readily interested in younger folks. However, experienced programmers with a broad array of skills can and do get hired. Companies realize that its harder to hold a younger programmer but equally older programmers are more likely to retire so both factors are tied into job hiring decisions.

My friend tried to get hired at a mid-sized company as an EE years ago. The HR manager said no initilailly stating he was over-qualified. After several back and forth conversations, he convinced the HR manager that he would stick around and then IBM called and he was gone gone gone. The HR manager was livid saying I knew it, I knew it now you've ruined my hiring score as a manager.

FOUR you need to have some experience in web systems, database systems, GUIs in either Java, C# or C/C++ and have some experience with a scripting languages like BASH, Python, and Windows BAT/CMD and for the web Javascript and some of its popular frameworks like Angular or React.

EDIT: I forgot to mention tools like Eclipse, Netbeans, MS Visual Studio, SVN/CVS, GIT and Maven. Recently, folks are moving to Git, Maven and MS Code Editor for projects along with custom Bash/Python tools.

FIVE the future is always changing and so are CS skills. I've had expand into Python with Anaconda and ML libraries most notably numpy for its array manipulation. I started looking into Docker images and using Golang over Python for each relative footprint size.

You'll have to study the job listings to see what skills they are looking for and assess where your own are lacking. It doesn't mean you need to gain them, if you're reasonably confident you can say during an interview based on my experience with X I can easily adapt to learning Y.

SIX you need to always use a custom resume when applying for a job and keep a record of what resumes and cover letters are sent where. Most folks hate to do this but HR depts routinely use ML algorithms to scan and catalog resumes into their database. A manager can say he needs this skill and they pull up folks with that skill. Customizing a resume to get past this roadblock is an art you can learn once you understand how they handle resumes.

Often, its better to network with friends and coworkers to find jobs in other companies. In some cases, workers can recommend a qualified friend and get paid if they get hired. Its the devil you know is better than the devil you don'[t so if you trust to employees recommendation then you'll likely get a good hire.

Thats all I have for now.
 
Last edited:
  • Like
Likes FactChecker and Mark44
  • #24
JonnyG said:
I am in Toronto, Canada. There seems to be plenty of coding jobs available in Toronto, although I don't know if there are a lot relative to the number of potential employees...
I can't speak for Canada. I know, when time is good, so many job openings, that can change over night. Don't let that fool you. If it is in US, I would say just take you enthusiasm and convince people to hire you. If you are good and work hard, you can move up very fast. I started out as only a field service tech for micro cassette earning peanuts, in two years, I was promoted to EE. I got raises like every 3 months. When time is good, you are in the driver seat. Gain the knowledge and brace for the down turn. This is life.
 
  • #25
@jedishrfu

Thank you for the very informative reply. I have nothing but obstacles to be honest:

1) I have finished only a couple years of a 4 year pure mathematics degree and do not have the time or money to go back to school anymore

2) I have a criminal record for drug convictions which I cannot be pardoned for until 2031

3) As you mentioned, age is a factor. I am already 31 years old.

The only positives I have in terms of the education obstacle is that I had done a summer research project with a math professor (not original research, more of an intensive 1 on 1 mentorship) and I have a very good personal relationship with him. I could use him as a reference to speak to my technical ability. This is not going to carry nearly as much weight as a degree would, but it's the best I've got right now.

Despite all these obstacles, I will always regret it if I don't at least try. I have no choice but to march forward.
 
  • Like
Likes fluidistic
  • #27
jedishrfu said:
@Vanadium 50 brings up a good point of recipes within recipes or recipes sharing steps. You should decide if and whether you might want to support this kind of feature. Personally though it may lead you into rabbit hole of possibilities where you’ll wish for a simpler approach hence markdown comes to mind again.

To be clear, I wasn't encouraging subterranean lagomorphic voids. I was encouraging him to think about what he wants this to do before jumping into coding. A simple electronic equivalent index card might be fine. Or it might not. But you don't want to be in the middle of writing and discover you missed a requirement that would cause you to redesign.

I did suggest that it is better to design data structures before leaping into coding. I think this is a good idea, and my experience is that much grief can be avoided by thinking data structures before leaping into coding.
 
  • Like
Likes jedishrfu and sysprog
  • #28
JonnyG said:
Given what I've just said, is there any advice you could give me?
Sure, as you have some maths background and C++ is a great tool for computational problems, I'd go with something along those lines. Here's 3 ideas depending on the kind of thing that interests you:

A sudoko (or similar puzzle) solver.
Compute the frequency of each rank of poker hand.
Work through a few problems from Project Euler.

Or just search for 'coding challenge' or 'c++ coding challenge'.
 
  • Like
Likes JonnyG, Vanadium 50 and sysprog
  • #29
I like the Project Euler problems. One shortcoming is that few of the problems lend themselves to parallelism. In today's world, where speed is gained by more cores instead of faster cores, that is not ideal.
 
  • Like
Likes jedishrfu
  • #30
To JonnyG if you are still here. Timing is very important if finding a job in this field. Like I said, I know, I was in your shoe before. I was not young at the time, I was 26, a little younger, but not much at the time. So I won't let 31 bother you too much. Yes, it's always better if you study this, that before you get into the job, BUT it will take like another two years minimum. Take my word for this as I've seen many cycles of economy, it will go down. Even in Canada, they still go in cycle, it will NEVER stay good. When it goes down, you'll see how hard it is to find a job.

From being one that study as needed but finally did studied back everything in college EE degree requirement and more, I can tell you there is a BIG DISCONNECT between real world and academic world. People in academic world have a very different perspective than in the real world. In the real world, the only thing is to get the job done. If you can roll the dice to decide how to design and get things done 100%, you are hired and you'll be promoted. Nobody cares how you do it. There is result, and there are reasoning why you fail. If you succeed, you don't need reason. You need reason only if you fail! As a manager of EE at the time, I encountered two people, one was a programmer from UC Berkley, another mechanical engineer from Standford. If they were under me, I would fired both of them. They sat there and talk and argue instead of getting the job done, kept getting in the way because they think they know better. In the real world, only thing that matter in the job is getting the job done.

You have two years college in Math major. You must have covered calculus I, II and III on multi variables. Hopefully ODE. If you are good at these, you are already ahead of the game. A lot of physics and electronics are math. In the advanced classes, it's all math. Like RF and microwave in electronics, it's ALL multi-variables, ODE and PDE. You are more ahead of the game than you think. The key is to maximize what you have, don't spend time keep getting yourself ready, just look for a job. Let them decide whether you are good enough. At the mean time, study hard on programming while you are looking. Then you keep studying on the job like I did.

Anyway, too much talking. It's time for you to post your programs here and start talking about programming instead of talking about what you should do. Post your program, let people give you advice and learn.

Good Luck.
 
Last edited:
  • Like
Likes JonnyG and sysprog
  • #31
I appreciate all of the advice everyone in this thread has given me. Thank you all very much!
 
  • Like
Likes berkeman
  • #32
Vanadium 50 said:
To be clear, I wasn't encouraging subterranean lagomorphic voids. I was encouraging him to think about what he wants this to do before jumping into coding. A simple electronic equivalent index card might be fine. Or it might not. But you don't want to be in the middle of writing and discover you missed a requirement that would cause you to redesign.

I did suggest that it is better to design data structures before leaping into coding. I think this is a good idea, and my experience is that much grief can be avoided by thinking data structures before leaping into coding.

@Vanadium 50 I wasn’t attacking you or your suggestions, merely pointing how design can go wild to the point of failure. I myself am guilty of this sometimes. I will design something with a lot of potential features and then look at the core features I need and place the others in quarantine to be evaluated later on.

In general, it’s a better approach than designing a toy version and then extending it beyond its original capabilities only have you go through a thorough redesign and refactoring of code. But I guess that's what time pressure and programmers do all the time.
 
  • #33
yungman said:
[...] My advice to you is find something that you REALLY LOVE, don't look at programming just because of good pay. You literally marry to the job, you better love it. [...]

Wise words indeed. Getting stuck programming something you know is never gonna get used (and yes that happens in industry, I've tried - for the military even) or is boring is not even remotely funny.
 
  • #34
Vanadium 50 said:
First, I would try and understand the data structures you want.
As an add-on to this good advice, if your wife is going to be the primary user of the program, it helps a lot if the program's data model matches her mental model. For example, what is her mental model of a recipe? Finding that out will require taking some time to ask her questions.

For a language, since it looks like C++ is what you are most familiar with, I don't see any major issue with using it. My personal language of choice for something like this would be Python, but I have done a lot more coding in Python than I have in C++. If you haven't done any coding in Python, I would say this is at the upper end of difficulty for a "learning project" where you're trying to learn the language as well as produce a working application.
 
  • #35
Vanadium 50 said:
my experience is that much grief can be avoided by thinking data structures before leaping into coding
This is my experience as well. With well-designed data structures, much of the code will more or less write itself. But with a tangle of code that isn't backed by well-designed data structures, it can take forever to find your way out.
 

Similar threads

  • Programming and Computer Science
Replies
8
Views
2K
  • Programming and Computer Science
2
Replies
65
Views
2K
  • Programming and Computer Science
Replies
22
Views
907
  • Programming and Computer Science
3
Replies
75
Views
4K
  • Programming and Computer Science
Replies
19
Views
3K
  • Programming and Computer Science
Replies
5
Views
806
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
30
Views
2K
  • Programming and Computer Science
3
Replies
89
Views
4K
  • Programming and Computer Science
Replies
34
Views
2K
Back
Top