|
I didn't mean to imply otherwise.
Edit: Adding, generally the ones that require design changes are usually "the best" (as in, have the most impact) because they are often what I call algorithmic changes. You can change the way something works as opposed to doing last mile bit twiddling which tends to (except in some cases, like in my SVG direct writes) yield less spectacular results. What I'm talking about in the OP is ways to identify potential areas where a design change might be in order for optimization purposes later, and then designing such that you can shoehorn it in without upending the whole thing.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 2 days ago.
|
|
|
|
|
Lowercase variables require less space.
|
|
|
|
|
Oh'Really?
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Yep, lowercase tends to use less space on a line when using a variable width font.
|
|
|
|
|
What vitamins do you take? Do you hear voices in your head? You scare me.
<-- in case you missed the humor.
That's some impressive stuff. Templates have always scared me - I don't understand them (confession) but they seem like C++'s version of macros on steroids and PCP. I need to go learn them.
Charlie Gilley
“Microsoft is the virus..."
"the problem with socialism is that eventually you run out of other people's money"
|
|
|
|
|
They are basically that.
I think of them as kind of a mail merge with "smart" (typed) arguments.
A template is a source code generator. The C++ compiler process the arguments using the compiler's type info, and then emits more *textual* C++ code as a result. That result is then fed back into the compiler and parsed, much like a preprocessor macro.
Where templates get primarily confusing is template specializations, but that's where their real power is, and what I'm using above.
The two struct templates are part of the same overall template. The second one is a specialization for when the draw destination is a bitmap<rgba_pixel<32>> . When the compiler sees that it generates the alternate.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Yup - I understand the basic concept. I think a developer's attitude toward templates (and macros for that matter) depends on their initial exposure to them. I've seen templates used in a) books and b) one project that I support. The book examples tend not to really demonstrate the problem they are trying to solve - it's just dry, it gets complicated and most of the time I hit the location of "what's the point?" How is this really helping me?
The second example - templates in use have to be done correctly if you want to be able to understand the problem they solve. I've seen templates used in code that just make everything more complicated and add unnecessary complexity. Or the template approach used just doesn't make any sense - more of a "hey let's try a template approach..."
I need to go grab some older but much cheaper books on the subject to revisit.
Charlie Gilley
“Microsoft is the virus..."
"the problem with socialism is that eventually you run out of other people's money"
|
|
|
|
|
I taught myself C++ without picking up a book since the 1990s (i had exactly one, and it was crap)**, so there are holes in my knowledge, but what I have learned is practical.
Where templates really open the language up and make it do things no other major language can is metaprogramming.
Metaprogramming is incredibly powerful.
Metaprogramming is confusing, because C++ wasn't designed to do it. Rather, it was discovered and accomplished by stretching the intended purpose of the template keyword well beyond what it was initially designed to do.
Try this on for size - my terminology might be a little off, but the concepts therein are sound:
Metaprogramming in C++: A Gentle Introduction[^]
** Edit: I have to amend that. For some reason I forgot about Accelerated C++, which was actually quite good, if dated now.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified yesterday.
|
|
|
|
|
First rule of optimization: Don't do it
Second rule of optimization (only for experts): Don't do it... yet
Just in case... it is a quote by someone I do not remember and I now am too lazy to look for.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nordic just released a WiFi6 capable embedded radio. The Espressif ESP line of chips have WiFi, albeit older.
The trajectory seems to be connected IoT devices doing more and more.
HTML5 is relatively simple. It can be processed top down for the most part. They did a good job cleaning up HTML4 and making the spec more coherent. It's already what I'd consider mostly appropriate for embedded.
CSS, not so much, and it's where I'd like to see some kind of formalized standard for a CSS subset compatible with forward only processing.
What's the value in this? Frankly, being able to run web interfaces on sub ARM Cortex A chips opens the web up to far more affordable hardware. An ESP32 devkit with an integrated screen costs $18 on amazon. An RPi with no screen is in the ballpark of $100. They're different kits entirely, but I'm talking about the little guys.
Currently to make a connectible device talk to the web it requires a dedicated UI for that web app, and usually a REST or MQTT based communication on the back end. What if you could provide your simple UI from online sources that update all devices immediately when the back end changes? just for example.
CSS is the big blocker, in my experience, because of the DOM requirement. Simply choosing the right subset of selector syntax for embedded would be wonderful, but they can probably remove some of the heavier features such as font and image embedding as well.
I think what will *probably* happen instead is the price on webkit capable devices will bottom out, and then everything will have 128MB of DDR3 or better instead of 512KB of SRAM. That will solve the problem too, but is much more power hungry.
I think it's nice when a capabilities problem can be largely solved by pruning and spinning off an existing standard. I think it's possible with web stuff.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
An interesting thought.
Are you suggesting also dropping the Javascript virtual machine from the client environment also?
A real back to basics web page with no CSS and no interactivity via Javascript?
|
|
|
|
|
I think so, short of IoT MCUs being able to interpret JS** which isn't very realistic.
Still having it presented declaratively and on the web as HTML5/CSS as stripped down as it may be for embedded:
A) Should reduce cost of development, as you can hire people to do basic HTML and CSS (EDIT: see notes) instead of knowing C or C++
B) Can potentially be a server templatized/dynamized page and spun off of a full fledged website when an embedded device hits it. This is already often done for smartphones
C) Would provide pain free UI updates that instantly roll out across all devices.
There are probably other benefits that aren't occurring to me right now, but those are some major ones I see.
** it has been done, but i think it's precompiled and uploaded, or at least semi-compiled.
CSS notes: CSS can be forward only processed if you limit the CSS selector syntax to specifying ids and classes, or maybe only slightly more complicated than that. In theory you could do like .foo/bar/baz potentially and it could still be forward only, but would be more complicated. I'd be inclined to ditch that feature, but if it was in there it wouldn't be a performance killer. Parent references would be, as well as forward searches in many if not all cases (i haven't baked it all out in my head at this point)
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 2 days ago.
|
|
|
|
|
You would have to eliminate all HTML events (like onclick, onblur, onfocus, etc.) Right?
|
|
|
|
|
I would eliminate JS, and "active CSS" elements that deal with the dom yeah, so no dom events.
The whole idea is to make it renderable without keeping the entire document in memory.
Basically forward only, render as you go, and then toss once you've rendered.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
OK, got it.
Reminds me of the old IBM Block mode terminals that had a physical map (with all literal fields and color specs, input specs and protection specs) and a data map that was only the fields that returned values. Both were sent to the terminal which would use a forward only processing to paint the screen and enable the unprotected fields. Any action key on the terminal transmitted only the data map to the invoking program. It was up to the program to split the data map back into fields and do any validation and processing of the data. (very efficient use of transmission bandwidth in the old days.)
|
|
|
|
|
Anyone who hates it doesn't really know it and cannot come up with a better solution to a declarative UI descriptor. And it's muuuuuch easier to hate than to learn, now ain't it?
Also, anyone who intentionally is provocative to spew hate (out of boredom or some other psychological issue) only wants to drag people down to their level because it's very, very low and misery loves company. Probably has lousy relationships in real life and is generally not liked... except by other hateful people.
Happy Friday! May the winners in life have an awesome weekend. You guys rock.
Jeremy Falcon
|
|
|
|
|
Jeremy, as a friend I must tell you that some people might consider this post to be trolling.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I'm not sure if this was a joke about CSS or about me being anti-hate. If it was a joke about CSS then here's the obligatory "ooohhhh snap".
If it's about the anti-hate thing, I can totally see that. But, for those that I'd consider winners in life, it's no less trollish to them than having to endure >50% "I hate XYZ because I hate everything" type posts. This is why people I'd consider successful become disenchanted with this place. You talk about what you hate and everyone agrees. You talk about hate being bad and people get upset.
Not sure what you meant buddy.
Jeremy Falcon
modified 2 days ago.
|
|
|
|
|
You know what's awesome?
Just dragging the stuff you want to place into place, including docking containers, and telling stuff to scale/align accordingly and never needing to screw with some esoteric second hand declaration (that quickly goes 3rd and 4th hand) of what you could just directly see and manipulate in real time even if CSS were sitting somewhere under that hood.
But what bit of language sits under it doesn't matter because it's the car that matters.
|
|
|
|
|
Not everything is drag and drop or WYSIWYG... unless you use VB. Not sure what you're getting at.
CSS is a descriptor no different than LaTeX or postscript. Saying you can't drag and drop with it has nothing to do with the language itself.
Jeremy Falcon
|
|
|
|
|
I am by no means an expert in CSS. But I agree, it is great for using for doing layouts. I have used it a bit and it is great. But I can also see how it would be a real pain to parse to properly display the intended layout, which I believe the other post you are taking a dig at was talking about. Please keep your personal dislike of others to yourself. You are both great contributers here and I personally enjoy reading both of your stuff.
There is a reason why politics and religion are not discussed on this forum, as it tends to drive a wedge between people, so posts like this are also doing the same.
You rock also, but please stop this.
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: I am by no means an expert in CSS. But I agree, it is great for using for doing layouts. I have used it a bit and it is great. But I can also see how it would be a real pain to parse to properly display the intended layout, which I believe the other post you are taking a dig at was talking about. As always... a tool is that is very good for a particular task doesn't specially need to remain that good in the moment you need something slightly different.
PJ Arends wrote: Please keep your personal dislike of others to yourself. I am happy that this time I read the other messages before posting mine, I like the way you told it
PJ Arends wrote: You are both great contributers here and I personally enjoy reading both of your stuff. I totally agree
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I'm upvoting this even though you don't like my post. Why? I know you're not coming from a place of hate, buddy. Even though you think my post is stanky.
Jeremy Falcon
|
|
|
|
|
Thanks for the confidence, and yes, you are right, I am not "hating you". But I know you know you are sometimes (being optmimistic here )a bit polemic (and I think you even like it) and this time is one of those.
It is not always what you say, but how you say it.
I am not sure if you will search / try it, but I think you would profit a lot from "non violent / Mindful communication". I for sure am doing it, it needs a process, but it helps to reduce verrbal fights without needing to reduce your "saying what you want to say"
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: Thanks for the confidence, and yes, you are right, I am not "hating you". But I know you know you are sometimes (being optmimistic here )a bit polemic (and I think you even like it) and this time is one of those. It is not always what you say, but how you say it. Ah you know me well. I don't think I enjoy it, per se. Maybe subconsciously I do and I'm just in denial. But in my mind, I want to wake people up. People are so caught up in their automatic way of life with zero thought. And in here CP, it's a lot of hate by a lot of folks doing nothing in life.
Anyway, you only have two ways to break auto pilot habits with peeps stuck in their ways: shock factor or repetition. The more stubborn someone is though the less repetition works. Some folks literally stop mentally growing until they pass. And I don't know about you... but it's been my experience here that peeps don't have the level of chat you and I have, for instance, that would indicate a desire for personal growth.
Nelek wrote: I am not sure if you will search / try it, but I think you would profit a lot from "non violent / Mindful communication". I for sure am doing it, it needs a process, but it helps to reduce verbal fights without needing to reduce your "saying what you want to say" I feel ya bro. And I 100% acknowledge I can be an ahole, but I'm an ahole from a place of love. It's usually me taking up for something or demanding a level of respect from peeps that most devs just don't know how to give.
Some food for thought though. Most successful peeps know (non-devs) know that engineering types are some of the most overly emotional peeps in the world. What's ironic is a lot of devs treat people like dirt because they're socially clueless, but then they cry when something happens to them. Just like a child. I find only overgrown children or losers take offense to what I just said. Us over in the adult world are like "yup".
One of my old bosses used to say, it's just as much the receiver as the speaker as to whether or not something "is an attack". And, I'm not saying it wasn't aggressive or that you're wrong. Just playing devil's advocate a bit to let you know, I'm always gonna annoy overgrown children.
Edit: And you could make the argument that's what an overgrown child would say. And to be honest, I agree. In my mind though, I'm still taking up for something and aggressively being anti-hate. That's the rationalization at least.
Jeremy Falcon
modified yesterday.
|
|
|
|