Web development and problem solving

Gatsby. You're welcome.

This? https://www.gatsbyjs.org/docs/
It's a nice concept but I'm struggling to see why I would want to use it and to figure that out, I would need to implement something to find its advantages and disadvantages.

If someone wanted a "Hi, I'm a plumber. Here's my contact details" website I'll give them a "blistering fast" PHP, HTML, CSS website there's no reason to get NodeJS involved.

Personally I'm shifting towards Flutter in preparation for Flutter For Web, the cost savings for me has been epic so far by pairing up a Flutter UI with a Rails backend.

As for JS, I get by just fine with React and Redux, it's extremely expensive to develop but I'm not paying for it so whatever.
 
Have you ever used Rails?

I have, but I don't believe that Rails just randomly creates a database without you taking time to specify how the schema appears?

And besides Rails isn't really used for SPA - which is what we're discussing here.
 
This? https://www.gatsbyjs.org/docs/
It's a nice concept but I'm struggling to see why I would want to use it and to figure that out, I would need to implement something to find its advantages and disadvantages.

If someone wanted a "Hi, I'm a plumber. Here's my contact details" website I'll give them a "blistering fast" PHP, HTML, CSS website there's no reason to get NodeJS involved.

Personally I'm shifting towards Flutter in preparation for Flutter For Web, the cost savings for me has been epic so far by pairing up a Flutter UI with a Rails backend.

As for JS, I get by just fine with React and Redux, it's extremely expensive to develop but I'm not paying for it so whatever.

NodeJS has nothing to do with it?
 
I have, but I don't believe that Rails just randomly creates a database without you taking time to specify how the schema appears?

And besides Rails isn't really used for SPA - which is what we're discussing here.


Bash:
rails new my_project -d mysql
rails db:create
rails g model User name:string email:string
rails g resource Article name:string user_id:references
rails db:migrate

Ruby:
#app/models/user.rb:
class User < ActiveRecord
  has_many :posts
end

#app/models/article.rb
class Article < ActiveRecord
  belongs_to :user
end

Schema defined for my SPA's API. Just update the controller with CRUD (if I'm lazy I could just rails g scaffold_controller Article)

I know that's a very simple schema but the point is once you know what your Schema should look like, it's a matter of minutes to set that up in Rails.
 
701971
701973

I'm totally helpful.


In regards to problem solving, the earlier post #32 summed it up pretty well, the programming/web development is pretty easy, it's getting the clients that's the difficult bit to get started.
In terms of "what language", doesn't really matter, I like PHP as it's quick to build and I can use addons (after vetting them), e.g. woo commerce, which makes starting up an online store pretty quick with all its integrations. CMS like Wordpress are great for customers that need simple one-pagers or blog-like sites, with small extra features like customizable fields, etc. being very easy to implement, which would be a lot more difficult/time consuming to implement in most other languages (though that's changed drastically in the last few years, lots of nice back-end CMS have come around, like Ponzu in Go)

Just pick the right tool for the job, each language has its strengths, e.g. I'm really a fan of Golang, but there aren't very many easy extension to get, a lot of custom code will have to be written, so longer time to launch a product (plus production server upgrades will cause downtime as a compiled language, while PHP is interpreted, but that's a second or so of downtime and there are packages like "grace" by FB to help mitigate it, but you'd rather use a load balancer) but it's faster if a lot of custom.

If you go for something like Ruby on Rails, there is still community support and stuff, it's not going away any time soon (e.g. this is a large open-source e-commerce framework).

The bonus of e.g. PHP though, is that it's easy to learn and newer versions (7 onward) are getting substantially faster by "ignoring" code that is badly written, e.g. variable assignments that are never used, etc., which make it very friendly towards newcomers (oh and ignore people who say it's slow, that was quite a while back in PHP5, before things like opcache, for most web sites it's more than adequate, especially if comparing against Ruby or Python though the benchmark is not real-world and should only be used as an indicator).

Again, I repeat, the language itself doesn't really matter, you can go even with Java if you'd like (though I would not recommend that unless you're building a huge, performance orientated back-end, but even then I'd be hesitant).
 
Bash:
rails new my_project -d mysql
rails db:create
rails g model User name:string email:string
rails g resource Article name:string user_id:references
rails db:migrate

Ruby:
#app/models/user.rb:
class User < ActiveRecord
has_many :posts
end

#app/models/article.rb
class Article < ActiveRecord
belongs_to :user
end

Schema defined for my SPA's API. Just update the controller with CRUD (if I'm lazy I could just rails g scaffold_controller Article)

