Guidance for C++ / Python developer to understand the web dev world [closed] - frontend

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am programming since quite some years now.
Until now I was mainly focused on writing "normal" applications which run inside a console or with a GUI, sometimes also applications which interact with hardware components such as sensors / actors / ...
During this time I got to know a lot of cool programming principles and tools such as object orientation, modularization, unit-testing, test-driven-development, desing-patterns, code-analysis, ..
Also I have some first experience with hosting a wordpress blog, running static web-sites on a nginx webserver, and writing some small php-forms. But I feel like there is still too much magic in all these web-development topics. And I would like to fill this gap and learn a bit more about all these connected scripting / programming languages and technologies. (Because I hate, when I don't understand how things are working :D :D )
I started with some online "Web-development bootcamp" course at udemy to get a rough overview. This took quite some days now and I think HTML, CSS and Javascript for DOM manipulation / animations are clear to me now. Also I heard a lot about NodeJS and all it's derivate languages and databases like Mongo-DB. But still I feel like there is a lot of things unclear to me.
To get to a better understanding I wanted to development some small web-application. Nothing very special, just some website where you have to login to, are able to generate some data and this data is then persisted into a database and once you login again you are able to see the data again.
I first started with developing some classes in Javascript to represent the data in the browser while you are logged in. But I very soon realized that the Javascript which can run inside the browser is very limited and already for unit-testing and modularization into separate files that include each other I actually needed to do some crazy work-arounds or use other server-side languages like nodejs / php / ... .
After some time coding I decided to take one step back, trying to understand the basic design patterns of web-applications and not running for a long time into the wrong direction.
My questions are:
Is there some typical way to go / best practice while developing web-applications?
What are the typical key players? I know there is the difference between front-end, back-end and databases.
But are there some do's and don't's that good WebDev's follow?
For example:
which code is usually written in back-end / server-side languages?
What is usually done in the front-end? (Only desing and animations?)
Do I have to move all business logic into the back-end, also for security reasons or is this maybe also a bad idea because of peformance reasons?
What programming languages are more or less dead and not to be used in the future?
What things are typically reused from frameworks, for example authentication and session handling?
Also I felt like some things I know from other programming languages are not so easy in languages like javascript / nodejs. I am willing to spend time and effort into learning all these things but I would also like to keep the quality standards that I know from C++ /
Python. On the other side I also wondered if these patterns that I have in my head are maybe just boundaries that are completely useless in modern web-development? (e.g. typing, object orientation, modularization / splitting the code to be very reusable )
What do you think am I on the wrong track here, or do I maybe simply use the wrong languages?
I hope the long text is not knocking everyone down / keeping everyone from answering me :o
I would really appreciate your help and guidance to understand everything a bit better and to not repeat the things already a lot of others have done wrong ;)
BR, mezorian

