Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

The Merkinman posted:

What is the job title for the highest ranking front-end developer (something higher than "Senior Frond End Developer")?
Web Architect?
Front-End Architect?
Lord King of all Domains and Sub-Domains Because Titles are Arbitrary?

God Emperor

Adbot
ADBOT LOVES YOU

Main Paineframe
Oct 27, 2010

Pollyanna posted:

Is there some sort of consistent spacing/fontsize/padding/whatever design language out there that can be implemented organization-wide? I'm getting sick and tired of guessing at what kind of whitespace and proportions the designer wants and have them throw a million tweaks and !!!! I FOUND A BUG PLEASE FIX NOW NOW NOW !!!!s at me anyway.

If I'm being totally honest, I want to wave a magic wand and somehow make my life a lot easier, but failing that some frameworks and guides to follow will suffice.

If the designer doesn't tell me, I just wing it and then show him afterwards. If he wants me to change the size or position, who cares, that's like thirty seconds tops. If I think I'm going to need much attention from the designer or there's a lot of back-and-forth happening, I try to set up a one-on-one meeting with the designer so we can work it all out at once and tweak it till it looks good, rather than firing emails back and forth for a week. One of the nice things about CSS is that you can tweak the numbers and see the effects pretty much immediately, so it's easy to just fool around with small layout things like that till it looks good.

Mush Man
Jun 25, 2010

Nintendo announces Frolf means Frog Golf.
Oven Wrangler
Apparently people are moving away from PHP for web development. What are they moving to? I started a personal project a while ago and need to at least separate the page structure out of the code, so I'm thinking now's a good time to double-check what the best languages are.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Mush Man posted:

Apparently people are moving away from PHP for web development. What are they moving to? I started a personal project a while ago and need to at least separate the page structure out of the code, so I'm thinking now's a good time to double-check what the best languages are.

Node.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Node is not a language. :smug:


Javascript (via Node :v:) is popular, but I'm not sure if it's a "best" language for it yet. Python is popular and is pretty good, C# is also very good from what I hear, and there are a bunch of functionalish languages / frameworks popping out of the woodwork these days as well.

How I do my stuff is with Python + the Django framework + the Django Rest Framework bolted on. Has worked well on many projects of various sizes. It's certainly not the "best" answer, so hopefully other folks will chime in with other good stuff because I'm also interested in hearing about some of the new stuff like Elixir and how that has worked for people.

grenada
Apr 20, 2013
Relax.

Mush Man posted:

Apparently people are moving away from PHP for web development. What are they moving to? I started a personal project a while ago and need to at least separate the page structure out of the code, so I'm thinking now's a good time to double-check what the best languages are.

As a fellow noob, I recommend the Mozilla Django tutorial if you want to manage your own backend - https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website. You'll learn how to get a simple CRUD app up and running pretty quickly.

I am now working through the UPenn Javascript course - https://www.edx.org/course/programming-web-javascript-pennx-sd4x. So far, this course is very good for getting me up to speed in Vanilla JavaScript, jQuery, React, and I'm looking forward to starting the Node section.

The You Don't Know JS book series is pretty great too - https://github.com/getify/You-Dont-Know-JS.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Lumpy posted:

Node is not a language. :smug:

You are technically correct, the best kind of correct.

huhu
Feb 24, 2006
If you want to go the Python route, depending on how knowledgeable you are with the backend, I'd suggest starting with Flask instead of Django. Flask is more bite-size whereas Django is "Batteries Included" and has a much steeper learning curve. I went the other way around Django -> Flask and on top of that it was my first adventure into the backend and it was hell.

Pollyanna
Mar 5, 2005

Milk's on them.


Main Paineframe posted:

If the designer doesn't tell me, I just wing it and then show him afterwards. If he wants me to change the size or position, who cares, that's like thirty seconds tops. If I think I'm going to need much attention from the designer or there's a lot of back-and-forth happening, I try to set up a one-on-one meeting with the designer so we can work it all out at once and tweak it till it looks good, rather than firing emails back and forth for a week. One of the nice things about CSS is that you can tweak the numbers and see the effects pretty much immediately, so it's easy to just fool around with small layout things like that till it looks good.

I don't really mind tweaking things with a designer, aside from the initial annoyance of diving back in and changing some values - which, yes, is really easy. I'm more concerned about possibly pissing off a designer because I didn't nail it the first time, and they have to spend time asking for tweaks. I already kinda feel like not getting everything looking exactly right is giving our designer/PM a negative impression of me, and I'm already garbage at styling so :saddowns:

Maldavos
May 26, 2015
Grimey Drawer
I'm currently doing some light freelance work and want to design/develop a website for my business.

