JavaScript and PHP

Do people structure a JavaScript application like they do a design pattern?
What I am saying is, it feels like… crap… sometimes… you know?

I can use JQuery. But I guess just organizing functions and stuff, sometimes just seems weird to do it this way…

It’s not impossible to structure javascript in a meaningful manner so it resembles, say PHP.
However, it is completely different language and sometimes it might look as it lacks in readability.
If you do prefer php’s way of creating classes and objects - you might be interested in reading the following:

This is an interesting point and it kinda relates to ORM/SQL (IMHO)

Javascript utilises a different inheritance model (prototypal), and does not have the same concept of “visibility” (i.e. public/private). There are various workarounds that can make JS emulate classical OOP - and various libraries (like MooTools) that promote this pattern.

There is an argument (and a good one IMO) that while this encourages users familiair with classical OOP to use the language, it also disguises the true nature of the language (hence my point about ORM relative to SQL). Design patterns ultimately originate in classical OOP - and although there are methods for achieving them in JS ( there are design patterns UNIQUE to JS that can’t be emulated by classical which will be lost if you focus on achieving classical architecture.

Thanks… I have to decide if this is going to be worth it, sometimes it seems like the organizing will take a lot of time to plan out.

What are you trying to do?
There are certain design patterns that translate well into Javascript - Decorator and Observer (commonly called PubSub in JS circles) for example