Web Programming Advice

I have been learning web programming for this week, and i am confused about the server side stuff of web development.
I know in client side you use JavaScript , html and CSS.
But what to use in server side so many options too confusing.
I just want a simple way to create dynamic websites.
What about Go,CGI or Django?
Any professional advice would help.
Also I want the site to have less dependencies and stable.
Thanks.
You can use almost any language for that. Be it python, php, perl, go, javascript, pascal, C, or even bash scripts.

CGI is interface (something like API specification) how webserver like Apache or Nginx interacts with these scripts or executables. How they pass URL that is being requested and other webserver related parameters to the application. That said nowadays people rarely use CGI, except some quick hacks. You can use raw CGI, but usually the overhead for it will be too much. Usually people use FastCGI, WSGI, mod_php or something similar depending on language and framework they choose.

Django, Ruby on Rails and others are frameworks in specific languages (Django is in Python, Ruby on Rails is in Ruby) that provide a lot of ready to use functionality to you. So you don't need to manually parse requests and prepare responses.

What to use is really up to you. All the options are good in one way, and worse in different way. There is no one "best" thing in web development. It all depends on what language you use, want to use or know the best. On what are requirements for web service (expected load or similar performance characteristics). And on server infrastructure you'll want to and/or need to maintain.



Edited by Mārtiņš Možeiko on
msmshazan

I just want a simple way to create dynamic websites.


Is this really true though? Let me ask you: What are your goals? Are you trying to get a job doing this or do you want to do this for you, your friends, family, a hobby, etc?

You may think this is a silly question but it's not. The reality is, there are so many technologies to choose from that which one you end up using is usually just determined by your employer (you get hired and they use Java/Spring MVC, or Django, or Rails, etc...) or by you if it's a personal project of course. If it's the latter for you, you can literally just pick a set of technologies (aka a "stack") and just dive in. The reality is, Django, MEAN, .NET, Java, Rails, PHP and whoever else I'm forgetting right now can make "dynamic websites" like the ones you want. If you want to have specific feature, you may want to do a search and make sure whichever tech you're choosing has that feature, but otherwise, have at it.

My only personal advice to you would be unless you specifically want to do WordPress stuff, avoid PHP as a starting language. I don't personally feel that "the language is bad" like many other people do, but I have definitely noticed a tendency of there being poor-quality "get started quick" tutorials out there for PHP and unfortunately, PHP comes with a lot of power and not a ton "done for you" which allows you to leave security holes wide open when you don't even know it. But if you specifically want to tackle PHP, then do it. It's more about what you want to do. I've recently started learning assembly because I want to. Do what you want to!
I am using flask framework and python as the programming language.
I am using this as a hobby project to learn web programming.
I was using django earlier but i didn't understand what i was doing then i used flask because they said it is for beginners.
Does anyone know any good resource for web programming with a handmade mindset.
After 4 hours of struggling web dev finally made a working login page. Not the nicest thing but good enough. But is it me or web programming is messy like there is so many options and I thought from what Casey said win32 api is messy.
I used flask framework as back end (according to web programming language) ,I tried using django but I didn't understand what I was doing so I used flask.
And to the handmade network webmaster you have done a good job with the site(better than most sites in the internet) and have you thought of teaching web programming since you are in the field for a long time.
Thanks for helping me understand stuff and thanks to Mr.Martins for answering my questions even they look stupid.
msmshazan
After 4 hours of struggling web dev finally made a working login page.

Hey, well done on your first login page! The Handmade way isn't always easy, but I bet you have a much better understanding on the login process now, right? It's really good that you persevered.

msmshazan
Does anyone know any good resource for web programming with a handmade mindset.

Personally I've always found the tutorials at W3Schools to be very good. I recommend them, particularly if you're taking a Handmade approach, because I find they are generally very good about actually teaching you the technology they are talking about, rather than claiming to teach you a technology and then actually just telling you to install an existing framework or a ton of dependencies. They're not the best if you just want to get something done quickly, but for understanding, I think they are very good.
msmshazan
Does anyone know any good resource for web programming with a handmade mindset.


For this, this may sound pretty crude, but just pick up a few good web programming CSS, HTML, and JavaScript books. You can do a ton with those 3 languages. You can even do a ton with just CSS even, if you don't believe me get "CSS Secrets" by Lea Verou or even just watch her talks on YouTube. She's sorta the CSS equivalent to what Casey is doing on HH.