First off, most of the questions are very opionated (at least the answers are) and your question will probably be closed for that reason. So I will post my answer before completing it and expand on it after.
First off a good roadmap to become a web developer. I like it mainly because it shows the crazyness the web development world has come to (don't be shocked!): https://levelup.gitconnected.com/the-2020-web-developer-roadmap-76503ddfb327
Trying to answer some of your question (answers are my opinion):
Is there some typical way to go / best practice while developing web-applications?
I'm tempted to say there are as many ways to do web development as there are web-developers in the world, but that might be a bit exaggerated. If you want some guidelines, I'd pick one of the major web frameworks and learn the way they do web development. With web frameworks I mean all kinds of frameworks starting with JS-frameworks all the way to static site generators, etc. They all have their ecosystem and their own rules.
What are the typical key players? I know there is the difference between front-end, back-end and databases.
(personal opinion) I work with Go in the backend. I love it because it brings back some simplicity in the crazy world of choices being a web developer. Since you know C, Go will probably be easy for you. It has static typing, structs, etc, but no need to manually manage your memory. It is also much faster than most other backend languages used in web development (Python, NodeJS, PHP, Ruby, etc).
In the front-end I have used native JS, jQuery, React, Vue, etc. I'm still waiting for something that makes things easy again. Flutter seems to be something that has a good approach, but is not really a web front framework (yet). (Don't do public websites with Flutter! They are not indexable.) We'll see where it goes.
Databases I will not go into here as that is another huge topic. Let's just say that I'm more a fan of using multiple databases for their specific strengths rather than a big one that is supposed to be good at anything.
which code is usually written in back-end / server-side languages?
Even this depends largely on your choices (framework and preference). One thing for sure has to be in the backend and that is security related stuff. Anything you put in frontend code is visible to an experienced user.
Apart from that there are some ecosystems where you don't write any backend code but talk to a (cloud) service that is basically like a database with a web endpoint on top with secured login. (for example https://firebase.google.com/.) Here the security related stuff is baked into the service.
If you do both, keeping business logic in the backend is probably a good idea. If the frontend calculates something (for quick response), the backend should double check that (e.g. calculating the total in a cart). But this is too general. There can always be use cases where some business logic needs to be implemented in the front-end.
Do I have to move all business logic into the back-end, also for security reasons or is this maybe also a bad idea because of performance reasons?
Performance can be a problem, but mostly because the roundtrip time to the server and back. If you do that for every tiny information, the UI will become sluggish. You might want to think about doing e.g. a calculation client-side.
JS-Frameworks like React, Vue don't request html from the backend, but data and build the html based on that data client-side. I'd use them if I have a very data driven website / webapp, especially if it is user-dependent. Transferring only the data and building the html for every site from it in the browser based on user settings and data, saves a lot of roundtrips.
If you are worried about server performance: For the server to hit its limit, you'd need heavy usage of your website for that to become an issue (at least with Go). If you get there you can still use horizontal scaling (multiple instances of you server) to solve that. Unless you are working for a large company with millions of users daily, I'd not worry about scaling for now.
What programming languages are more or less dead and not to be used in the future?
Warning: Very opionated!
I'd say PHP is dead. Many headhunters I've spoken with agree with me. Companies are desperately looking for PHP developers, because many developers are moving on from PHP to something "cooler". You'll definitely find a job with PHP, but might not be so happy with your job. For me it is also a sign of how modern a company really is (if PHP is not it's main backend language (any more)).
Python currently has a big boom. Mostly because of AI development. I'm not sure if that boom is also in the web development, but I'd say not. I used Python before Go (5+ years ago) and before that PHP (8+ years ago). I rarely get Python web developer job offers (at least compared to PHP and Go).
Go is the language of the cloud. It is perfect for concurrent programming which is an essential part in web development (every http call should be handled concurrently). It is fast and light weight and doesn't need anything installed on the server to run (compiles to a single binary without dependencies).
NodeJS: Haven't used. I'm not a fan of Javascript (but it was (and kind of still is) the only option in the browser), so I never liked the idea of using it also in the backend.
TypeScript: might be an alternative to JavaScript (thinking of frontend here) if you like a more structured language.
It sounded like you want to build a user baser web app with data being managed by each user. This is what I would (probably) do in that case:
Backend in Go
Go serves static files (start html, css, js, images, etc.)
Go server has an api endpoint that serves data (e.g. REST style)
Vue (or React) in the frontend
Vue requests data from the api to build the user-specific content

Related

Confused in with real time web server choice [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to develop real time web application like chatting & real time message conversion. I searched the internet and got confused with few technology
erlang ejabberd nodejs openfire
Right now im in java domain but won't hesitate to learn new things. So can anyone explain what is these technology in a very simple words and what technology i will need to achieve my target ? Does all these do the same thing ? and new technology suggestion from your side will be appriciated.
These are entirely different things :)
At the lowest level you have:
Erlang/OTP is piece of technology, that lets you built low latency, fault tolerant systems. It includes Erlang programming language, Erlang VM and OTP, which is set of patterns, libraries and good practices for writing those systems.
nodejs is a platform, that lets you code JavaScript on server side. It makes your life a little bit easier, when dealing with events, but Erlang is still better saving you from callback hell with actors and messages between them.
At the higher level you have xmpp:
xmpp is eXtensible Messaging and Presence Protocol. This is great for implementing chats like facebook chat, but because it is extensible, you can use it for any kind of messaging.
ejabberd is implementation of xmpp in erlang. There is also fork of ejabberd called MongooseIM. Those will give you great start at developing your messaging application. They implement not only basic xmpp, but also couple of extensions (called xeps in xmpp community).
openfire is solution based on xmpp, so it is even higher level. For chatting and message conversion, this might be overkill, but it depends on your specific needs.
Totally an opinion post:
Erlang: Doing this from scratch with yaws and Erlang is the most straightforward way (its even a code sample in "Programming Erlang" 2nd ed.).
Ejabberd is famously undocumented (and overkill for most webchat services), but it and its better documented/saner cousin (MongooseIM) are robust and already written.
node.js is a cosmic joke played on monolingual ex-frontend web developers.
I've never heard of openfire.
None of these things are bad to learn -- but that's because nothing is ever bad to learn (though some things aren't worth the time you would spend learning them).
The basic problem, I think, is that your goal is probably more broad than you realize, at least in terms of methods by which you can achieve the goal of "develop a web-based chat and communication service". There are a hundred web servers out there, each with its own way of doing active content service, each with a hundred more back-end plugins to a thousand more chat/conversation/comments/blather service frameworks. Any given "technology stack" will often involve a dozen languages throughout it (consider service pages written in PHP from an Apache server which proxies to a Tomcat webserver for pluggable content which calls out to a tiny scheme chat service which stores data in Postgres...).
The situation with most web stacks is, in my opinion, laughable. That is at the core of the Node.js idea, actually: pick a language most people know and stick with it throughout. The problem there is that not every language is well suited to every task (or any task...). But the basic idea that cutting the web tech clutter down is quite sound.
That said, I sincerely think the easiest place to get started is with a relatively tiny language with a small, hyper-knowledgable community around it, and focus on doing everything you can in that language. For this particular task (live web comms) I prefer Erlang and Yaws, writing the service from scratch until some element of it obviously is in need of some pre-written framework treatment. (That is not the right choice of tools for everything, though, so keep an open mind and learn to hate every language, at least a little -- they all suck, just some less than others.)

