Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Newbie, junior, senior programmer, Simple POS system

views
     
silverhawk
post Feb 21 2023, 10:30 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


Its not as simple as it looks

The moment you have sets, things get really complicated. Are the sets only bundles? Do they have conditional requirements? are set values fixed or percentage off? coupon and voucher rules, etc
silverhawk
post Feb 23 2023, 11:20 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(WongGei @ Feb 21 2023, 12:30 PM)
This is a very good question.
Imagine you are a customer, how you would like the system to have?
If you just like to have a You Tiao and your friend just like to have a  Tau Fu Fa, how will you order?

I will qualify the question as a question that a junior programmer will ask cause it will still need to recompile the program every time changes happen?
*
Its a good question, not necessarily a "junior" question.

The one who defines that system is not the customer, but the company. From user perspective, they don't really care. Many POS still can't do auto sets, and in the past this is how some workers used to cheat money from the customer and company. They would quickly switch ala carte and set pricing so customer pays higher but they record as set in the system and pocket the difference. .
silverhawk
post Feb 24 2023, 02:14 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(WongGei @ Feb 24 2023, 01:29 PM)
That inspire me to create a thread and discuss about this.

So far I haven't see any "codemaster" that can come out with the algorithm  to do that.
*
Errr... its not that hard.

I've built backends that do stuff like that. I had a "promotion module" which basically allowed the company to create promotion rules. Like if you wanted to create a set (bundle). You would say if got X and Y item, then the price is $Z, or can set it is a fixed deduction, or even percentage off or even another item.

The promotions have to be weighted, so that some promotions take precendence over others. Then have to handle things which promotions can be used together and which can't. Like ordering bundles and get free shipping over $A amount is typically allowed. But using coupons on discounted items isn't.

QUOTE(WongGei @ Feb 24 2023, 01:39 PM)
To further answer your consideration, may be a POS system doesn't care if it is charged as a la cart or set. But the same algorithm can be used by a courier company or ship cargo. Imagine the price is a volume that require to fit an item (alacarte). There are only certain type of boxes (set). How many boxes are needed how to maximized the space utilization. The shipment company will pay you tons of money to come out with a program that can do that.
*
Courier companies already have stuff like that. Its a solved problem. Google for it, you'll find solutions.

QUOTE(ifourtos @ Feb 24 2023, 01:50 PM)
A senior would not plan coding in 1st Place.
never.
You need to design a relational database 1st.
then you build you logic
*
That's not true.

If you have to build your database first, then you have already very tightly coupled your database design to your code. Ideally, your code should not care how the database is design, it just needs to receive the correct inputs.

What data is required can be mocked first. This allows you to iterate through your code faster and find flaws in your assumptions. Then you decide where you want to store the data and how. Could be as simple as a CSV, relational DB like MySQL or NoSQL like mongoDB. Regardless, the core logic of your code should not change and ideally all you have to do to is write the adapters for the DB you plan to use.
silverhawk
post Feb 24 2023, 11:53 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(angch @ Feb 24 2023, 08:03 PM)
Heh, some business requirements may be counter intuitive. e.g.

1. Burger RM8
2. Fries RM3
3. Drink RM3
Set A: Burger+Fries+Drink = RM10

Someone who just order burger and drink is actually better off getting set A, which contained fries they don't want.

So, should the optimizer auto add a Fries to the person's order to get Set A? Or should the system leave it to the cashier?

Or can the system handle a Set with optional components? e.g. Order Set A, minus Fries?

Anyone tried ordering kopi-o kosong tanpa kopi before? Might be cheaper than their mineral water...
*
The rules are not that weird actually.

If you consider kitchen operation and inventory you would actually save money if more people bought sets, even though your profit margin might seem higher if they bought ala-carte separately.

The thing is, the pricing engine is not an optimizer. Its purpose is not to give you the cheapest thing, its purpose is for the company to push their promotions to you. What we did was detect if a bundle condition is met, we prompt the user with an option to convert to bundle to save $x dollars. The service was purely online based, so no cashier, but the same interface could be implemented on cashier front if done as POS.


silverhawk
post Mar 1 2023, 09:45 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(WongGei @ Mar 1 2023, 01:11 PM)
I classify it as a work of senior programmer based on the following criteria

1.)  menu and order are read in from file instead of key in manually, this make the program easy to process big amount of data.
2.)  Separating static data (menu) storage with program binary make the program much more easy to adopt changes. Changes in menu, that can happen time to time doesn't require re-compile of binary files.
*
To me that is still junior laugh.gif

You cannot do that level, you're still a student.
silverhawk
post Mar 3 2023, 12:04 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(iammyself @ Mar 2 2023, 08:49 PM)
I've been watching this thread for a while. This is satirical right?

All the discussion about "hey if I do it this way I'm a senior" etc. is just unproductive and honestly a little bit childish.

