Go Down

Topic: split string by delimiters (Read 120496 times) previous topic - next topic

UKHeliBob

Quote
Ok, and we both agree that a convention that can't be discussed without breaking grammar rules is stupid?
If you insist on not breaking grammar rules

Using strings makes better use of memory than Strings in the limited memory environment of most Arduinos.


How about a discussion about an iPhone ?

iPhones are far too expensive
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

zoomkat

Quote
I mean really...with that convention, how am I supposed to write a title or start a sentence about "strings?"
Kind of like blind men describing an elephant. In this programming environment, a "string" usually refers to an ordered set of bytes, "c-strrings" refers to a method of placing the bytes in a memory location with a null byte appended to the byte string to delimit that byte string in that memory location. A "String" refers to a method of storing byte strings in memory locations using a dynamic indexing system for those strings. Note that some of the info put out by some is more opinion than technical fact, or depends on specific conditions to validate that opinion.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

BigBobby

#17
Mar 19, 2016, 06:40 pm Last Edit: Mar 19, 2016, 07:06 pm by BigBobby
If you insist on not breaking grammar rules

Using strings makes better use of memory than Strings in the limited memory environment of most Arduinos.


How about a discussion about an iPhone ?

iPhones are far too expensive
iPhone is a proper noun.  Proper nouns are normally capitalized all of the time, but Apple is just cool like that.  I imagine the grammar rule would be "use whatever case was used by the person who created the name," but that wasn't a grammar rule I had to worry about when I was in school.

A string is a noun resulting from a naming convention.  It would normally follow all of the rules applicable to the capitalization of nouns.

I don't see why we can't just talk about strings like they do in the C++ spec.  It's worked for decades.  Sure, sometimes people would confuse "strings" with "string objects," but with a sentence or two it'd be cleared up.

Now in this forum, we have threads where people confuse "strings" with "string objects," and people act like saying "string" and "String" back to them is supposed to clear things up.  I don't know who decided to try this experiment, but it didn't work.

Robin2

Now in this forum, we have threads where people confuse "strings" with "string objects," and people act like saying "string" and "String" back to them is supposed to clear things up.  I don't know who decided to try this experiment, but it didn't work.
There are 37.5 angels on the head of my pin.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

UKHeliBob

Quote
There are 37.5 angels on the head of my pin.
Are they actually on the pin or are they floating ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Robin2

#20
Mar 20, 2016, 09:42 am Last Edit: Mar 20, 2016, 09:43 am by Robin2
Are they actually on the pin or are they floating ?
Maybe I need PULLUPs ? (or PULLDOWNs ?)

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

BigBobby

#21
Mar 21, 2016, 06:12 pm Last Edit: Mar 21, 2016, 09:13 pm by BigBobby
Heh...I hope I came across as half-serious in this thread.  I'll call them "string" and "String" if that's how things are in Arduinoland...

I sort of had this Arduino stuff thrust upon me, however.  Usually when I switch to a new embedded system I just have to read a micro datasheet and a compiler manual.

With Arduino you have this whole layer on top of that...

mrburnette

#22
Mar 21, 2016, 09:11 pm Last Edit: Mar 21, 2016, 09:19 pm by mrburnette
<...>
With Arduino you have this whole layer on top of that...
Yes.  The noise responses are just routine forum static.

Arduino is IMO a two-layer extra: the Arduino "language" abstractions and the hardware abstractions known as the "core".  Even early 8-bit AVR arduinos were somewhat different; for example one hardware serial device in Uno to three in the Mega2560, etc.  Also, some uC boards such as the Leonardo were native USB and capable of multiple USB profiles.

The above hardware variances simply mandate that you have a small collection of board/uC printouts to be able to mentally contemplate the resource.


Unlike soft microcontrollers such as the Cypress PSoC line which has extensive internal switched fabric mapped by VHDL, the Arduino pinout and circuit layout are rather limited in flexibility.

But, the core concept can lead to many development boards that are somewhat restricted in tools to have a second life un Arduino land: example STM32F103 which was used in the Maple series and now a very complete $4 arduino: http://www.stm32duino.com


Ray

BigBobby

Arduino is IMO a two-layer extra: the Arduino "language" abstractions and the hardware abstractions known as the "core".
Hmm...interesting point about the two layers.

