horizon2000
Posts: 3
Joined: Mon Nov 12, 2018 9:14 pm

What OS and language to use for database project??

Mon Nov 12, 2018 9:23 pm

Hello,
I am not a programmer and I need some advise, please.
I thinking about using Raspberry Pi Zero W with a camera as a RFID/QR code reader with a small screen (3.5" - 8"). After reading a RFID code or capturing QR code and decoding it, I would like add some information and send it to a remote database.

I have couple of questions:
  • What operating system should I use?
  • What programming platform/language would be the best for it?
Thank you for your help,
Robert

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20908
Joined: Sat Jul 30, 2011 7:41 pm

Re: What to use??

Tue Nov 13, 2018 9:42 am

Raspbian. .The asnwer is always Raspbian.

Python would work, C would work, C++ would work.

Use the one you know.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

pfletch101
Posts: 229
Joined: Sat Feb 24, 2018 4:09 am

Re: What to use??

Tue Nov 13, 2018 3:35 pm

If you are 'not a programmer' but want to use this project as a way into programming, I would use Python. Despite its quirks, it has a more gentle learning curve than most other common languages. If you don't plan to become at least something of a programmer, I am not sure how you plan to accomplish your project.

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 6:53 pm

What database?

What programming language do you know?
What programming language would you like to learn?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Heater
Posts: 10236
Joined: Tue Jul 17, 2012 3:02 pm

Re: What OS and language to use for database project??

Wed Nov 14, 2018 7:51 pm

horizon2000,
I am not a programmer and I need some advise,
You have an interesting and fun road ahead. Be warned that it is a long and winding road.
What operating system should I use?
Use Raspbian. It's the standard for the Pi. You will get the best support with any questions that come with Raspbian.
What programming platform/language would be the best for it?
As a beginner to programming I would suggest you start with Python.

You will find support for accessing any database and doing pretty much anything else in Python modules.

User avatar
DavidS
Posts: 3636
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 8:36 pm

To many veriables to answer the OS question. Just about any OS would be well suited to your application.

The question of language, you will need to learn one at least. In the modern world everything takes on the structure of C, so that may be a good option. Though it is difficult to point to a true beginners tutorial on using C. The best one I know is the first 8 chapters of The C Programming Language, 2nd Ed, ANSI C, though that is a book that costs $20 (almost as much as a Raspberry Pi).

Give me a few minutes while I switch my RPi3B over to raspbian to give more pointers (need a JS web browser).
The Raspberry Pi is an ARM based computer, that runs many different and varied Operating Systems, including Linux, RISC OS, BSD, as well as many more.

User avatar
DavidS
Posts: 3636
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 8:53 pm

For C tutorial try:
http://www.learn-c.org/

And I would recommend staying away from the more difficult languages for now. That is stay away from the likes of Python, C++, Java, Algo, COBOL, etc. until you have a decent grasp on programming.

I used to recommend BBC BASIC to beginners, though things change and no one now days like even hearing the name of BASIC (despite BBC BASIC being more structured than many modern languages that do not even have typed variables [one of the complaints against other forms of BASIC that BBC BASIC solved])
The Raspberry Pi is an ARM based computer, that runs many different and varied Operating Systems, including Linux, RISC OS, BSD, as well as many more.

pfletch101
Posts: 229
Joined: Sat Feb 24, 2018 4:09 am

Re: What OS and language to use for database project??

Wed Nov 14, 2018 9:06 pm

DavidS wrote:
Wed Nov 14, 2018 8:36 pm
The question of language, you will need to learn one at least. In the modern world everything takes on the structure of C, so that may be a good option. Though it is difficult to point to a true beginners tutorial on using C. The best one I know is the first 8 chapters of The C Programming Language, 2nd Ed, ANSI C, though that is a book that costs $20 (almost as much as a Raspberry Pi).
I think that there is a reason why "it is difficult to point to a true beginners tutorial on using C". It is, at least in my opinion, a difficult first language for a beginner, and remains less than ideal for a 'casual user'. I have learnt and written substantial applications in many languages, from Apple II BASIC and 6502 Assembly Language through various other BASICS, C, Fortran, PDP-11 Assembler, 80n86 Assembler, and various special-purpose data manipulation languages. C was probably my favorite language when I was using it all the time, but, as a (now) only occasional programmer, I prefer languages that are either interpreted or have a programming environment that allows you easily to exercise bits of your code while you are developing it. I do most of my programming in VB.NET, using Visual Studio.

