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

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 7:54 pm

By way of some perspective, think about this:

If you start writing software, in Python or whatever, at a young age and you do it tenaciously everyday for your entire life you will be hard pressed to have written 10MB of code before you drop dead at the keyboard.

That leaves almost 500MB of space in your Pi 3A+ for the data it might need to use!

What are you going to create in that 10MB?
Memory in C++ is a leaky abstraction .

alphanumeric
Posts: 2103
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:03 pm

I'm going to live forever, or die trying. :P

mwrich4
Posts: 52
Joined: Wed Jul 25, 2012 1:24 pm
Location: Stuart, Florida

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:15 pm

System development is far more encompassing than just expecting a computer can do anything. You should always consider the workload and program mix when trying to use a low-cost system to do tasks.

Pi 3A+ would be great for some turnkey solutions. Most devs use a full-power system for fast build, troubleshooting and deploy on smaller systems.

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:27 pm

alphanumeric wrote:
Sun Oct 20, 2019 7:50 pm
One big advantage IMHO is, if its a headless setup where you don't need (won't be using) ethernet and 4 USB ports, its a big cost saving over a 3B or 4B. ... I use them where a ZERO just doesn't have the computing power for the job.
If you are alright with just one USB (which may be the unifying usb receiver of a keyboard/mouse combination) you have over the Pi Zero the advantage of not needing any adapter (which on the Pi Zero jeopardizes its small footprint and price advantage, if you dont run headless).

Else, having only one USB and no hub electronics and no Ethernet is a big saving in power requirements compared to the bigger brothers.
Even if you need the sole USB port for other things, you still may use a Bluetooth-Keyboard/Trackpad combination.

W. H. Heydt
Posts: 10984
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:27 pm

alphanumeric wrote:
Sun Oct 20, 2019 7:50 pm
One big advantage IMHO is, if its a headless setup where you don't need (won't be using) ethernet and 4 USB ports, its a big cost saving over a 3B or 4B. I plug my USB hub in do my setup, then just deploy it and let it use WIFI. Smaller footprint too compared to a 3B or 4B. I use them where a ZERO just doesn't have the computing power for the job. There are going to situations where you may need a 3B+ or 4B. Having alternatives is always good IMHO. Zero, Zero W, 3A+, 3B+, 4B etc. Pick your price point and go at it. :D
Haven't actually tried this but it should work... RPF keyboard connected to the (sole) USB port. Mouse connected to the keyboard. Optionally, connect a USB to Ethernet adapter to the keyboard as well. This would work with a Pi0 (one could use a WiFi dongle), Pi0W, or A+ as well.

W. H. Heydt
Posts: 10984
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:33 pm

Heater wrote:
Sun Oct 20, 2019 7:54 pm
By way of some perspective, think about this:

If you start writing software, in Python or whatever, at a young age and you do it tenaciously everyday for your entire life you will be hard pressed to have written 10MB of code before you drop dead at the keyboard.

That leaves almost 500MB of space in your Pi 3A+ for the data it might need to use!

What are you going to create in that 10MB?
Considering that just one COBOL program I wrote had 11,000 lines of procedure code, I think I've written more than 10MB of source code in my life. The main entry program of my convention registration system has over 2K lines of C and wc reports it as 56KB. I don't think of that as being particularly large, so I think 10MB of source code in a lifetime is a rather low bar to set.

User avatar
clicky
Posts: 405
Joined: Thu Oct 25, 2012 7:34 am

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:39 pm

Heater wrote:
Sun Oct 20, 2019 7:54 pm
By way of some perspective, think about this:

If you start writing software, in Python or whatever, at a young age and you do it tenaciously everyday for your entire life you will be hard pressed to have written 10MB of code before you drop dead at the keyboard.

That leaves almost 500MB of space in your Pi 3A+ for the data it might need to use!

What are you going to create in that 10MB?
If you write bare metal code (maybe using micro python) they you're probably right. But, ...
How much Linux Kernel and OS takes?

Is your program going to be doing anything server based - serving more than one customer? Are you going to be dealing with, maybe, streams of media data? What about complex robot or rover code that *does* take more than 10MB (how much is just compiled OpenCV with all the dependencies)? What about collecting telemetry and logs of running your code (as we did)?

Some here would immediately argue that 1/2 a gig is not enough.

Also, I am sure that there are other usages I couldn't think of where 300-400MB is just not enough...

