this post was submitted on 17 May 2025
2 points (53.8% liked)

Programming

21831 readers
279 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.ml/post/30253906

cross-posted from: https://lemmy.ml/post/30253851

cross-posted from: https://lemmy.ml/post/30253477

To admit frankly, l am a non technical person who would be tinkering with the task of creating a full fledged website for a travel company. For me, it's going to be a fun activity. There are a lot of nerds out here who can help me with their expertise. Many thanks to you all😊😊😊

you are viewing a single comment's thread
view the rest of the comments
[–] kwedd 1 points 2 months ago (2 children)

Nobody creates a website completely from scratch. If the point is to learn, then by all means, go ahead and implement everything from scratch. That'll be very educational. However, assuming the point is to deliver a working solution to the travel company this year or next year, you're going to want to use existing libraries and frameworks to do some of the heavy lifting, organize your code and make your life easier.

There are more or less two ways to implement a website that is not just a bunch of static HTML pages, though in practice a lot of websites will fall somewhere in between these two extremes:

  • Classic: The server generates a page based on the information in the URL or a POST request (usually when submitting a form). The server returns a bunch of HTML, CSS and maybe a little JavaScript. The contents of the page doesn't really change after it's been sent to the client (the user's browser). This is useful for webpages that aren't very interactive, like a CMS or a blog.
  • Single page applications: The server sends almost no HTML. Instead, the client retrieves data from the server, usually in the form of JSON. Once the data has been retrieved, the page is generated in the client using JavaScript. Parts of the page can be modified based on user input and further queries for data. This is useful for webpages that are very interactive, like Google Maps, for example.

Single page applications, while popular and hip nowadays, are overkill for a lot of websites. They are also an advanced topic, that requires you to have most of the knowledge involved in the classic approach. Therefore, I will mostly discuss the classic approach in this post.

Any website is going to have code and markup that is sent to the client and code that runs on the server. For the client side you'll need to learn:

  • HTML - A markup language that defines the structure and contents of your page.
  • CSS - Style sheets define the look and layout of your webpage. Things like colors, positions, borders, simple animations, whether text is bold, italic, etc.
  • JavaScript - A programming language that runs in the browser. This might be used for animations and effects, changing parts of the webpage through DOM manipulation and validating (checking) user input in a form.

For the server side you'll need to learn:

  • A programming language - The possibilities are endless here. You could use almost any language. Some popular options are PHP, JavaScript, ASP.NET, Python and Ruby. Apart from personal taste, which one you choose should probably depend on what libraries, frameworks and existing solutions are available for the problem(s) you're trying to solve.
  • A relational database and SQL - You'll want to store your data in a database. Use a standard relational database like MySQL/MariaDB or PostgreSQL. If someone suggests using a NoSQL database like CouchDB or Mongo, ignore them. You'll be talking to your database using some variation of SQL and/or an ORM. Also, you should learn about database normalization.

To organize your code on the server, learn and use some sort of MVC framework like Laravel, Symphony, Django or Ruby on Rails. This will help keep your code clear by separating the template (view) from the code that talks to the database (model) and the code that processes that data (controller).

I imagine a travel agency might need:

  • User authentication and rights management - This allows for the creation of users, allows users to log in to your site and manages which users can do and edit what. Since you don't know what you're doing, use an existing library/framework/solution for this. Otherwise you will get hacked.
  • A content management system - This will allow users to create and update pages using markup or a rich text editor, as well as uploading images and such. I highly recommend using an existing solution for this like WordPress, Drupal or one of the many others.
  • Some kind of blog or timeline with news and updates - Again, I'd suggest using an existing solution like WordPress or just embedding the company's ~~Twitter~~ X (or Bluesky or Mastodon) feed.
  • Some kind of booking system - If the travel company only organizes a limited number of group trips or whatever at set dates, you might consider implementing this yourself. Just let the user select a trip/destination and a date, enter relevant personal information and let them pay through some kind of payment service like Stripe. However, if the user needs to be able to create their own itineraries and book flights, hotels and rent cars and whatnot, things are going to get a lot more complicated. This would require a much more interactive page and would need to interface with all kinds of other parties, like hotels and airlines. So in that case you'd be better off using an existing solution.

Regarding general programming knowledge, of course you'll want to learn the basics like variables, conditionals, loops, functions, objects etc... Beyond that, I suggest you also look into design patterns. These are commonly understood ways of solving different programming problems. I recommend learning patterns from both object oriented programming and functional programming. IMO you should use immutable data and functional programming whenever it's not too much of a hassle and performs well enough. If you do need mutability or statefulness, use objects and OOP patterns.

Furthermore, at some point you'll want to learn the basics regarding data structures and computational complexity and big O notation. As far as data structures go, in practice you'll mostly use lists/arrays and hash-maps/dictionaries. It's good to know how fast different data structures perform different operations like inserting/removing elements or looking up values. You'll want to know the computational complexity of these operations. You'll also want to be able to know the computational complexity of the algorithms you create. For example, if a function needs to look at all the elements in a list once, it needs to do n steps and the computational complexity is O(n), where n is the length of the list. If a function needs to compare every element in a list to every other element in a list, it needs n * n steps and the computational complexity would be O(n^2). The latter would get slow very quickly on long lists.

If you find yourself writing a lot of JavaScript, consider using TypeScript. While adding types to your code will seem like a hassle at first, in the long run it'll catch a lot of problems at compile time and make it easier to debug your code.

Some people might suggest using the jQuery or Underscore libraries when writing JavaScript. While both were very useful at some point in the past, nowadays most of their functionality is included in modern JavaScript. This makes them mostly redundant unless you're targeting really old browsers.

[–] Docker_84@lemmy.ml 1 points 2 months ago

Is there any particular link/url for the classic option that you've mentioned ?

[–] Docker_84@lemmy.ml 1 points 2 months ago

Thank you very much for your detailed and thought out reply 😊😊 This is going to give me the start that l need πŸ€“πŸ€“πŸ€“