Please critique my program design

  • Thread starter Thread starter JonnyG
  • Start date Start date
  • Tags Tags
    Design Program
Click For Summary

Discussion Overview

The discussion revolves around the design decisions for a program intended to store and retrieve recipes, including the management of ingredient densities for unit conversions. Participants explore various programming paradigms, particularly object-oriented design (OOD), and consider the implications of using classes versus simpler data structures.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant questions the necessity of a Recipe class, suggesting that the text file could serve the purpose of storing information without the need for an object-oriented approach.
  • Another participant advises keeping the design simple and only using OOD if it is deemed necessary.
  • There are suggestions to use a model-view-controller design, packaging file read/write routines within the Recipe class.
  • Some participants propose considering the data structures needed for a recipe, including ingredients and procedures, and how they might relate to one another.
  • Concerns are raised about the appropriateness of using C++ for this type of application, with suggestions to consider other languages like Python for better practice.
  • Participants discuss the potential for redundancy in the program and the importance of understanding the relationships between recipes.
  • There are repeated inquiries about the rationale for creating the program from scratch versus using existing database solutions.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and utility of object-oriented design, with some advocating for its use while others suggest simpler alternatives. The discussion remains unresolved regarding the best approach to structuring the program and the choice of programming language.

Contextual Notes

Participants highlight the need to clarify definitions and relationships within the data structures, such as how recipes and ingredients are defined and how they interact. There is also a recognition of the limitations of C++ for this type of application, suggesting that the choice of language may impact the learning experience.

Who May Find This Useful

Individuals interested in programming design principles, particularly in the context of recipe management applications, as well as those learning C++ or exploring object-oriented programming concepts.

  • #31
I appreciate all of the advice everyone in this thread has given me. Thank you all very much!
 
  • Like
Likes   Reactions: berkeman
Technology news on Phys.org
  • #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.
 
  • #36
PeterDonis said:
Finding that out will require taking some time to ask her questions.
But maybe not two years ... :woot:
 
  • #37
This thread just got raised from the dead...

I appreciate everybody that helped me out. I start full time as a software developer in May :) (finally)
 
  • Like
Likes   Reactions: pbuk, berkeman and FactChecker
  • #38
JonnyG said:
I start full time as a software developer in May :)
Congrats! Enjoy the ride :smile:
 
  • #39
JonnyG said:
This thread just got raised from the dead...

I appreciate everybody that helped me out. I start full time as a software developer in May :) (finally)
Yeah, enjoy the ride. In another thread the OP seemed to be lacking some self-confidence. Don't make that mistake. Demand what you and your work are worth (and what your education entitles you to of course).

(Or was it the same thread? Still a valid point though.)
 
Last edited:
  • #40
DaveC426913 said:
But maybe not two years ..
All time spent with the wife is happy time.
 
  • #41
Vanadium 50 said:
All time spent with the wife is happy time.
Some of you have never been on a big lake in a small sailboat with my wife and it shows.
 
  • Haha
Likes   Reactions: berkeman
  • #42
DaveC426913 said:
Some of you have never been on a big lake in a small sailboat with my wife and it shows.
I REALLY[/size] hope she does not have access to your account here!
 
  • Haha
Likes   Reactions: DaveC426913

Similar threads

  • · Replies 8 ·
Replies
8
Views
4K
Replies
65
Views
5K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
6K
Replies
19
Views
4K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 89 ·
3
Replies
89
Views
6K
  • · Replies 4 ·
Replies
4
Views
7K