Python (which I have only started using fairly recently) is very good from this viewpoint, and also offers the ability to plug in modules which make many things that are difficult (particularly for a beginner) in other languages quite easy to accomplish. I think that the odds of a beginner making progress and not getting terminally frustrated are better with Python than with most other potential 'first languages'.

User avatar
DavidS
Posts: 3636
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 9:39 pm

pfletch101 wrote:
Wed Nov 14, 2018 9:06 pm
DavidS wrote:
Wed Nov 14, 2018 8:36 pm
The question of language, you will need to learn one at least. In the modern world everything takes on the structure of C, so that may be a good option. Though it is difficult to point to a true beginners tutorial on using C. The best one I know is the first 8 chapters of The C Programming Language, 2nd Ed, ANSI C, though that is a book that costs $20 (almost as much as a Raspberry Pi).
I think that there is a reason why "it is difficult to point to a true beginners tutorial on using C". It is, at least in my opinion, a difficult first language for a beginner, and remains less than ideal for a 'casual user'. I have learnt and written substantial applications in many languages, from Apple II BASIC and 6502 Assembly Language through various other BASICS, C, Fortran, PDP-11 Assembler, 80n86 Assembler, and various special-purpose data manipulation languages. C was probably my favorite language when I was using it all the time, but, as a (now) only occasional programmer, I prefer languages that are either interpreted or have a programming environment that allows you easily to exercise bits of your code while you are developing it. I do most of my programming in VB.NET, using Visual Studio.
I would argue that C is about equal to BBC BASIC. I think the main trouble is the way it is taught, it is not taught for beginners instead it is assumed the person learning C is familiar with programming. The language is not the problem.

I will reserve my opinion about VB.NET. For BASIC I strongly prefer BBC BASIC V (aka ARM BASIC), which is a structured procedural language with typed variables, support for dereferencing indirected data, and the ability to directly call the OS on which it runs.
Python (which I have only started using fairly recently) is very good from this viewpoint, and also offers the ability to plug in modules which make many things that are difficult (particularly for a beginner) in other languages quite easy to accomplish. I think that the odds of a beginner making progress and not getting terminally frustrated are better with Python than with most other potential 'first languages'.
Python does not have properly typed variables. Remember this is one of the reasons that the 8-bit style BASIC's became frowned upon (most of which came from MicroSoft), that and the lack of parameterized procedures. Good habits from the start are better.
The Raspberry Pi is an ARM based computer, that runs many different and varied Operating Systems, including Linux, RISC OS, BSD, as well as many more.

Heater
Posts: 10236
Joined: Tue Jul 17, 2012 3:02 pm

Re: What OS and language to use for database project??

Wed Nov 14, 2018 9:42 pm

Our opening poster, horizon2000, is not yet a programmer. A beginner to programming need a language that is quick an simple to get started with and all the hand holding they can get.

Python is such a language. Writing your first one line "Hello world" program is about as simple as it can get. From there it is simple steps to more complex things. There are tons of beginner friendly introductions to Python around the net and the documentation is excellent.

C is not a beginner friendly language. Not by a huge margin. Just the need to have a compile step is the first hurdle. Having to write a multi-line main function just to get "Hello world" output or do some simple arithmetic, with it's weird include statements, weird syntax, weird printf function etc is another big hurdle. And so on. When it comes to accessing a database from C it's a lot of hard work compared to Python and other modern high level languages.

C++ is way off the charts of complexity for a beginner. Unless one is using the Arduino where a lot of that is hidden from you and there is a simple IDE. That is not the case on the Pi.