Thus far, I've coded everything by hand in Atom, drafting up my design on paper, learning everything from StackOverflow and various tutorials. I'm pretty sure this is a workflow from circa 1994. It's also SLOW. I'd like to see what tools you recommend to get faster at designing for the web. I'm looking at tools like Sketch, Webflow, Codekit, Framer, etc. I'm very comfortable with Bootstrap/HTML5, Sass/CSS and functionally terrible at jQuery and PHP - but functionally.

So, ideally I'd like something that speeds up my process, helps me discover some design elements, and does some of the scripting for things like webforms. I'd then like to output it afterwards and manipulate the code to customize it for myself and my clients.

My CMS has been Wordpress, but I'm not married to it. Webflow's CMS is kind of intriguing, but would love to hear the perspective of folks with deep-seated and well-founded opinions.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Pollyanna posted:

I don't really mind tweaking things with a designer, aside from the initial annoyance of diving back in and changing some values - which, yes, is really easy. I'm more concerned about possibly pissing off a designer because I didn't nail it the first time, and they have to spend time asking for tweaks. I already kinda feel like not getting everything looking exactly right is giving our designer/PM a negative impression of me, and I'm already garbage at styling so :saddowns:
If they're not following a Style Guide, nor giving you specs, it's on them.

Pollyanna
Mar 5, 2005

Milk's on them.


The Merkinman posted:

If they're not following a Style Guide, nor giving you specs, it's on them.

There’s no style guide whatsoever, and the specs are pretty vague and whatever edge cases/unspecified behavior aren’t captured in them is up to me to resolve. Not everything I resolve is exactly how the designer wants it :shrug:

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Pollyanna posted:

There’s no style guide whatsoever, and the specs are pretty vague and [b]whatever edge cases/unspecified behavior aren’t captured in them is up to me to resolve]/b]. Not everything I resolve is exactly how the designer wants it :shrug:
Why? Shouldn't it be the designer's job to make it work with edge cases? At least visually? I can understand the Designer being unaware of all edge cases, but that's different.



If all of this back and forth takes a lot of time out of your day and the desinger's day, that's a good case for a Style Guide.

Mush Man
Jun 25, 2010

Nintendo announces Frolf means Frog Golf.
Oven Wrangler
Do the suggested languages use frameworks because they aren't built for web development out of the box? Is there much fuss in setting up frameworks?

I actually already have experience in webdev. However I'm only used to working with LAMP on the backend and pure HTML / CSS / JS on the frontend with a little JQuery.

Mush Man fucked around with this message at 08:38 on Dec 12, 2017

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Arguably even php isn’t built for web development out of the box, any modern non trivial undertaking with php will use one of its frameworks.

Getting used to a new language and it’s ecosystem takes time, and deployment is more involved than ‘upload php to webserver’, but arguably many of the benefits that come from working with languages that are less of a clusterfuck of bad design are worth the switching costs.

Depending on your circumstances it may or may not be worth it, but you owe it to yourself to see what it could be like with a modern framework and language.

Maluco Marinero fucked around with this message at 09:16 on Dec 12, 2017

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Speaking of PHP, I'm trying to learn more about it, other than using it for CRUD applications, so I can be a better employee at work (LOL).

Are there any good tutorials that get into creating REST APIs with PHP that you would recommend? (preferably ones that hold your hand a lot)

Main Paineframe
Oct 27, 2010

Pollyanna posted:

I don't really mind tweaking things with a designer, aside from the initial annoyance of diving back in and changing some values - which, yes, is really easy. I'm more concerned about possibly pissing off a designer because I didn't nail it the first time, and they have to spend time asking for tweaks. I already kinda feel like not getting everything looking exactly right is giving our designer/PM a negative impression of me, and I'm already garbage at styling so :saddowns:

Sometimes you're going to have to communicate with the people you're actively collaborating with. I know you've had bad experiences at previous workplaces, but you sound like you're downright terrified of your coworkers.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Grump posted:

Speaking of PHP, I'm trying to learn more about it, other than using it for CRUD applications, so I can be a better employee at work (LOL).

Are there any good tutorials that get into creating REST APIs with PHP that you would recommend? (preferably ones that hold your hand a lot)

I started with PHP way back when. If I was just starting out today, I would look at Django + Django Rest Framework. http://www.django-rest-framework.org/tutorial/quickstart/

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
We use PHP at work, so it's pretty important that I stick with the language that will be the most helpful.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Grump posted:

We use PHP at work, so it's pretty important that I stick with the language that will be the most helpful.

I see, makes sense. Are there any particular frameworks you guys are using already?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I'm kinda liking .NET to be honest. The only reason I ever worked with PHP was because of it's existing pre-eminence, but taken solely as the characteristics of the language I don't know if I'd pick that up cold.

Tei
Feb 19, 2011

fletcher posted:

I see, makes sense. Are there any particular frameworks you guys are using already?