Is node.js ready for medium/big business web application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I work on studying the development of a medium web application intended for hotlines. So I've real time, concurent access, big datamodel and CTI constraints.
Originaly I'm a php and Java EE developper, but like many of us, I've read a lot of news about node.js and I tested it with small apps. The possibilities of node.js are awesome, but I felt that it's very difficult to only use this technology in a medium/big web app. Indeed frameworks like express are minimalistic compared to productive framework like symfony, play or ROR, etc. Moreover, the node.js ecosystem progresses very fast and might be difficult to maintain.
I'm not experienced enough in nodejs, so I want to know; is choosing only node.js to develop a medium/big business web app with some real time problematics crazy or not? Don't you think that coupling a productive framework with nodejs only for specific features (real time) is a better way ?
Thanks,
Regards
Eric
I'm working on a large real-time business web app that requires some real-time interaction and what we are doing is using django for just about everything, and handling the real-time stuff using the now.js library. Originally we planned on using node.js for everything, but to alleviate some time constraints, we decided it would be quicker to use django.
One thing we have noticed since we've started is that there are a lot of changes, and that some of these changes break what we've done. For the most part, keeping up with the changes hasn't really made it difficult to maintain, however it has made it difficult to follow tutorials and such.
I'm going to answer this quickly, before the question is closed for only being answerable via opinions, not facts.
So, I'm going to answer with my opinion ;)
I think node.js's focus currently is on building small things that respond very quickly. I sense a lot of pushback in the node community against "too complicated abstractions". (It's possible I'm misreading the community, but I don't think so).
To me, building a business app (example: some of my past Rails projects have been 10ish man years) I want an ORM abstraction layer, etc. I think you'd want this building even an app with more than a few man-months of effort in it.
Unless something changes (the node community runs into problems when their code bases grow too large, for example) I suspect the "place" for node.js in medium to big applications is for small hyper responsive things (websockets, retrieving data from external sources and doing small things with it), etc.... not for building an entire big business workflow app.
It's 2016. Recently I decided to go with Sails / Node instead of CakePHP. Today I decided to go back to CakePHP. Lucky enough, I just coded one small module ( kinda of indexing inside a db some filesystem content ). The amount of callbacks and promises It's just annoying to me. The simple task of getting a file's metadata, searching it on Postgres, creating the record only if it doesn't exists, take me more than 20 lines of code and I almost have to drink a bottle of Dramamine lol
This time I am highly determinated to maintain an extreme layer's separation. So my front-end is fully static html/js/css, coded in Angular. Postgres DB also don't require any changes. And CakePHP 3 is almost factory's ready to easily serve json/xml.
Also there's a possibility of me being somehow stupid... lol

Node express now

