Register | Sign In


Understanding through Discussion


EvC Forum active members: 65 (9162 total)
3 online now:
Newest Member: popoi
Post Volume: Total: 915,817 Year: 3,074/9,624 Month: 919/1,588 Week: 102/223 Day: 13/17 Hour: 0/0


Thread  Details

Email This Thread
Newer Topic | Older Topic
  
Author Topic:   Software Development
Stile
Member
Posts: 4295
From: Ontario, Canada
Joined: 12-02-2004


(1)
Message 2 of 4 (909452)
04-04-2023 8:50 AM
Reply to: Message 1 by Percy
04-03-2023 1:28 PM


Re: A Thought About the Semicolon
Percy writes:
I need a break so I thought I'd post a thought about the semicolon.
...
But I plan to write increasing amounts in code in Javascript, so I'll continue leaving out the semicolons.
In my automation programming languages (PLCs -> mostly ladder logic) there are many, many different companies with their own language and way of doing things. To me, it all comes down to "many different ways to skin a cat"... to use a phrase with a horrible image to actually think about.
I've come to the following (personal opinion) conclusions:
  • There is no global sense of "right" or "wrong" way to code. Each and every language will have it's own correct and incorrect syntax and configuration, and one must learn those things to program correctly in that language. But it is wrong to think that some language's "way of doing things" is the "right way." It's really just "that language's way."
  • There are those who have programmed in one language for most of their lives and they will live and die by "their language" and think that this is the only way to do things and everything else is wrong. I find this analogous to religious people thinking their own religion is correct - just because it's the one they know.
  • Almost every language will have nice things you can't find in other languages, and bad things you can only find within that one language. Those who like that language will always have personal ways of dealing with the bad parts that they describe as "easy if you just do this..."
  • For the most part, you do get what you pay for. AAA programming languages come with all the bells and whistles and attempt to improve upon programmer-friendliness. Rarely-used programming languages should generally stick to the niche-area they were created for and may lack the necessary abilities to perform all functions any programmer could require for "any" situation.
  • Those who say a language is "garbage" or useless - generally simply do not understand how to use that language for the purpose it was created for. Perhaps it was a simple, cost-friendly language created for simple, cost-friendly projects and they're being tasked with using it for larger projects that are beyond the intended scope of the language. This is unfortunate... but is more an issue with project management than it is an issue with the programming language.
  • In my field there are 3 main ways to program. Ladder Logic (used about 80% of the time); Function Block Diagram (used about 15% of the time); or Statement Logic (used about 5% of the time.) Although there are certain extreme-case situations where only one of the languages can be used... these situations are extremely rare and usually it's up to the programmer themselves which method they would prefer to work within. Again, there are those who swear that one is "better" or "worse" than the others... but, really, they're just different ways of doing the same thing. I generally use Ladder Logic because it's the most popular and most user-friendly to maintenance who will likely get stuck with attempting to figure something out years after installation.
So... my thoughts on the semi colon would be:
  • I've always found syntax to be just that... syntax - the way you have to program when using whatever language/compiler you're using
  • I don't find semi colons to be "better" or "worse" one way or the other
  • In my limited "real programming" experience, I do like using python (after I realized how important the white space actually is... that was an interesting afternoon) I find it efficient in the sense of getting my ideas of "what I want the program to do" into the program as easy as possible. I understand that python isn't known for being "efficient" in the sense of energy usage... but that's not really any of my concern for the most part. So I don't care.
And, as all programming discussion should always conclude: "That's not the way I'd program it."

This message is a reply to:
 Message 1 by Percy, posted 04-03-2023 1:28 PM Percy has replied

Replies to this message:
 Message 3 by Percy, posted 04-04-2023 9:26 AM Stile has replied

  
Stile
Member
Posts: 4295
From: Ontario, Canada
Joined: 12-02-2004


