News for hackers. Stuff that matters.
Re:State Machine in Real Life by FpUser on Saturday May 02, 2020 @07:23PM (#23055674)
On a level you've just shown they're pretty simple in nearly any language. I do use state machines quite often in my code but mostly on a different level. Multiple threads communicating to each other via home grown PS bus
Re:State Machine in Real Life by monocasa on Saturday May 02, 2020 @07:51PM (#23055803)
The ADTs of state and event let you encode the validity of access to data, and whether you've fully enumerated your state/event tuples in a way that isn't available in a lot of languages typically used when writing state machines.
Re:State Machine in Real Life by FpUser on Saturday May 02, 2020 @08:31PM (#23055986)
Sounds like you're trying to "scare me" into language. I have what I believe is superior implementation and have no problem counting states. Thank you but I am fine. It is not that I am against the Rust. Rich ecosystem is always good. Personally however I feel no real need for Rust at all. I understand that it is trying to be better C++ but frankly with modern C++ its libraries and tooling I've got enough safety features up to my gills. I do not remember when was the last time my products had memory leak, overrun etc. I do use bunch of other languages but so far had zero reason to use Rust. I live off my own products or products I create for other companies on contract basis and from that perspective adding yet another language would not earn me one extra penny. Rather quite the opposite.
Re:State Machine in Real Life by monocasa on Saturday May 02, 2020 @08:46PM (#23056033)
That's a really defensive response. I'm not telling you to do anything or trying to "scare you". I was literally just saying how it has been helpful to someone who previously was a lead on a C++ RTOS and wrote a lot of state machines, both in C++ and in Rust.
Re:State Machine in Real Life by FpUser on Saturday May 02, 2020 @09:27PM (#23056194)
That's a really defensive response. I'm not telling you to do anything or trying to "scare you"

It sure sounded this way (trying to scare) to me but if I am wrong please accept my apology. Besides I did say "sounds like" ;)

Re:State Machine in Real Life by vvanders on Saturday May 02, 2020 @08:48PM (#23056041)
> I do not remember when was the last time my products had memory leak, overrun etc ...

That you know of.

Stack and heap corruption have this nasty habit of surviving for weeks/months/years until the layout of something completely different changes and the whole thing comes crumbling down.

Re:State Machine in Real Life by FpUser on Saturday May 02, 2020 @09:26PM (#23056186)
As a practical being often paying for product development phase myself I tend to worry about things that pose the actual problem. I'll worry about the "whole thing crumbling down" when/if it ever comes. As far I concern in my about 40 total years of experience it did not happen. If it happens to some other developers - not my problem.
Re:State Machine in Real Life by vvanders on Saturday May 02, 2020 @09:54PM (#23056285)
C++ isn't even 40 years old but if you've got some secret technique that has eluded modern software engineering then by all means feel free to share it with the class.
Re:State Machine in Real Life by FpUser on Sunday May 03, 2020 @12:32AM (#23056874)
Did I ever say that I only develop in C++? As for tech I did say that modern C++/libs/tooling supply more than enough safety features. If you do not know what those are please do feel free to educate yourself