Programming Q's. Recommendations for a web based app developing. - by DiMarzio
DiMarzio on 4/6/2015 at 12:57
I've studied Javascript for a few days and I think I can now do something with it. But I'm still a bit out on the open. If I have my database on my server, then what are the roles of server-end (Python) code and client-side (Javascript) code? Which one has the main program in it and which one handles database queries?
I assume that python has the main program and handles the database, and Javascript is simply an interpreter, telling HTML and CSS what to show on the page, right?
But is it possible to do it with only Javascript? It could eat JSON straight from a noSQL database, running in the server.
242 on 4/6/2015 at 16:19
For your purposes PHP, mySQL, HTML5, JS(JQuery), CSS3.
Quote:
If I have my database on my server, then what are the roles of server-end (Python) code and client-side (Javascript) code? Which one has the main program in it and which one handles database queries?
Think of JS as a programming language for browser, you'll want to use js for lots of purposes and it's basically unavoidable.
Server side contains main program (PHP, Java, Python whatever) and handles database queries.
Though it's ambiguous what to call "main program". Client side can be more elaborate.
Pyrian on 4/6/2015 at 18:15
Quote Posted by DiMarzio
I assume that python has the main program and handles the database, and Javascript is simply an interpreter, telling HTML and CSS what to show on the page, right?
Not quite. HTML and CSS are adequate for display. JavaScript allows you to script the display, and generally handles UI duties. It can go a long way towards reducing hits on the server by taking care of little things that don't really need new data.
Quote Posted by DiMarzio
But is it possible to do it with only Javascript?
I suppose, but I wouldn't recommend it. The security implications alone mean that most companies never even consider such an arrangement. It's much easier to go the other way, serving up static-ish pages by leaving the JavaScript out.
Kolya on 4/6/2015 at 18:59
Client side is never safe and Javascript runs client side. But more importantly you don't know how reliable the connection will be and what kind of machine you'll end up on.
Could be a gaming machine on a fat line. Or it could be a 3 year old smartphone whose owner is just trying to catch the tube. HTML+CSS is way more robust in this case.