I know that's a very simple schema but the point is once you know what your Schema should look like, it's a matter of minutes to set that up in Rails.
So like Mongoose?
 
So like Mongoose?

Never used mongoose and never will because it's only for MongoDB. So no, Rails is not like Mongoose.
My choice for distributed SQL is CockroachDB because it's boring and predictable. I tried to demo it to someone and the response was "Oh so it's like a relational database".

Again though, it's complete overkill for 99% of apps. I've seen a MySQL DB with 100,000,000 rows in a table. I've seen a MySQL table with over a billion rows.

I have a LAMP server running on a free micro instance which I can dump a bazillion PHP one pagers on and it will continue to hum along forever, maybe have to restart it once every 2 years.

No need to over engineer, it's expensive and pointless.
 
Never used mongoose and never will because it's only for MongoDB. So no, Rails is not like Mongoose.
My choice for distributed SQL is CockroachDB because it's boring and predictable. I tried to demo it to someone and the response was "Oh so it's like a relational database".

Again though, it's complete overkill for 99% of apps. I've seen a MySQL DB with 100,000,000 rows in a table. I've seen a MySQL table with over a billion rows.

I have a LAMP server running on a free micro instance which I can dump a bazillion PHP one pagers on and it will continue to hum along forever, maybe have to restart it once every 2 years.

No need to over engineer, it's expensive and pointless.
Where are you hosting out of interest?
 
I will first try the front-end of things and see whether or not I like it, if I do I would try to go full stack.

Easy there Clint Beastwood.

Frontend is 3 languages, plus a monster of a api (the dom)

Fool stack is at least another two bespoke languages (ss + db)

Now suppose you decide to go the js route. Now you're down to 4 languages, and a raftload of frameworks. React, Maria, redux, sagas, jquery, foundation, express, gatsby, ad infinitum... Oh and don't forget npm and build tools like webpack grunt or gulp.

The list is longer than your month end shopping list.

So, where do you start? (And this is a problem YOU need to solve, not these here fine forumites)

Start by realising, a programming language, is exactly that, a language. Which ever one you choose you're going to not only speak and write it fluently, but express abstract and logical concepts with this newfound dialect of yours.

tl;dr, start by learning the basics, how to represent numbers, array like data, mathematical concepts and strings. Once you have that down pat, look at every language you can get your eyeballs on. Then try and define and manipulate the aforementioned concepts in the languages that feel logical and natural to you. Et voila, you have found your first (but certainly not last) programming language.

PS. You think this post was long? Try reading and retaining api docs.

Good luck on your journey, keep at it, and keep us updated :)
 
Where are you hosting out of interest?

gcloud, aws and Hetzner (DE)

gcloud for the free tier and then the others to limit my exposure to a single platform if required.

It's why I advocate for CockroachDB because it's platform agnostic. If someone came to me and asked Mongo vs AWS RDS, I would advise MongoDB to avoid vendor lock in.
 
There's actually a lot companies running sites built with Gatsby. And not all of them are "static" in the sense that it doesn't change.

I really do thing the the future of the web is javascript served statically (React, Vue, Angular, etc) and then data is served dynamically with API's - this is basically what any app on your phone does as well.
 
There's actually a lot companies running sites built with Gatsby. And not all of them are "static" in the sense that it doesn't change.

I really do thing the the future of the web is javascript served statically (React, Vue, Angular, etc) and then data is served dynamically with API's - this is basically what any app on your phone does as well.
Well I note your site is a PWA (generally CRA and Gatsby should be) so you're winning there already.
 
Top
Sign up to the MyBroadband newsletter
X