Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-29 Thread Anthony Youngman via fpc-pascal

On 29/12/2022 05:15, Anthony Walter via fpc-pascal wrote:
I think most people can quickly figure out that SQL is a programming 
language that is used to manage data stored in relational databases. It 
is a relatively easy language to learn and use, especially for people 
with a basic understanding of programming concepts. It's a widely-used 
language in the field of data management and is based on simple, 
English-like commands. SQL uses a straightforward syntax that is easy to 
understand and learn. Many people find it to be a user-friendly 
language, and it is often used as an introduction to programming for 
people who are new to the field. It shouldn't be confusing to anyone who 
has been programming for decades.


Well, I understand it was originally called SEQL, E for English, but 
they dropped that because it wasn't English-like. While the access 
language for one variant of the MultiValue databases I use was called 
"English", precisely because it was very English-like.


The line of code you provided is a SELECT statement that retrieves all 
rows (indicated by the * symbol) from a table called "Customers." The 
statement also includes a WHERE clause, which specifies a condition that 
must be met in order for the rows to be included in the results. In this 
case, the condition is that the value in the "Country" column must be 
equal to 'USA'. Therefore, this line of code would retrieve all rows 
from the "Customers" table where the value in the "Country" column is 
'USA'. The results of this SELECT statement would include all of the 
columns from the "Customers" table for each row that meets the specified 
condition.


Not my line, but it rapidly gets worse from there. What if you want the 
country name ...


SELECT CUSTOMERS.*, COUNTRY_NAME FROM CUSTOMERS
JOIN COUNTRY_CODES ON CUSTOMERS.COUNTY_CODE = COUNTRY_CODES.COUNTRY_CODE


I agree, deciphering your statement ought to be quite clear to anyone 
with even a passing curiosity, which is why I was unsure earlier how 
anyone on this mailing list was confused by SQL.


I'm a database guy with maybe 30 years experience, I'm new to SQL and oh 
my god is it an over-complicated monster ...


LIST CUSTOMERS CUSTOMER_NAME COUNTRY_CODE

and (for the user) it doesn't get any more complicated than that, they 
just need to know the name of the field they want. Everything is defined 
in the *table* (or rather, its equivalent) so the programmer only has 
one place to look, not a mix of tables and views, and you can actually 
hard-code the equivalent of a join into the table. SO much simpler, all 
round ... I like to describe multi-value as a hierarchical 
object-relational database.


Cheers,
Anthony Walter Youngman (aka Wol :-)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-30 Thread Anthony Youngman via fpc-pascal

On 29/12/2022 12:31, Anthony Walter via fpc-pascal wrote:

@youngman

"I'm a database guy with maybe 30 years experience, I'm new to SQL and 
oh my god is it an over-complicated monster ..."


Wait, what? Something doesn't make sense with what you said. You have 30 
years of experience writing database programming code AND you are 
just now beginning to learn about SQL?


Well, may I suggest you actually COMPREHEND Richter's point when he said 
"and only a very small part of people who use Databases use SQL".


I guess you've never heard of NoSQL databases then? As in "No SQL"?

Most of my programming has been done using databases that were what? 
maybe five years old before SQL was even thought of! Yes you can use 
SQL, but why bother when you have a much more expressive, powerful and 
comprehensible language at your finger tips.


Also, it helps a whole lot when writing SQL if you format your statements:

select
     c.*,
     cc.country_name
from
     customers c
     join country_codes cc on cc.country_code = c.country_code;

Formatting code really helps legibility, especially when it comes to 
SQL. That ought to be one of the first things you learn.


And again you're missing the point. I had two lines, each line with its 
own purpose (the first to say what I wanted, the second where to get it 
from). Perfectly comprehensible. Your equivalent is just DIFFERENTLY 
comprehensible.


But you didn't address my example - let me translate your six lines into 
the database access language ENGLISH - it doesn't make sense as more 
than a one-liner ...


LIST CUSTOMERS

or if you only want US customers

LIST CUSTOMERS WITH COUNTRY_CODE EQ "USA"

All the crap in your select statement - INCLUDING the join - has been 
pushed down into the *table* definition (not the view, the table).


Cheers,
Wol


@richters

Again, you are someone replying with another confusing response. You say 
you have little to no experience with databases, then assert:


"and only a very small part of people who use Databases use SQL"

Assuming people in that sentence, you are referring to people who use 
write programs or scripts which make use of databases, if you know very 
little about the subject of databases on that subject, how can you 
justify this assertion?


Moreover, I am unsure why I might heed your advice with regard to 
effective writing. Looking back at the messages, your grammar, 
formatting, and sentence structure belie someone with little formal 
education on the subject.


Quote:

"Then maybe a simple form.    but threads and sockets... ok.. well I know
what threads and sockets are because I happened to use them... but to a
newbie... YIKES what are those?? and SQL??? What the heck is that anyway?
I'm not talking about a newbie.. I mean.. myself... with over 40 years of
programming experience, mostly with Pascal,  What the heck is it and why
would I need to monitor it?"

Your first sentence has no verb. Your profuse usage of strings of 
punctuation is both non-standard and inconsistent. It's difficult to 
tell whether you meant to have a pause, where a comma would be 
appropriate, or whether an idea has ended and a single period should be 
used.


Grammar is important to writing effectively for a number of reasons. 
First and foremost, grammar is the set of rules that govern the way 
words are used in a language. It helps to ensure that people can 
communicate effectively and understand each other. Without a common set 
of grammatical rules, it would be much harder for people to convey their 
thoughts and ideas clearly and for others to understand them. I would 
hope a programmer with 40 years of experience would recognize this. Good 
grammar is essential for written communication, whether it's a business 
letter, a school essay, or an email to a friend. Poor grammar can make 
writing difficult to understand and can convey a lack of attention to 
detail or professionalism.


Finally, grammar is important for language learning. Learning grammar 
helps language learners understand how the language works and how to use 
it correctly. It can also help them understand the structure of 
sentences and how to build them, which is important for speaking and 
writing in the language.


I suggest you either brush up on these subjects or refrain from scolding 
people on subjects with which you have no practical experience.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal