Web development best practice

Joined
Aug 24, 2023
Messages
1
Reaction score
0
Hi, I'm a mobile developer. I recently started learning web development with Go language and I have a question about this process.
I did work in some companies in the past and saw they give REST API to web developers and the web developers build their web site with them. In the courses, I watched the process of developing a website using templates! I mean there was no REST API in there and that's my question. What is the difference? Why no REST API and using templates?! Is that the way it should be? If yes then why in those companies they were using REST API to build websites?!
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
I believe that learning the basic, raw language of HTML, CSS, and JavaScript is the correct way to learn web development. Learning GO is considered easy and a great language for beginners. RUST is similar to C++ and is used instead of JS. Personally, I'd stay with JS.
By using templates, are you talking about the HTML/CSS visual website? If yes, I have found this harder to use than programming from the ground up.
 
Joined
Jul 4, 2023
Messages
366
Reaction score
41
Here is not bad explanation from GPT (maybe it'll useful for you):

The difference you're observing between using templates in web development courses and using REST APIs in companies is related to two different approaches for building web applications: server-side rendering (using templates) and client-side rendering (using REST APIs).

  1. Server-Side Rendering (SSR) with Templates: In the traditional approach of server-side rendering, web templates are used to generate HTML on the server side. The server receives a request, processes data (from a database or other sources), and renders the HTML with dynamic content embedded directly in it. This HTML is then sent to the client's browser, which simply displays it. The client doesn't need to do much processing, resulting in fast initial load times and good SEO performance. This approach is commonly used when websites have more static content and don't require complex interactions.
    The advantage of this method is that it's simpler to implement and can be more SEO-friendly. However, as web applications become more interactive and dynamic, this approach might limit the user experience.
  2. Client-Side Rendering (CSR) with REST APIs: In the client-side rendering approach, the server primarily serves as a provider of data through a REST API (or GraphQL, etc.). The actual rendering of the UI and handling of user interactions occur on the client side, usually using JavaScript frameworks like React, Vue, or Angular. When a user visits the website, the initial HTML is lightweight, and the client-side JavaScript fetches data from the API and dynamically updates the UI accordingly.
    This approach provides a highly interactive and dynamic user experience, allowing for complex interactions without the need to refresh the whole page. However, it can potentially result in slower initial load times, can be less SEO-friendly (though techniques like server-side rendering or pre-rendering can mitigate this), and requires more sophisticated client-side coding.
Which Approach to Choose? The choice between server-side rendering with templates and client-side rendering with REST APIs depends on the nature of your web application and your goals:

  • Server-Side Rendering (Templates):
    • Better initial load performance.
    • Generally better SEO performance.
    • Suitable for websites with more static content.
    • Simpler development process.
    • Might not be as suitable for highly interactive applications.
  • Client-Side Rendering (REST APIs):
    • Rich and interactive user experience.
    • Can be less SEO-friendly (though this can be mitigated with additional techniques).
    • Suitable for complex, dynamic applications.
    • Requires more complex client-side development.
Companies might choose REST APIs and client-side rendering for their web applications when they want to provide highly interactive and dynamic experiences. However, there's no one-size-fits-all answer. Many modern web applications use a combination of both approaches, employing techniques like server-side rendering for initial load performance and SEO, and transitioning to client-side rendering for subsequent interactions.

In summary, both approaches have their own merits, and the choice depends on your specific project requirements and goals.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top