The thing about Handmade web is you have to do things the long, boring, slow, hard way at first, which is counterintuitive to like 99% of the business space in web. Generally, web companies seem to want to throw stuff up fast and do it with at least work as possible. This is why you see so many frameworks popping up and this is also why it's almost non-existent anymore to see a webpage which doesn't utilize a framework. Not that this does not mean that not using a framework is bad - in fact, it's probably better, but it requires a lot more discipline, study, and time than just leaerning Angular, React, or CakePHP and just slapping a site up. This is not to downplay learning frameworks and tools as they are not "easy" either, and over time, they still contribute to overall programming knowledge as you will see how the framework creator does things certain ways, however, don't underestimate the power of raw HTML, CSS, and JavaScript. If you want to get good at handmade web, I suggest this book called DOM Enlightenment. Essentially, you will learn what the library "jQuery" is doing for you behind-the-scenes and you can do it all yourself.

Also, you will hear about stuff like Twitter Bootstrap and making responsive sites. Know that you can also do this all yourself in CSS quite easily. You just make your widths and heights based off of percentages rather than hard numbers so that they adjust to devices/screen sizes. John_Uskglass posted a great link to get you started.
I found a web framework server sided for C.
kore
But its still not full featured like django or flask.
msmshazan
I found a web framework server sided for C.
kore
But its still not full featured like django or flask.

Great find, Mohamed. When the time is right, I'll have to seriously consider if we can use this as a basis for v2 of the site's backend. Just looking at the feature list, it's hitting all the right marks. We were going to write something very close to this.

Edited by Jeroen van Rijn on
I have a big problem now I see web programming changing a lot.And I see like stuff like Bootstrap,Angular,React like new frameworks coming up and I am confused...
And here's the question,


What to avoid in web development?
msmshazan
I have a big problem now I see web programming changing a lot.And I see like stuff like Bootstrap,Angular,React like new frameworks coming up and I am confused...
And here's the question,


What to avoid in web development?


web development :-P
msmshazan
I have a big problem now I see web programming changing a lot.And I see like stuff like Bootstrap,Angular,React like new frameworks coming up and I am confused...
And here's the question,


What to avoid in web development?

bootstrap makes it so you can make a decent looking webpage without understanding CSS. angular and react, the same for the DOM (the interface you have in javascript to the webpage)

in principle, you want to learn how make CSS do a thing, not bootstrap. you want to learn how to use the DOM to do a thing, not how to make angular or react do it

The real thing to avoid, for the front end, is using any webpage other than MDN as a source of information on web technologies. MDN is the closest thing you have to reference documentation on the web and everything else is either wrong or suspect

Edited by graeme on
msmshazan
I have a big problem now I see web programming changing a lot.


It's been doing that for over a decade. Webdev tends to follow this hype cycle:
10 "Look at this new framework! It's the best! Stop using all the old frameworks!"
20 "Hmm.. I found some issues with the new frameworks. Maybe I can hack around it"
30 *Proceeds to write blog posts about "best practices" and "common pitfalls" with the framework*
40 "I've had enough. This framework is total garbage"
50 GOTO 10

This leads to many existing frameworks, but usually only 2-3 popular ones at any given time.

msmshazan
What to avoid in web development?


If you want to learn web development for your own benefit, avoid the hype cycle. On the other hand, if you want to get a job, you need to follow the hype cycle very closely (which right now mostly consists of React and its variants).

I would add to graeme's post that the CSS spec can be helpful if you encounter weird behavior. MDN usually links to the relevant parts of it.
AsafG
msmshazan
I have a big problem now I see web programming changing a lot.


It's been doing that for over a decade. Webdev tends to follow this hype cycle:
10 "Look at this new framework! It's the best! Stop using all the old frameworks!"
20 "Hmm.. I found some issues with the new frameworks. Maybe I can hack around it"
30 *Proceeds to write blog posts about "best practices" and "common pitfalls" with the framework*
40 "I've had enough. This framework is total garbage"
50 GOTO 10

This leads to many existing frameworks, but usually only 2-3 popular ones at any given time.

msmshazan
What to avoid in web development?


If you want to learn web development for your own benefit, avoid the hype cycle. On the other hand, if you want to get a job, you need to follow the hype cycle very closely (which right now mostly consists of React and its variants).

I would add to graeme's post that the CSS spec can be helpful if you encounter weird behavior. MDN usually links to the relevant parts of it.


I like this advice as someone who avoids web programming like the plague. Maybe there is some glimmer of hope that web development isn't 100% awful.
Web dev isn't so bad if you have a team of ~3 people.

Then one person can just do javascript/css/html (or typescript!)

One person can do whatever language is on the server

and One person can do database queries and configuration.


Trying to keep all 3 straight, and do all 3 well, by yourself, is pretty awful.
Sadly I haven't had a database guru in a long time. I often find myself wanting to pick up the phone and call her, but then realize I am the database guru.

Edited by Jack Mott on