On my company we reuse many components from older projects, so thats like a in-house framework we have build without trying to build a framework.

I think in 2017 is less reasonable to write code without a good framework than in 2010 or 2001. I feel bad, because I have always wrote software without using modules, and looking back, is a bad idea.

Even if you don't settle in a particular framework, is a good idea to use composer to install many modules and get accustomed to take the best modules from the best developers and benefit from that, and from the autoupdating and automatic dependencies resolution.

The idea to write a software with a text editor, without a makefile or gulpfile or Podfile or similar seems a dead one and we must proceed forward.

By getting good modules with composer some things will happen, maybe you will find a module you really like called LaravelFoobar and find is a Laravel wrapper of Foobar. And then try Laravel. Or Cake, or any of the others.

This is my opinion and I am usually wrong about this things, so caveat emptor.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

fletcher posted:

I see, makes sense. Are there any particular frameworks you guys are using already?

We built our own from just Vanilla PHP that interacts with the CMS we develop apps for.

It's pretty simple to use, but at this point, I really only know how to make Web APIs. My goal is to learn some basics about building out a REST API and basically how the M and C part in MVC works.

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!
Is there some sort of library/framework for loading webpages and verifying whether some bits of arbitrary javascript (various tracking/analytics code, which may or may not be present in the page) are being executed on page load? The only real information I have on this so far is that "the output would be whether each code is present on the page (and workable / not commented out, etc.)".

Leveraging CEF or something like it seems the way to go, but I haven't been able to figure out whether it supports exactly what I want to do.

Mush Man
Jun 25, 2010

Nintendo announces Frolf means Frog Golf.
Oven Wrangler
After doing a little bit of research, it looks likes the current alternatives to PHP are LYME, the Elixir route; MEAN, the JavaScript route; or Django, the Python route. Are there any good comparisons between these out there? Would free hosting be compatible with them all?

huhu
Feb 24, 2006

Mush Man posted:

After doing a little bit of research, it looks likes the current alternatives to PHP are LYME, the Elixir route; MEAN, the JavaScript route; or Django, the Python route. Are there any good comparisons between these out there? Would free hosting be compatible with them all?

Which language do you want to learn/know? Go with that framework.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Or look at local job postings and figure out what people are getting paid to do in your area. I had to google 'LYME stack' so I'm guessing there wouldn't be a lot of demand for it, at least in my area.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Mush Man posted:

After doing a little bit of research, it looks likes the current alternatives to PHP are LYME, the Elixir route; MEAN, the JavaScript route; or Django, the Python route. Are there any good comparisons between these out there? Would free hosting be compatible with them all?

Python - Django
Ruby - Ruby on Rails
Javascript - Node
C# - ASP.NET (I think, I'm not as familiar with this all).

Check out Heroku to get you off the ground running for free.

The Fool
Oct 16, 2003


Doh004 posted:

Python - Django
Ruby - Ruby on Rails
Javascript - Node
C# - ASP.NET (I think, I'm not as familiar with this all).

Check out Heroku to get you off the ground running for free.

AWS, GCP and Azure have pretty nice trials plans.

Azure, and I believe GCP also have some really good consumption-based and totally free services as well.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Appharbor still has a free tier https://appharbor.com/pricing

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Stupid newbie question: is there a reason not to include Heroku on these lists? Because that's the only one I know.

The Fool
Oct 16, 2003


Love Stole the Day posted:

Stupid newbie question: is there a reason not to include Heroku on these lists? Because that's the only one I know.

I feel like Heroku is less relevant, since it's essentially a management layer on top of AWS, and you can get similar services directly from any of the big three cloud providers these days.

The March Hare
Oct 15, 2006

Je rêve d'un
Wayne's World 3
Buglord

Mush Man posted:

After doing a little bit of research, it looks likes the current alternatives to PHP are LYME, the Elixir route; MEAN, the JavaScript route; or Django, the Python route. Are there any good comparisons between these out there? Would free hosting be compatible with them all?

You should do whatever you want, but if you go the elixir route you should really use Phoenix.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Lumpy posted:

Each input is represented as an object that has an array of validators. Add / remove validators as needed, and then when the form submits, you run the value through those validators. You can have different arrays as needed for more complex validation like an array where if any fail, it's a fail, or another that ALL have to fail for it to not pass.

I tend to couple the validators with a message a la:

JavaScript code:
import { isRequred, isEmail } from './textValidators';

isRequiredValidator = { validator: isRequired, message: "This field is required" }
isEmailValidator = { validator: isEmail, message: "Please enter a valid email address" }

usernameField = { validators: [ isRequiredValidator ], ... }
emailField = { validators: [isRequiredValidator, isEmailValidator], ... }

Works okay, but I'm always trying to improve it / seek out better ideas because forms are hard.