bluelion7
Posts: 18
Joined: Mon Oct 07, 2019 9:22 pm

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 8:41 pm

I like your logic,Heater, . All I was thinking was when I am just starting out learning Mu, or Python or whatever on the Pi offline, it would be handy to have Chromium open in the "Help" menu but then it crashes, freezes. It means , I will have to have a laptop open which defeats the purpose of having the Pi. Also, Sonic Pi doesn't seem to work either. It seems it is just better for doing hardware projects or as someone else suggested Pi zero like projects. That's my conclusion now.

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 9:19 pm

W. H. Heydt wrote:
Sun Oct 20, 2019 8:27 pm
Haven't actually tried this but it should work... RPF keyboard connected to the (sole) USB port. Mouse connected to the keyboard.
The easiest way (if you need keyboard+mouse) is to use a 2,4GHz wireless keyboard/mouse combination. That works out of the box.
This is also the least power demanding solution. USB hubs need a considerable amount of power.

You may also use a Bluetooth keyboard/trackpad combination (and have the USB port free for other things), but it needs to be initialized with another keyboard.

bluelion7
Posts: 18
Joined: Mon Oct 07, 2019 9:22 pm

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 9:48 pm

The keyboard/mouse set-up sounds good. Don't know just used the ones that came with the Pi 3 A + in the box and attached mouse to keyboard. Thanks

W. H. Heydt
Posts: 10984
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 10:28 pm

rin67630 wrote:
Sun Oct 20, 2019 9:19 pm
W. H. Heydt wrote:
Sun Oct 20, 2019 8:27 pm
Haven't actually tried this but it should work... RPF keyboard connected to the (sole) USB port. Mouse connected to the keyboard.
The easiest way (if you need keyboard+mouse) is to use a 2,4GHz wireless keyboard/mouse combination. That works out of the box.
This is also the least power demanding solution. USB hubs need a considerable amount of power.

You may also use a Bluetooth keyboard/trackpad combination (and have the USB port free for other things), but it needs to be initialized with another keyboard.
I really don't care for wireless keyboards and mice, but YMMV. My point was that the RPF keyboard has a built in USB hub. So one cable to the keyboard and then attach everything else from there. Saves the cost and space of buying an additional hub.

W. H. Heydt
Posts: 10984
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 10:32 pm

clicky wrote:
Sun Oct 20, 2019 8:39 pm
Heater wrote:
Sun Oct 20, 2019 7:54 pm
By way of some perspective, think about this:

If you start writing software, in Python or whatever, at a young age and you do it tenaciously everyday for your entire life you will be hard pressed to have written 10MB of code before you drop dead at the keyboard.

That leaves almost 500MB of space in your Pi 3A+ for the data it might need to use!

What are you going to create in that 10MB?
If you write bare metal code (maybe using micro python) they you're probably right. But, ...
How much Linux Kernel and OS takes?

Is your program going to be doing anything server based - serving more than one customer? Are you going to be dealing with, maybe, streams of media data? What about complex robot or rover code that *does* take more than 10MB (how much is just compiled OpenCV with all the dependencies)? What about collecting telemetry and logs of running your code (as we did)?

Some here would immediately argue that 1/2 a gig is not enough.

Also, I am sure that there are other usages I couldn't think of where 300-400MB is just not enough...
One of the big issues that can drive up the size of otherwise small programs is the difference between amateur programming and professional programming. Amateurs write programs for themselves to use. Professionals write programs for other people to use. Specifically, other people who don't know what is acceptable input, in either content or format, and--thus--require vastly more input checking and validating. When writing for others, you also need to handle exception conditions and give meaningful error messages. All of that can add a surprising amount of code to an otherwise rather simple program.

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

Re: Pi 3 A +. What is it for?

Sun Oct 20, 2019 11:02 pm

@W. H. Heydt,
I think I've written more than 10MB of source code in my life.
Yes, but you would be wrong.

I was calculating the industry average rate of source code production, 10 lines per day.

Times 365 days in a year. You get a day off on leap years.

Times 50 years. You get time to go to school at the beginning and vegetate in a nursing home at the end.

Times 40 characters occupied per line. We use 80 column formatting right?

That's only 7300000 characters. Round it up to 10MB of ASCII for good measure.

@clicky,
If you write bare metal code (maybe using micro python) they you're probably right. But, How much Linux Kernel and OS takes?
Well I did not say anything about using tens of millions of lines of code developed by thousands of other people. That would not put things into the perspective I want you to see.
Memory in C++ is a leaky abstraction .