Similarly, whilst any operating system will do for the stated application, a beginner needs hand holding. Going with Raspbian is the way to get lots of the best support available on the Pi.

Heater
Posts: 10236
Joined: Tue Jul 17, 2012 3:02 pm

Re: What OS and language to use for database project??

Wed Nov 14, 2018 9:46 pm

C does not have properly typed variables. C has lot's of undefined behaviors and traps for beginners.

Just write a Python and a C program to add two numbers together to see why Python is far simpler and more suitable as an introduction to programming that C.

User avatar
DavidS
Posts: 3636
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 10:26 pm

Heater wrote:
Wed Nov 14, 2018 9:42 pm
Our opening poster, horizon2000, is not yet a programmer. A beginner to programming need a language that is quick an simple to get started with and all the hand holding they can get.

Python is such a language. Writing your first one line "Hello world" program is about as simple as it can get. From there it is simple steps to more complex things. There are tons of beginner friendly introductions to Python around the net and the documentation is excellent.

C is not a beginner friendly language. Not by a huge margin. Just the need to have a compile step is the first hurdle. Having to write a multi-line main function just to get "Hello world" output or do some simple arithmetic, with it's weird include statements, weird syntax, weird printf function etc is another big hurdle. And so on. When it comes to accessing a database from C it's a lot of hard work compared to Python and other modern high level languages.
Then go back to the good recommendation, BBC BASIC (in its modern form). It does not have the bad of Python and is a good beginner language, that does NOT have the bad of some other BASIC implementations.
C++ is way off the charts of complexity for a beginner. Unless one is using the Arduino where a lot of that is hidden from you and there is a simple IDE. That is not the case on the Pi.
C++ is the opposite of C. C is simple and eloquent, C++ is complex without reason.
Similarly, whilst any operating system will do for the stated application, a beginner needs hand holding. Going with Raspbian is the way to get lots of the best support available on the Pi.
The Raspberry Pi is an ARM based computer, that runs many different and varied Operating Systems, including Linux, RISC OS, BSD, as well as many more.

User avatar
DavidS
Posts: 3636
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: What OS and language to use for database project??

Wed Nov 14, 2018 10:28 pm

Sorry for getting this off topic. Did not mean to spark a debate (however constructive).

Use whatever works for you, I was just attempting to give one point of view.
The Raspberry Pi is an ARM based computer, that runs many different and varied Operating Systems, including Linux, RISC OS, BSD, as well as many more.

PhatFil
Posts: 602
Joined: Thu Apr 13, 2017 3:55 pm

Re: What OS and language to use for database project??

Thu Nov 15, 2018 2:11 am

Assuming you use the designed for purpose Raspbian OS I would suggest look at perhaps using existing apps for the job of qr code reading. Zbar seems like an ideal candidate
https://www.pyimagesearch.com/2018/05/2 ... with-zbar/

As for constructing and executing your remote database insert statement ODBC is probably where you should start looking, Afaik most database systems have ODBC

You may not need to learn any programing language beyond a few carefully constructed shell script commands,
invoke Zbar to scan and save its results in a known file and or location.
read the results construct an odbc insert statement and execute it
delete, move, rename or otherwise mark the scan results as dealt with.

as for rf tag reading the example code for the h/w you select should provide the basis for your data gathering so probably expand that to save its results so they can also be dealt with ;).

Heater
Posts: 10236
Joined: Tue Jul 17, 2012 3:02 pm

Re: What OS and language to use for database project??

Thu Nov 15, 2018 3:10 am

Is it possible to access an SQL database from BBC BASIC? Seems unlikely to me.

horizon2000
Posts: 3
Joined: Mon Nov 12, 2018 9:14 pm

Re: What OS and language to use for database project??

Fri Dec 07, 2018 5:19 pm

Thank you all for valuable input.
It looks like it is not going to be a simple road. I think I'll start with Python.

Thanks again,
Robert

Return to “General programming discussion”