This post is from a while ago, but I just tried implementing it into my current project.

It worked pretty okay, but I can see it getting very wordy when you have a lot of different inputs that require different validation

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Grump posted:

This post is from a while ago, but I just tried implementing it into my current project.

It worked pretty okay, but I can see it getting very wordy when you have a lot of different inputs that require different validation

All those words have to be somewhere.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Thermopyle posted:

All those words have to be somewhere.

Yeah. I’m trying to tend towards those being translation markers personally though. ‘is_required’, ‘invalid_email’, etc. Gotta put the translation code somewhere so my preference is typically at the very last moment of render rather than within the validation logic. It is beneficial if the server speaks that language too of keywords, because then you can collect all the actual errors in a translation file for consistency of wording.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Maluco Marinero posted:

Yeah. I’m trying to tend towards those being translation markers personally though. ‘is_required’, ‘invalid_email’, etc. Gotta put the translation code somewhere so my preference is typically at the very last moment of render rather than within the validation logic. It is beneficial if the server speaks that language too of keywords, because then you can collect all the actual errors in a translation file for consistency of wording.

I did a big translation thing long ago, was relatively pleased with it. Translation keys and their values were kept in a large Excel spreadsheet that was checked into source. This is what would be sent to various translators to fill in. Then, a build step would take the current Excel file and convert it into a number of JSON files, 1 per language. These were then loaded by the SPA and used to fill in the values wherever the keys were. This worked out pretty well, as the translations happened client side, so it was fast to change between them, and the language files would rarely change so were easy to cache.

geeves
Sep 16, 2004

Skandranon posted:

I did a big translation thing long ago, was relatively pleased with it. Translation keys and their values were kept in a large Excel spreadsheet that was checked into source. This is what would be sent to various translators to fill in. Then, a build step would take the current Excel file and convert it into a number of JSON files, 1 per language. These were then loaded by the SPA and used to fill in the values wherever the keys were. This worked out pretty well, as the translations happened client side, so it was fast to change between them, and the language files would rarely change so were easy to cache.

Same here, but we had a lot of problems with translations in source control, so we wrote our own translation app a couple of years ago that sits outside of it and it's been great.

We're Java, so just export to a properties file for each language we support with the ~40-50 keys per release that we need. The translations comeback in the same files we sent, we upload them and they populate themselves into the DB.

During the build we hit the API which generates all the full properties files and auto downloads them to the correct application during the build and grunt tasks convert the properties to json.

The front-end to our app is like locize.com, but a bit more blunt. I've been given the go a head to open source it, but just haven't had time to rip out the Google Auth stuff yet that's tied directly to our accounts, etc.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I'm trying to get secure Websockets working, it's a Node project and I'm using the ws library along with express.

code:
const express = require('express');
const http = require('http');
const https = require('https');
const fs = require('fs');
const path = require('path');
const serveStatic = require('serve-static');
const WebSocket = require('ws');

const env = process.env.NODE_ENV || 'development';

// server

function readCert(filename) {
    const filepath = path.join(__dirname, '..', '..', 'private', '.dehydrated', 'certs', '[my-domain.com]', filename);
    if (!fs.existsSync(filepath)) {
        console.log('Warning: Missing SSL cert: ' + filename);
        return undefined;
    }
    return fs.readFileSync(filepath, 'utf8');
}

function createServer(app) {
    if (env !== 'production') return http.createServer(app);
    return https.createServer({
        cert: readCert('cert.pem'),
        key: readCert('privateKey.pem')
    }, app);
}

const app = express();
const server = createServer(app);
const wss = new WebSocket.Server({ server });

// http

if (env === 'production') {
    app.use('/.well-known', serveStatic(path.join(__dirname, '..', '..', 'public', '.well-known'))); // ssl signing
}

// primary

wss.on('connection', (ws) => {
    console.log('connection!');
});

// working

const port = process.env.PORT || 9090;

server.listen(port, () => {
    console.log(`Server running on port: ${port}`);
});
And that's all ok. Though none of it feels right. I have to make exceptions for production, and I still need to support http, in order for letsencrypt not to expire after 90 days. Adding to the confusion, my host handles http->https for me. So really I need insecure http and secure websockets.

But the ws library doesn't let me do that, I have to provide it an https `server` option to get secure websockets. I know I can also declare a second http version of the site as well. Then I've got both an http and https version running, and my host is handling http->https on top of that? I'm imagining the number of `if (env === 'production')` `if (env !== 'production')` statements I'm going to have to use and the whole thing feels wrong in the first place. I'm starting to have fever dreams about forking the ws library and making some hacky version out of it.

Please tell me where the stupid happened to me.

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

Just proxy through NGINX, then you would at least have proper HTTP/2 support.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply