@JxstErg1 Yh, that’s true, like I said before it’s about the preference.
I tend to use frameworks when it comes to huge projects as I don’t want to re-invent the wheel and focus on coding the main part.
PHP has no use outside web development (and unintended to be used as FTP or web socket program) so it may be why some of developers dislike it.
Of course, I do use frameworks too; I even use other developers’ code. But no, PHP is not only for web development; developers use it to create desktop applications and many other things. like using command-line scripting.
From what I’ve seen, developers hate PHP because of the updates that change things consistently.
Php for desktop applications? Come ON
I put his code mainly because he decided to use textContent
instead of .innerHTML
to print (your year) date()
Oh. I don’t particularly appreciate making functions which I will not use again. It just creates more code that makes the Javascript file bigger. I usually always try to use things like ternary operators, arrow functions, and things like condition && (expression)
for a behavior like an if
block.
I am not a die-hard fan of PHP but I don’t think it is bad. However, I did find it annoying that when we moved from PHP 7.4 to PHP 8.2, that I had to fix a lot of my code. For example, if I had a cookie that the user didn’t have set yet (so null) and I had an if($_COOKIE["somecookie"])
it would throw an error. (Something like “unknown array key”). Another thing that annoyed me was not being able to have variables outside of a function be accessed inside of a function.
$var = 1;
function myFunction() {
if($var) {
// Some expression
}
}
It would throw an error that the variable didn’t exist.
Oh… Let me change that then!
Done! Now I also cleaned up the cache on Cloudflare, going to do that on my browser as well!
I used to use innerHTML
instead of textContent
for everything too, so you’re not alone!
I also used to use forEach
for everything until I found out that for
performs better.
I forgot to say I made some more changes to my website over editing the year line in the script to include textContent
instead of innerHTML
; the first one is the file rename with extension change from .html
to .php
to allow for PHP code, the second one is the extension removal from every link using the same .htaccess
I used for the HTTPS rewrite.
Yeah lol
Different developers have different approaches and preferences when it comes to writing code, so yh I can agree with you!
You can use global $var
to fix that error
And I don’t use functions in PHP lol, It’s a pain in the ***
Wait until it comes to the classes and methods.
Hell yh lol
Is there a limit to liking? I can’t like anymore
Yeah; it increases when you rank up as well.
Tried that, didn’t work. I just used function myFunction() use ($var)
. Still annoying, though.
I don’t use them that often but in the rare case that I do it’s a nuisance.
That is an interesting syntax, alright.
Yes, I thought that use
was only used to use namespaces but Bing AI told me otherwise.