Message 4 of 4 (909477)
04-04-2023 12:18 PM
Reply to: Message 3 by Percy
04-04-2023 9:26 AM


Re: A Thought About the Semicolon
Percy writes:
Something's sadly lacking in my education...
No, I don't think so.
"Automation programming" is a very small subset of "programming."
I program the computers ("PLCs") that run assembly lines like auto-parts-making-things, pharmaceutical-making-things, food & beverage processes (like dairy), and even amusement park rides.
But it's not "real" or "normal" programming.
Basically - they're computers that get a single program loaded into them, and they run that 1 program. Forever. They're very good at it - never getting windows or operating system updates because they don't have an operating system and things like that. These computers are meant to be up and running 24/7... forever.
I would say automation programming is to normal programming the way... building a bomb shelter is like building a house.
The bomb shelter is amazing at keeping you safe and takes a specific skill set to build correctly... but most people don't need it, they need a house. Houses are way more flexible and customizable and popular.
ladder logic, AAA programming, Function Block Diagram or Statement Logic
Ladder Logic
-Easiest to google that term and look at the images.
-is limited to automation programming, I wouldn't expect anyone outside automation programming to know what this means
-programming is done using a GUI that is reflective of looking at an electrical wiring schematic
-each "rung" is programmed by selecting the input structure (and/or...) and then firing an output like in a wiring schematic
-all the "rungs" together kinda look like a "ladder" -> Ladder Logic
-automation programming became a thing with electricians started making more and more complicated panels using relays, timers and counters
-they got real programmers to make the first "PLC" that could do this using a program... and an industry was born
AAA Programming
-I just made this up
-was attempting to identify the difference between a big name brand programming language vs. small name brand programming
-in my world this would be companies like Rockwell or Siemens PLCs vs. say, DirectLogix or Carel PLCs
-in normal programming, I'm not sure if this analogy carries much weight (I don't know enough about the industry of normal programming to know either way)
-idea is similar to video games though... a "Triple A" game ("AAA") would be one made by a big name like Activision/Blizzard or Gearbox with years of experience and billions of $$$ as compared to an Indie game or other start-up company
Function Block Diagram
-Easiest to google that term and look at the images
-looks kind of like a flow chart
-again, like Ladder Logic but just using a different GUI to do the same thing
Statement Logic
-this is the one that's closest to normal programming
-but it's very basic, like loading values into registers, doing compares on those registers, and then setting outputs using lines of text as opposed to a GUI
the code outline approach where you distribute bare bones functions and data object definitions among code modules then fill in the details.
Sounds like real/normal programming.
I don't do a lot of that.
Although, more and more automation programs are getting away from PLCs and moving towards Industrial PCs (just expensive PCs, really) that run code like that (usually VBScript or C++, but I'm sure that varies as well.)
PLCs were popular for automation because in the days of Win 95 (and even earlier...) you did not want your computer running 24/7. Because it couldn't do that.
Today, Windows 10 actually can run 24/7 quite well (if you protect it from requiring reboots due to automatic updates...). Especially on good hardware (or even a VM) which is why the shift from PLCs to regular programming is gaining popularity.
Think of a bottling line with glass bottles zipping along on a conveyor. It never stops. Ever. If it stops - the company is losing money. 100% uptime isn't just a desired utopian goal... it's a requirement. It's still impossible, even with PLCs... but the efforts to get closer and closer and closer are much higher in automation programming. Shutting down even once a month for a planned reboot would be met with gnashing of teeth and screaming.
I can see the line of demarcation between automation programming and regular programming slowly disappearing. But it's going to be many, many years longer before that happens. Quite easily decades or more.

This message is a reply to:
 Message 3 by Percy, posted 04-04-2023 9:26 AM Percy has not replied

  
Newer Topic | Older Topic
Jump to:


Copyright 2001-2023 by EvC Forum, All Rights Reserved

™ Version 4.2
Innovative software from Qwixotic © 2024