I want to rewrite a complete community website in nodejs,express and
nowjs with mongodb. Its currently in php using the codeigniter
framework. It includes functionality such as your own profile page,
photoalbum, guestbook, internal messages, contacts and more. And im
going to add an im to it and some other things like a forum and so on.
Its a pretty big project.
I have to make a decision about which techniques to use in the
webapplication. So i did a little research and found, node, Expess and
nowjs.
Should i stick to finish the application in php( codeigniter ), mysql
and ajax, or can i do this in express, mongodb and nowjs?
Can anyone recommend this for use on a live production site? And if
so, are there any security issues one should know about? General
guidelines?
Help would be really appreciated so i can make up my mind and finish
the project
Regards
George
The problem with Nodejs being young is not that it's a half baked product or something but infact it's growing very fast and new developments are being done at breath taking place. So you need to keep up with them while developing.
Otherwise there are huge projects out there developed totally with node and express. Take a look at expressjs.com/applications to see what kind of commericial projects are built using it.
As far as security, sessions etc. are concerned. Unlike ASP/PHP , you don't get most of the features out of the box. You'll need to either write them yourselves or using open source frameworks. Both ways you and only you have to ensure that your application has all bases covered. With flexibility, comes complexity.
It should be noted that Nodejs is optimum for real time I/O. If you think this is something which is required at your end then I highly recommend to go for it.
What you describe does sound like a big project.
If you have the time to spare, I would suggest picking a small portion of it that deals with managing secure sessions (e.g. the profile page). Implement that in Express to get a sense of how it compares to the existing PHP. If you like it, keep going.
Particularly when security is at stake, always try to use existing components when they are available. Node's minimalism makes it tempting to 'roll your own,' but it's very easy to make a security mistake with anything less than expert knowledge.

