New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
React handles rendering really well.
Thankfully there is no UI, it interacts with an API directly with no web interface.
Not yet. I will give it a try shortly but I think I'll still be switching to Python to make my life easier.
Use ruby and syntax wise this will be much easier to manage.
I think Python would be my best bet since there are many more projects down the road that I plan on doing and Python is really big in the Raspberry Pi community.
Intercal. The world is moving towards Intercal.
I feel so dumb. I was looking at this the wrong way. Turning the MySQL query into a function like a sane person was wrong, putting the MySQL query directly into the code worked 100% the way it's supposed to.
PLEASE GIVE UP !
Here's how it'd work:
https://gist.github.com/jetchirag/daae82cb617e0f1a1c83fd08c99418e3
I'm also a mainly php developer and getting familiar with this approach was hard
PHP has callbacks as well
You can use callbacks in most languages. What I meant is we don't always use them.
@KuJoe The key difference is generally php does things serially and waits for a response. Node.js can do multiple things at once and does not wait, thus a callback to trigger when ready.
PHP can be made like node.js trough extensions.
PHP is bad, but it's rarely that bad. Just the coders who make it so. (I lie, PHP 7 is still highly crap.)
I guess you are one of those people that knows very little about PHP itself and just jumps on the "PHP SUCKS" bandwagon.
There is a lot of bad PHP code out there because the amount of novice PHP programmers - however, that does not mean the langauge is bad. At least provide a reason for your bold statements next time.
@Kujoe nodejs is better for scalability.
Like any other thing @WSS says, is all fake news. Remember he is a living meme.
@KuJoe I work with JS on a daily. I'll shoot you a message, happy to help anyway I can.
I don't hate PHP and I know it.
And really, PHP is an awful pile of garbage. Most seasoned PHP programmers have simply learned to work around its shortcomings. PHP is neither predictable nor consistent, and its libraries reflect the "throw crap at the wall" approach the language took to development. The inconsistent choices of naming funcitons in its libraries alone are amateurish.
To put php on the same plane as perl or python is absurd. Even PHP people don't defend that.
I could say more, but the web is full of reasons why PHP sucks: https://www.bing.com/search?q=why+php+sucks&form=APMCS1&PC=APMC
Personally, "PHP is a fractal of bad design" is one of my faves: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
PHP is, quite bluntly, a whole load of C libraries with hooks written with a QBasic-like interpreter without the strong typecasting.
PHP has been improving a lot. The 7.x versions are pretty good.
Is not like C#, C++, Python, Go or Node are any better. Each language has its faults. One language doesn't fit all purposes.
PHP framework: Laravel is super solid. The main problem with PHP as with any other language are the devs. Lazy coding, insecure code, etc.
Some people even say PHP is bad because of the bad coded plugin wordpress have.
In reality most of the people that complain about a language surely don't understand it or don't have enough experience to make such statements.
Aka show me your CS Ph.d then your statements might get some credibility.
Um, where did you get yours? If not, why do your statements have credibility but those who disagree with you require a PhD...?
That is not even remotely defensible.
It's a nice try at a troll, though.
That's the point neither my or yours (LET collective) statements / opinions about how good or bad is a programming language are truly valid. If someone really have the credentials (achievements for example: Ph.d ) then that's a different story, otherwise is all noise. Let's just simply say each language has a role.
I appreciate the discussion but PHP is not the topic here nor will anybody in the world convince me to stop coding in PHP for my normal projects.
I figured out a fix for my JS code on my own so I think I will continue using Node.JS for this project.
Good PHP is good. Bad PHP is really bad.
@OP, Node.JS is well worth using, goodluck with your future projects.
Please, for the sake of keeping your memory footprint low, preventing memory leaks and not killing your MySQL server with thousands of connections, create a controlled MySQL pool of connections once at the start of your code, then use that MySQL connection to query data:
http://xor.meo.ws/lU5IqIgskyQtAwgTIv-nzCiGFU0e_jGE.txt (Can't write that code into the post because CrapFlare...)
Using promise async/await to avoid callback hell (async/await is available on Node 7.6+)
https://www.npmjs.com/package/promise-mysql
When a library said they support promise, you can call it by const results = await mySqlQuery();
PHP gets more of a bad rap because of Wordpress, or does Wordpress get a bad rap because of PHP we may never know.
Both.
Oh just stop. Ever taken a look at how Wordpress is written? That right there is the definition of bad code. That does not make the programming language. Nor does you writing bad code in whatever other language make the language itself bad.
I looked into this but connecting the MySQL server when I needed the data was significantly easier for me and works perfect for my needs. Thanks for the suggestion though.