At the end of the day, it's about project requirements.

If your requirement is introductory university level, no senior or staff or coding ninja will set up a POS application with 100% test coverage, backed by a cluster of database instances etc.

Go ahead if you just want to have fun building a toy POS system that uses the terminal for input. But stop with the labeling nonsense please, it's childish.
*
He's just having fun creating different levels of complexity.

Yes the labelling is inane, but like angch said code is being written, people are having fun.
silverhawk
post Mar 3 2023, 12:05 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(15cm @ Mar 2 2023, 11:43 PM)
can i join the fun? my c is pretty shitty
*
From you I'd expect it to be in a JS framework laugh.gif
silverhawk
post Mar 9 2023, 02:52 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(WongGei @ Mar 7 2023, 10:45 AM)
1.) Manual update menu.csv file are error prompt.
2.) Might not cover all cases
3.) Not enough testing has been performed.
4.)  The combination will grow ex potentially when the bulk number increase and/or the electable items increase.

S1.) Problem 1 and 2 can still be solved by using 2 independent editor and compare their result.
S2.) Problem 2 and 3 can ask ChatGPT to help generate the necessary test case or at least we now there are 21 combinations in advance.
S3.) Problem 4 can ask CharGPT to display all the possible combination , copy and paste the result into menu.csv. Or write a program to generates the possible combination to update the mene.csv accordingly.

From S2 and S3, we can foresee that using AI assisted program will be the future trend.
A lot of minor and repetitive jobs that can be done by more human are totally replaced by AI.
More and more university graduates will find them even harder to look for new jobs cause they have been replaced by AI

Interestingly, I asked ChatGPT to showcase me all the possible combinations and it can't get me a satisfied answer yet.

So, I wrote a program to generates all the possible combination to make 5 draws of the A,B,C characters.

A,A,A,A,A
A,A,A,A,B
A,A,A,A,C
A,A,A,B,B
A,A,A,B,C
A,A,A,C,C
A,A,B,B,B
A,A,B,B,C
A,A,B,C,C
A,A,C,C,C
A,B,B,B,B
A,B,B,B,C
A,B,B,C,C
A,B,C,C,C
A,C,C,C,C
B,B,B,B,B
B,B,B,B,C
B,B,B,C,C
B,B,C,C,C
B,C,C,C,C
C,C,C,C,C
I used about 2 hours to write and debug the program and charGPT use just few seconds to know that there should be 21 lines.
Even though it is unable to provides a satisfied answer, Im sure it will eventually after another few rounds of training.  flex.gif
*
If the same price product is inter-changeable, then which product it is doesn't matter at all. Quite pointless to generate the whole combination.

Using a single CSV also severely limits what you can do, as you're stuck with a single 2D data structure. You could use multiple csv files like products.csv promotion.csv then you start to realise you're building a mini Relational database laugh.gif
silverhawk
post Mar 9 2023, 10:39 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(junyian @ Mar 9 2023, 08:25 AM)
When it reach that point, easier to migrate the csvs to a file-based database like SQLite. No need something overkill like PostgreSQL/MySQL yet.
Then later got requirements to keep track of sales, analysis of best selling promos, etc. etc. (imagination starting to run wild  rclxm9.gif ).

And before we know it, we have an open source POS system born from a single post in Lowyat forum  brows.gif
*
Should just sqlite from the start, really no reason to be using a CSV file as the data source

Even full blown POS don't need to use Postregre or MySQL. If you want to do cloud syncing and stuff, its actually better to use RqLite which gives you distributed sqlite.
silverhawk
post Mar 17 2023, 10:15 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(flashang @ Mar 16 2023, 10:58 PM)
Just notice this line...
Most people may believe senior professional should be good at their work,
their skills set, and should learn from them.

smile.gif

Should we think "a bad programmer does not deserve to be a senior programmer" ?

doh.gif 

Or should we called such people "a senior but bad programmer" ?
Is this an insult of their work (not skill) ?

doh.gif
*
The problem is the term junior/senior. Its a word which is based on temporal experience rather than tangible experience. So if someone worked for 10 years and didn't do much, they're still considered "senior" even though got those who worked 2 years but experienced a lot more.

Too bad we don't really have ways to quantify actual skill/experience. So seniority has to stand in as a lousy estimate.
silverhawk
post Mar 17 2023, 02:45 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


QUOTE(angch @ Mar 17 2023, 11:17 AM)
Dunno about you guys, but I'm still junior, at least according to LYN's description of my profile (look to the left). Need to up the post counts before I'm not junior. Damn it's hard. Been trying years.
*
Forever young laugh.gif

 

Change to:
| Lo-Fi Version
0.0238sec    0.91    7 queries    GZIP Disabled
Time is now: 24th December 2025 - 08:44 AM