this post was submitted on 01 Sep 2023
339 points (96.2% liked)

Programming

17453 readers
66 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 42 points 1 year ago (28 children)

Go with what works

Error messages should contain the information that caused the error. Your average Microsoft error "error 37253" is worthless to me

Keep functions or methods short. Anything longer than 20 - 50 lines is likely too long

Comment why is happening, not what

PHP is actually a really nice language to work with both for web and command line utils

Don't over engineer, KISS. Keep It Simple Stupid

SOLID is quite okay but sometimes there are solid reasons to break those rules

MVC is a PITA in practice, avoid it when possible

[–] words_number 8 points 1 year ago (7 children)

Hahaha this is great! All points are basically entirely obvious and common sense and then you hit us with that ridiculous statement about PHP. Outrageous!

[–] [email protected] 2 points 1 year ago (6 children)

From what I've seen is that 99% of the PHP hate is people parroting slogans others came up with, and the rest is that there are inconsistencies with the function signatures.

That last part is very true, of course, but not really an issue with modern editors as they will already tell you what's expected. On the other hand, the inconsistencies are still there for a reason: compatibility. JavaScript what's a nightmare to work with because every week an update would break shit because of changing method signatures in JavaScript packages. PHP always worked and remained working because it changed so little in that respect.

In all other areas it hugely improved and matured over the years, just like all programming languages.

So yeah, I find the PHP hate childish, really.

[–] jvisick 7 points 1 year ago (1 children)

Honestly, “it’s better than JavaScript” is a pretty low bar.

I don’t like PHP because I think the syntax is ugly and I’ve only used it on systems that are old and a pain to maintain, but I’ll also very freely admit that I have absolutely not written enough PHP to have an informed opinion on it as a language.

[–] [email protected] 1 points 1 year ago

True enough on JavaScript but I mention it because people always take that for comparison. I've used it for hundreds of projects now and for me it's become my default goto language because I can slap together anything with it. It now has good (optional but encouraged) type safety, which greatly improves code quality so yeah.. love it

load more comments (4 replies)
load more comments (4 replies)
load more comments (24 replies)