User avatar
Imperf3kt
Posts: 2863
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 12:31 am

Heater wrote:
Sun Oct 20, 2019 11:02 pm
@W. H. Heydt,
I think I've written more than 10MB of source code in my life.
Yes, but you would be wrong.

I was calculating the industry average rate of source code production, 10 lines per day.
I would not hire somebody who writes only ten lines of code (40 characters per line) per day. That's absolutely snail pace! It also assumes the developer makes no mistakes or changes.
55:55:44:44:4C
52:4C:52:42:41

pfletch101
Posts: 527
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 1:06 am

Imperf3kt wrote:
Mon Oct 21, 2019 12:31 am
Heater wrote:
Sun Oct 20, 2019 11:02 pm
@W. H. Heydt,
I think I've written more than 10MB of source code in my life.
Yes, but you would be wrong.

I was calculating the industry average rate of source code production, 10 lines per day.
I would not hire somebody who writes only ten lines of code (40 characters per line) per day. That's absolutely snail pace! It also assumes the developer makes no mistakes or changes.
I think that the metric is actually 10 lines of debugged code per day, so it includes testing and debugging time, but I basically agree with your comment. On the rare occasions when I can actually sit down and code for an entire working day, I would expect to produce hundreds of lines of code in whatever high level language I was using, most of which would not require later revision. Assuming I was just coding on the original day, I would expect subsequent testing and debugging of that code to take no more than another half day. In the normal situation, when I have to fit coding into odd hours in my life, I am less productive, but I would still normally expect to average many times 10 lines of debugged code per hour.

User avatar
Gavinmc42
Posts: 3878
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 1:56 am

I think that the metric is actually 10 lines of debugged code per day,
Probably referring to C code? :lol:
I find with higher level languages I write less code and because it is at application level all the low level stuff is written by others and has less bugs.
A few hundred lines of code could be a complete application on a single purpose device.

It was a few years before I noticed I had Dell Monitors with built in hubs that A+ can use :oops:
Now we have JS based web apps, might be a 1000 lines of code but they run on big browser engines.
The embedded form of that would be Node.JS?

I used Mathematica to write a Stirling Engine monitor on a B+, probably 30 lines of code?
That would work really well on a 3A+.
How long to do the same thing in C from scratch?

With tools like Buildroot a Linux OS can be made real small and have just enough to run a single purpose application.
I have used PiCore to do that and a 128MB SDcard was ample for the OS and App.
I added datalogging and used a 8GB SD and have room for about 30years of data logs.

It is about appropriate usage, software, hardware and time.
In the big scheme of things Pi's are cheap, an hour of someone's time might cost more.
With so many Pi's to choose from, pick the best one for the job.
Sometimes the job is learning how to use the minimal amount of hardware. ;)
I was calculating the industry average rate of source code production, 10 lines per day.
Don't remember it being that fast when it was done on punch cards :lol:
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 3:51 am

Heater wrote:
Sun Oct 20, 2019 11:02 pm
I was calculating the industry average rate of source code production, 10 lines per day.
In real life (TM) you may need weeks of hard teamwork resulting into REMOVING five lines of code from a part of e.g. Linux or Windows.

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 4:09 am

W. H. Heydt wrote:
Sun Oct 20, 2019 10:28 pm
My point was that the RPF keyboard has a built in USB hub.
The integrated hub is indeed a good point, why aren't keyboards more frequently built that way?
If one had a direct micro USB to micro USB cable, one could save the USB adapter on the Zero!

But I have to be greedy on power and -even built into the keyboard- any USB-hub remains a power drain, the wireless keyboards are with respect to that much more efficient.

User avatar
Gavinmc42
Posts: 3878
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 4:27 am

If one had a direct micro USB to micro USB cable, one could save the USB adapter on the Zero!
Do they make those?
Kwyboard2 to have uSD socket and builtin power bank?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

W. H. Heydt
Posts: 10984
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 4:49 am

rin67630 wrote:
Mon Oct 21, 2019 4:09 am
W. H. Heydt wrote:
Sun Oct 20, 2019 10:28 pm
My point was that the RPF keyboard has a built in USB hub.
The integrated hub is indeed a good point, why aren't keyboards more frequently built that way?
If one had a direct micro USB to micro USB cable, one could save the USB adapter on the Zero!

