On js I program quite recently and the impression of it is not the most pleasant ... So, from the very beginning.

The project is written on a bunch of php + js. A lot of things are loaded using AJAX. Any buttons, text blocks, pictures, etc. constantly changing + all sorts of redirects are made. One gets the feeling that sometimes js is somehow clumsily loaded, and, therefore, sloppy works ... Tell me, how much can this correspond to the truth? Or nothing to blame the mirror, it's all about mistakes? I really do not understand what is the cause of this or that error. They appear completely unforeseen and at random times. How can I improve the stability of work?

  • Not all browsers work the same way with some JavaScript code. Therefore, we must constantly test the work on different browsers. - Anton Mukhin
  • When I started writing to js, ​​I also hated him quietly, now this is my favorite language, moreover now even nodejs started learning so that I also had a server on it ^^ <br> Regarding the topic - you yourself wrote that you write recently, and What did you actually want? So that you write quality code right away? Alas, this does not happen ... <br> Of course, you need to test it in different browsers, but you don’t need to get too carried away. <br> By the way, despite the fact that the language is interpreted - most modern browsers use Just In Time cospilation, so it's to blame most likely you ... - Zowie

1 answer 1

The feeling is created because web programming is a jumble of heaps of languages, markup and technology. Most likely the problem is in mistakes, I want, of course, to blame the language, the program, the tool, but if you use popular tools - 99% is your fault, a mistake, an incorrectly built architecture (generating a bunch of inconsistencies) or ignorance of the toolkit. Use debugging tools, learn how to locate the problem, constantly improve the project's architecture and js (and any other language, except perhaps brainfuck-a) will seem to you an excellent language. =)

  • I do not blame anyone, calm down =) I do not know the toolkit, this is true. Therefore, I ask for advice - Julia Emelyanova
  • No, I describe my situation more, but I think it suits many newcomers. Personally, if you are worried about errors in js, use <b> firebug </ b>, an excellent simple and at the same time powerful thing. Without her, as without hands. For php, there is xdebug, but I myself still can’t screw it in - culebre
  • ddaaaaa already understand firebug. Thank you all very much - Julia Emelyanova
  • in fact, any developer console is suitable for debugging ... <br> Personally, I like the GoogleChome console the most. works faster (firebug is not to blame here, but mazilla itself is slower than GoogleChome) - Zowie
  • Firebug is on Chrome and its functionality, although less, but still IMHO is better than chrome. By the way, I started personally with the Chrome debugger. But still the inhibition of debager is not so critical. The end user is important result. But with the brakes of the mace, of course, I will not argue))) - culebre