I have yet to use any Arduinos other than the Uno, where the hardware abstractions have been a bit of an annoyance (I was so thrilled the first time I tried to use an I/O, and discovered that the proper way to do it was to use special names that the Arduino had assigned as opposed to what's in the datasheet).  In order to make the same code work on different Arduinos, however, that is what they needed to do.

mrburnette

#24
Mar 22, 2016, 01:02 am Last Edit: Mar 22, 2016, 01:17 pm by mrburnette
<...>
In order to make the same code work on different Arduinos, however, that is what they needed to do.

In the beginning, I agree.  I think now, the focus is to use the same IDE because Arduino IDE use is widespread; even if the Arduino "core" forces inefficiencies; that is, the IDE and wide selection of libraries often outweigh performance.  If you doubt this, just take a look at any Adafruit library and note the numerous #ifdef statements sprinkled throughout thecode in order to support various manufacturer's hardware (models.)

Code: [Select]
// https://github.com/somhi/ESP_SSD1306
#ifdef __AVR__
 #include <avr/pgmspace.h>
#elif defined ESP8266    //Added for compatibility with ESP8266 BOARD
#else
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif


Other libraries are for more complex.

Ray

-dev

Quote from: BigBobby
the hardware abstractions have been a bit of an annoyance
If you're into Object-Oriented solutions, you should check out Cosa.  It has the best HW abstraction I've ever seen.  If you think C++/OO cannot be efficient, you'll be very surprised, especially if you look at the generated assembly.  It's much faster than any "native" Arduino core libs.  Cosa's SPI and UART performance is unbeaten, I believe.  Zippy, yet very readable.

Cosa is really an alternative "framework" or "core".  Many boards and devices have been integrated by the author, so they are very consistent in style, unlike the hodge-podge you get with Arduino libraries from different authors (with different skill levels, I might add).  Be sure to see the Doxygen-generated online docs here.

Cosa apps can still be built with the Arduino IDE by selecting a different "Board" (e.g. Cosa UNO instead of Arduino UNO).  It also offers a slick makefile system, leaving the IDE waaay behind.

Cheers,
/dev
Really, I used to be /dev.  :(

Robin2

#26
Mar 22, 2016, 10:43 am Last Edit: Mar 22, 2016, 10:44 am by Robin2
I'll call them "string" and "String" if that's how things are in Arduinoland...

....SNIP....

With Arduino you have this whole layer on top of that...
The confusing usage of String and string that you are complaining about is NOT an Arduino issue - it is a C/C++ issue.

Quote
Heh...I hope I came across as half-serious in this thread.
You may be serious but I can't see how your interventions have been any assistance to the OP.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

BigBobby

#27
Mar 22, 2016, 12:08 pm Last Edit: Mar 22, 2016, 12:59 pm by BigBobby
The confusing usage of String and string that you are complaining about is NOT an Arduino issue - it is a C/C++ issue.
You may be serious but I can't see how your interventions have been any assistance to the OP.

...R
Haha...I guess this is the forum static that was mentioned before?

Not only isn't it a C/C++ issue, but I provided a link to the standard to prove it.  Did you not read it, or did you not understand it?  If it's the latter, I can explain it to you but how the hell can you have 24,515 posts and not know this stuff?

And my first post is quite easily the most helpful thing for the OP in this thread.

Seriously...read a book.  This isn't the first time I've seen you blathering on about something where you had no idea what you were talking about.

UKHeliBob

Quote
my first post is quite easily the most helpful thing for the OP in this thread.
In your first post you said
Quote
You're mixing up "Strings" with "String Objects"
I find it somewhat amusing that the link you provided to explain Strings (uppercase) leads to a page headed strings (lowercase)
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

BigBobby

#29
Mar 22, 2016, 03:15 pm Last Edit: Mar 22, 2016, 03:26 pm by BigBobby
In your first post you saidI find it somewhat amusing that the link you provided to explain Strings (uppercase) leads to a page headed strings (lowercase)
Ffs...when I added the links the full URL was cumbersome as the displayed text so I snipped it to the last word.  Go type "Arduino string" into google.  The first link you get is "https://www.arduino.cc/en/Reference/String" and the second you get is "https://www.arduino.cc/en/Reference/StringObject."  The OP left here happy with my answer and a general awareness that String objects are inefficient.

And double ffs...you must realize that the Arduino has a respect problem in real engineering environments.  While there are some people on these forums that seem to know what they're doing, your persistance with the trivial "string" vs "String" thing (and being unaware it isn't a C++ thing) contributes to that lack of respect.

Go Up