But I have to be greedy on power and -even built into the keyboard- any USB-hub remains a power drain, the wireless keyboards are with respect to that much more efficient.
Wireless keyboards (and mice) have to have their own batteries. So while you save power to the Pi, you are--essentially--having to add an additional power source.

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 7:12 am

W. H. Heydt wrote:
Mon Oct 21, 2019 4:49 am
So while you save power to the Pi, you are--essentially--having to add an additional power source.
They are however heavily optimized for battery use.
A regular keyboard, regular mouse and a 4 channel USB hub can draw more power than a Pi Zero!

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

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 7:34 am

Imperf3kt, pfletch101, Gavinmc42,

Every time I mention that lines of code per day statistic the objections turn up. Is it really so you guys have never heard of it before? It comes from the famous book "The Mythical Man Month" by Fred Brooks. Yes of course there is a lot of variability in there, as I said. Sure we can all churn out a lot of code quickly when we are on a roll. But...

The point is that if you look at a large number of software engineers working on a large project or multiple projects over a long time span that is the kind of number you end up with. It's a simple statistic, your accounts department knows how many days work they paid for, your source code repository tells how many lines you have in the product(s) at the end.

Yes of course it includes debugged code. It includes debugging/maintenance after the product is shipped. It also includes the time taken to identify/define the problem to be solved, to research/design a solution, to write the code, test the code, debug the code (rinse repeat). Also there is documentation and such to consider. Then there is the whole issue of learning new languages, new libraries, new operating systems etc. Engineer training time. The whole software life cycle.

And let's not forget that a lot of code written is thrown away for all kind reasons including cancellation of entire projects when they did not work properly at the end of the day.

Pretty much any experienced software engineer can tell stories of days, weeks, spent debugging a problem only to find at the end of it that the fix is a one line change.

Pretty much any experienced software engineer can tell stories of spending a lot of time on something which resulted in code being removed. Negative productivity!

Over the years many people have looked into this statistic, typically it is found that lines of code produced is independent of the programming language used, from assembler upwards.

My anecdote:

This weekend I spent a lot of time with a language I have picked up recently, trying to get it and some of it's libraries to do what I want. The result was adding 87 lines to my project. That works, it shows I learned something about how to use it all, it convinces me it is worth pursuing further. Great over 40 lines per day! But wait, most of that experimental code will get heavily modified/replaced as I move on to the real problem I want to tackle. It's probably going to take more time to get the requirements out of the client than write the code!
Memory in C++ is a leaky abstraction .

Ernst
Posts: 1244
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 8:27 am

Heater wrote:
Mon Oct 21, 2019 7:34 am
Pretty much any experienced software engineer can tell stories of days, weeks, spent debugging a problem only to find at the end of it that the fix is a one line change.
In the last four weeks I have been debugging an open source gcc based compiler that has been producing one error under Buster with gcc 8.3.0 but not under Jessie/Stretch, two errors under Buster with gcc 8.3.0 but not under Jessie with gcc 4.9.2. The first error was fixed by replacing strncpy by memmove in three places, the second error was fixed by adding one extra variable and one extra line. The cause for the third error I was unable to find but I did find why it happens and I passed my findings back to the author for further research.

That makes a total of 5 lines changed over a period of 4 weeks.
The road to insanity is paved with static ip addresses

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

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 9:04 am

Imperf3kt wrote:
Mon Oct 21, 2019 12:31 am
Heater wrote:
Sun Oct 20, 2019 11:02 pm
@W. H. Heydt,
I think I've written more than 10MB of source code in my life.
Yes, but you would be wrong.

I was calculating the industry average rate of source code production, 10 lines per day.
I would not hire somebody who writes only ten lines of code (40 characters per line) per day. That's absolutely snail pace! It also assumes the developer makes no mistakes or changes.
I would.

That's 10 lines of debugged, and documented code. The mistakes and changes have already been made.

It's a bit low, but not horrendously so. I spend hours and hours looking at code (Linux kernel, RPi firmware) to try and find bugs - could take a week to find a bug that needs a 2 line change....that's a REALLY low average.

Most SW people nowadays are not writing code from scratch, but fixing up other's code...sadly.

I probably wrote 100 lines of fresh code last week. That about 20 lines per day. Other guys here will be writing more, others less.

Not only that but some of that new code meant I removed a big chunk of other code. Total line change, probably close to 0.

Quality over quantity.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

alphanumeric
Posts: 2103
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Pi 3 A +. What is it for?

Mon Oct 21, 2019 9:39 am


Return to “General discussion”