20000 forum users - Awesome Special Event!

@JxstErg1 Yh, that’s true, like I said before it’s about the preference.

6 Likes

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.

7 Likes

:rofl: :rofl: :rofl: :rofl: 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.

6 Likes

From what I’ve seen, developers hate PHP because of the updates that change things consistently.

6 Likes

Php for desktop applications? Come ON :face_with_raised_eyebrow:

7 Likes

I put his code mainly because he decided to use textContent
instead of .innerHTML
to print (your year) date()

1

6 Likes

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.

6 Likes

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!

5 Likes

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.

5 Likes

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.

3 Likes

Yeah lol

3 Likes

Different developers have different approaches and preferences when it comes to writing code, so yh I can agree with you! :slightly_smiling_face:

5 Likes

You can use global $var to fix that error

And I don’t use functions in PHP lol, It’s a pain in the ***

5 Likes

Wait until it comes to the classes and methods.

6 Likes

Hell yh lol :joy: :sweat_smile:

5 Likes

Is there a limit to liking? I can’t like anymore :roll_eyes:

6 Likes

Yeah; it increases when you rank up as well.

7 Likes

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.

7 Likes

That is an interesting syntax, alright.

6 Likes

Yes, I thought that use was only used to use namespaces but Bing AI told me otherwise.

6 Likes