Node.js Web Application examples/tutorials [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
So I finished watching Douglas Crockford's excellent series on Javascript, and in the final episode (so far), loopage he lays out why Node.js is a near perfect solution for server side code.
He talks about keeping state, not in the database, but in closures running in Node.js, he also states that templating systems (like JSP, PHP, and ASP) are a poor abstraction for more complicated Web Applications and that node.js provides a solution to this.
And I am ready to buy in, but I can't find any examples of Web Applications using this pattern, or any books or tutorials about how to go about doing this. I am not talking about a simple application, but something that would use the patterns that Crockford spoke of in his talk. Anyone know where I can find some tutorials/examples of Web Applications written in Node.js (and yes I know about Geddy and ExpressJs, but they don't seem to follow the radically different patterns that Crockford was speaking of, and were more like getting a Railsy experience on Node.js).
[Note from 3 years in the future: It seems like Express, Geddy, Sails, Kraken et all are re-implementations of the Rails/Symfony/Spring frameworks from Ruby/PHP/Java. Whereas things like Hoodie and Meteor are attempts at a whole new paradigm. KOA looks interesting, but is a ways away from being usable, but looks like it is building on the strengths of javascript with the history of MVC applications of the past. 3 years on and it is still exciting times for Nodejs, even if it is no longer the new hotness. At least there are a lot of real world examples of Node in use now...
I would suggest you check out the various tutorials that are coming out lately. My current fav is:
http://nodetuts.com/
Hope this helps.
The Node Knockout competition wrapped up recently, and many of the submissions are available on github. The competition site doesn't appear to be working right now, but I'm sure you could Google up a few entries to check out.
DailyJS has a good tutorial (long series of 24 posts) that walks you through all the aspects of building a notepad app (including all the possible extras).
Heres an overview of the tutorial: http://dailyjs.com/2010/11/01/node-tutorial/
And heres a link to all the posts: http://dailyjs.com/tags.html#nodepad
Update
Dav Glass from Yahoo has given a talk at YuiConf2010 in November which is now available in Video from.
He shows to great extend how one can use YUI3 to render out widgets on the server side an make them work with GET requests when JS is disabled, or just make them work normally when it's active.
He also shows examples of how to use server side DOM to apply style sheets before rendering and other cool stuff.
The demos can be found on his GitHub Account.
The part that's missing IMO to make this really awesome, is some kind of underlying storage of the widget state. So that one can visit the page without JavaScript and everything works as expected, then they turn JS on and now the widget have the same state as before but work without page reloading, then throw in some saving to the server + WebSockets to sync between multiple open browser.... and the next generation of unobtrusive and gracefully degrading ARIA's is born.
Original Answer
Well go ahead and built it yourself then.
Seriously, 90% of all WebApps out there work fine with a REST approach, of course you could do magical things like superior user tracking, tracking of downloads in real time, checking which parts of videos are being watched etc.
One problem is scalability, as soon as you have more then 1 Node process, many (but not all) of the benefits of having the data stored between requests go away, so you have to make sure that clients always hit the same process. And even then, bigger things will yet again need a database layer.
Node.js isn't the solution to everything, I'm sure people will build really great stuff in the future, but that needs some time, right now many are just porting stuff over to Node to get things going.
What (IMHO) makes Node.js so great, is the fact that it streamlines the Development process, you have to write less code, it works perfectly with JSON, you loose all that context switching.
I mainly did gaming experiments so far, but I can for sure say that there will be many cool multi player (or even MMO) things in the future, that use both HTML5 and Node.js.
Node.js is still gaining traction, it's not even near to the RoR Hype some years ago (just take a look at the Node.js tag here on SO, hardly 4-5 questions a day).
Rome (or RoR) wasn't built over night, and neither will Node.js be.
Node.js has all the potential it needs, but people are still trying things out, so I'd suggest you to join them :)
The closest thing is likely Dav Glass's experimental work using node.js, express and YUI3. Basically, he explains how YUI3 is used to render markup on the server side, then sent to the client where binding to event and data occurs. The beauty is YUI3 is used as-is on both the client and the server. Makes a lot of sense. The one big issue is there is not yet a production ready server-side DOM library.
screencast

Web programming language

I want to go learn web programming,but besides names and a little of html I don't know anything.So I ask you what programming languages you recommend,why,what can be done with it,tools to learn ,etc.I don't know if it matters but I program in a Linux enviroment(Ubuntu).
I don't want to do hardcore web programming ,I only want to be able to develop complete websites and understand network concepts.
Well, most cheap/free web hosts support PHP, MySQL, and most browsers support Javascript.
Target those and you'll be on a reasonably good path.
Some support Ruby and Python, and you might choose that path if you want to learn those languages.
Good luck!
-Adam
Definitely start with HTML, and basic CSS. These are the core of web programming, and you need to understand them well to do anything of consequence.
Once you've got those down, you'll want to move on to a server-side language. The easiest is PHP, but be careful of picking up bad habits, since it's a loose environment; if you stick with PHP, you'll eventually want to use it with an MVC framework such as CodeIgniter, which encourage separating presentation and logic. To get a little more advanced, you can also try Python or Ruby. Get yourself some server space to mess around with; most shared hosting plans are $5-10/month.
For Javascript/AJAX, you'll probably want to start by using Firebug or Firefox's DOM inspector to learn the relationship between the HTML of a page and the DOM object which Javascript uses to interact with it. Once you understand how the DOM works, toy around with jQuery to start doing useful (and fun!) stuff.
You'll also eventually want to learn MySQL (or a similar SQL variant), but that can probably wait, since you can do lots of interesting things without tackling database stuff.
Above all, be patient and persistent, and make use of every resource at your disposal: books, Google, Stack Overflow, and cheat sheets.
Ruby all the way. It's exactly what you need if you're interested in web dev and completely starting from scratch programming-wise. From the basics of Ruby it's pretty easy to get into Rails, which is a very beginner-friendly web framework.
Many great books on Amazon (look for the highest rated of course) on both Ruby and Rails.
Great starting point for links:
http://www.ruby-lang.org/en/documentation/
As well check out Learn to Program
Now get learnin'.
Google App Engine offers free hosting for applications that do not exceed the specified limits. The server-side language is Python, the client-side language is JavaScript inside Django templates. Everything has worked nicely for me in Ubuntu 8.10.
GREAT Question,
a couple of years ago I was in the same place -
What HONESTLY Helped me was using Dreamweaver, I set it in split mode and started watching the code
I used this and started delving into the PHP Application world and could see what was going on (sort of)
I know you can use dreamweaver with wine on the linux, and it can help you do a TON
granted if you continue it has the potential to limit you to the dreamweaver world... but can help you learn and create at the same time
(I build full php apps from scratch now with a notepad... but I started with DW)
The question I'd have is what kind of scale on web programming are you wanting to do? If it is small stuff then the LAMP stack would be my suggestion while if you want to get more into 3-tier architecture then Java or ASP.Net may be worth getting into for middleware or business logic code.
With the exception of the reference to the LAMP stack above, there has been no Perl recommendations. I like Perl as it is easy enough to build a fairly full featured web application (using CGI, or mod_perl). Of course, you are going to have to learn HTML/CSS if you are going to do anything on the web. I feel Perl is a good choice for web development as it is fairly robust and full featured with all of the modules available on CPAN. Combine with an application framework like CGI::Application or Catalyst and you can build sophisticated web apps in a short amount of time. Also, using a tool like XAMPP can help as you won't have to worry about web server or database cofigurations to get started.

Resources