Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 25, 2024, 11:17 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Websites that work on mobiles and desktops alike (Responsive)
#1
Websites that work on mobiles and desktops alike (Responsive)
I wanted to share my knowledge about programming websites that work on both mobile phones and also desktop computers.

To produce a functional, responsive website that works on both mobiles and desktop with a single HTML file; you have to use an external framework, or add what we call "media queries" to your .CSS site layout by yourself. You can also combine both.

I should note; that Frameworks and Libraries provide you media queries, in the form of classes.


The structure of your file should look like:

================

1-HTML file
2-CSS file
3-Frameworks and Libraries (they are read in the HTML; composed of .CSS and .JS)

=================

Frameworks like twitter's bootstrap, allow you to use number 3 in your website: give your HTML the ability to produce a single code; that runs cleanly on mobiles and PCs alike.
It extends the HTML, by providing "CSS classes" and "Javascript scripts" that promise a wonderful design.

Design Well !
Reply
#2
RE: Websites that work on mobiles and desktops alike (Responsive)
In my experience, media query + a little javascript is plenty powerful enough: I would definitely shy away from libraries in favor of hand-designing everything myself.

Production libraries tend to put out pretty complex-looking code, and I've sometimes spent more time trying to figure out how the heck something was supposed to work (so I could add to it or customize it) than it would have taken me just to create the functionality from scratch.

Overall, I'd say this is the rule: the less you know, the more productive you will be with 3rd-party solutions as compared to doing things by hand. The more you know, the less you will want to learn the features of this-or-that new thing, and just get straight into organizing your project


The only exception is really big things that you could never do on your own-- graphic engines, complex statistical analysis, AI, etc. (assuming you haven't spent the time to learn about these things)
Reply
#3
RE: Websites that work on mobiles and desktops alike (Responsive)
(February 12, 2018 at 7:17 pm)bennyboy Wrote: In my experience, media query + a little javascript is plenty powerful enough: I would definitely shy away from libraries in favor of hand-designing everything myself.  

Production libraries tend to put out pretty complex-looking code, and I've sometimes spent more time trying to figure out how the heck something was supposed to work (so I could add to it or customize it) than it would have taken me just to create the functionality from scratch.

Overall, I'd say this is the rule: the less you know, the more productive you will be with 3rd-party solutions as compared to doing things by hand.  The more you know, the less you will want to learn the features of this-or-that new thing, and just get straight into organizing your project



The only exception is really big things that you could never do on your own-- graphic engines, complex statistical analysis, AI, etc. (assuming you haven't spent the time to learn about these things)

The problem is the time; but writing everything by your own is the best thing for developing your skills and sharpen the results of your code, but it takes a lot of time and effort.
But I won't argue with you: building your own stuff makes you dodge the complications of trying to understand the codes of others.

The bold part is spot on. If I understand it probably; you will focus your strength one thing: either the 3rd party framework, or your own developed stuff.

Your own= more bare knowledge in the environment you're using
Framework=more knowledge in that framework; not in the environment

Ah; I only used "Blender" and "Three.js" for a very short time if that counts as graphic design. Very short like a month, but it wasn't for me so I quit.
For A.I, I only developed a chess game and "Wanted" to seed an "NPC opponent" with moves via Neural Networks, I didn't do that; I didn't even research Neural Networks probably.
Reply
#4
RE: Websites that work on mobiles and desktops alike (Responsive)
If you are a coder by profession and still get time to hand-code everything to your liking, then do consider yourself as one of the luckiest people on this planet.
Quote:To know yet to think that one does not know is best; Not to know yet to think that one knows will lead to difficulty.
- Lau Tzu

Join me on atheistforums Slack Cool Shades (pester tibs via pm if you need invite) Tongue

Reply
#5
RE: Websites that work on mobiles and desktops alike (Responsive)
Most of them.
Reply
#6
RE: Websites that work on mobiles and desktops alike (Responsive)
(February 15, 2018 at 9:37 am)Aoi Magi Wrote: If you are a coder by profession and still get time to hand-code everything to your liking, then do consider yourself as one of the luckiest people on this planet.

Exactly, it takes hell lot of time, and copy-pasting from the web to save time, will produce tiny little errors here and there -a missing bracket; something extra copied by mistake...etc-.

(February 15, 2018 at 10:53 am)Hammy Wrote: Most of them.

huh?
Reply
#7
RE: Websites that work on mobiles and desktops alike (Responsive)
(February 15, 2018 at 9:37 am)Aoi Magi Wrote: If you are a coder by profession and still get time to hand-code everything to your liking, then do consider yourself as one of the luckiest people on this planet.

The difference between coding and scripting is probably a philosophical one. I feel that no matter what tools you are using, you need to have access to a low enough level that you can make custom solutions at a customer's request.

For example, I use ASP.NET. It has built-in controls that I use to quickly put together a page. However at all points in that process, I'll be looking at the HTML the site pumps out, and if I can't get at what I need, I'll either patch it with Javascript client side, or I'll program my own.

HTML has the advantage of being very simple. You probably aren't going to be writing new face-recognition algorithms or anything, you are pretty much just pumping out HTML over the pipe. There's probably no .ASP control that you couldn't write (at least in a form specific for your needs) in a couple hours, I'd think.
Reply
#8
RE: Websites that work on mobiles and desktops alike (Responsive)
This is exactly why I like using frameworks and other middleware. With a package manager (in my case, Composer... think Nuget, npm, etc.), I can install 3rd party components, but the existing framework/middleware allows me to write custom code easily if necessary. Like, right now, my data entities are a mix of 3rd party components (for users, and for an implementation of the nested set algorithm), but with my own code extending it.
Reply
#9
RE: Websites that work on mobiles and desktops alike (Responsive)
Regarding data.

I just migrated from an old 3rd-party (and crappy) physical server to an Azure VM. Ho. . . ly. . . crap!

It performs better than a fully managed server at a small fraction of the cost, and with way fewer problems. No more talking to retarded tech dummies who don't know how to upgrade .NET or how to back things up or whatever.
Reply
#10
RE: Websites that work on mobiles and desktops alike (Responsive)
Anyway, when do you think it's advisable to use server-side scripts instead of the client-side scripts?
Of course, sometimes you have to use server-side scripts to store the data (like when making the comment sections or a global high score list on a game), but when should you use server-side scripts to manipulate the data?
If you make an error in a client-side script trying to manipulate the data, the worst thing that can happen is that the browser crashes (which has actually happened to me a few times when using Safari or Internet Explorer). If you make an error in a server-side script, well, your website can easily become inaccessible.
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  religious websites are a greater security risk than porn destinations. Ziploc Surprise 3 2821 June 20, 2012 at 6:57 pm
Last Post: Angrboda



Users browsing this thread: 1 Guest(s)