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
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Data Graham posted:

What's everybody's opinion of CoffeeScript? A crutch for the weak, or the only way to do rich apps with closures and optional parameters without going totally nuts?

Someone didn't like some of the warts JS has, so they wrote something that has different warts and requires an additional build step.

Adbot
ADBOT LOVES YOU

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India
I think with ES6, Coffeescript is pretty much overkill. I guess you can use it if you like enforced indentation.

Depressing Box
Jun 27, 2010

Half-price sideshow.

Lumpy posted:

Someone didn't like some of the warts JS has, so they wrote something that has different warts and requires an additional build step.

Yeah, its attempts to fix JS quirks like scope/hoisting mostly made it more convoluted. If you're already adding another build step, just use Babel to write ES2015 and use stuff like arrows, classes, and template strings natively (well, eventually).

Thermopyle
Jul 1, 2003

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

template strings are the best

Unity Gain
Sep 15, 2007

dancing blue

Data Graham posted:

What's everybody's opinion of CoffeeScript? A crutch for the weak, or the only way to do rich apps with closures and optional parameters without going totally nuts?

It's a palliative for Ruby programmers so they don't have to feel like they're coding JavaScript when they're coding JavaScript. For any programmer worth their salt It's a needless abstraction and distraction.

my bony fealty
Oct 1, 2008

give me curly braces or give me death

Interestingly, I learned recently that jQuery originally didn't use curly braces, but Resig quickly backtracked on that once it became apparent that they are rather useful for organization

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



If you're going to choose a transpiling language and it isn't TypeScript* then you've already made a weird decision or just really can't stand Javascript. Comes along with most of the nice ES6 improvements, with the secret sauce of optional typing.


*except for Elm or ClojureScript as special cases

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
I just figured out AWS' SES service for sending out e-mails via SMTP in Python, so now I need to figure out how to expose this new "send an e-mail" functionality to the clientside of things in a REST-oriented way.

Right now I'm thinking about making an endpoint, something like /v1/api/admins/send_notification/<template ID>. The idea is, there are three different types of notices to send out, and the client just needs to specify which notice (template) to use. Provided the POST call passes authentication and authorization, the server would then handle preparing and sending out e-mails based on the specified template as it's defined on the server. Afterwards it'll probably return the number of e-mails sent, or some other kind of object of success:failure messages indicating that SOMETHING happened.

Is there a better way of going about this?

Munkeymon
Aug 14, 2003

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



my bony fealty posted:

jQuery originally didn't use curly braces, but Resig quickly backtracked on that once it became apparent that they are rather useful for organization

:catstare:

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India

my bony fealty posted:

Interestingly, I learned recently that jQuery originally didn't use curly braces, but Resig quickly backtracked on that once it became apparent that they are rather useful for organization
Are you sure it wasn't semicolons?

obstipator
Nov 8, 2009

by FactsAreUseless
I hated coffeescript in the beginning, but I've discovered that it really speeds up development by shorthanding everything once you get the hang of it. besides not using/requiring all the various braces, I'd say the one thing I like best about it that es6 doesn't do is the implied comma when making an object/array. I wish es6 would find a way where that could be added in, but it would probably cause breaking changes if they were to add it.

Ruby devs have ruby'd it up big time though, so I tend to avoid a wide portion of the "improvements" that coffeescript has introduced. Stuff like "unless" and swapping the if statement to be at the end of a line to make it "more English" are imo some of the dumbest poo poo anyone has added to a language.

e: Also I looked at LiveScript today and it looks like complete garbage in comparison.

Data Graham
Dec 28, 2009

📈📊🍪😋



obstipator posted:

Ruby devs have ruby'd it up big time though, so I tend to avoid a wide portion of the "improvements" that coffeescript has introduced. Stuff like "unless" and swapping the if statement to be at the end of a line to make it "more English" are imo some of the dumbest poo poo anyone has added to a language.

*Perl slinks out of the room*

gbaby
Feb 6, 2015
I've been using CoffeeScript, Jade and Stylus lately and like them because they make code "cleaner" once you learn them but I find myself using js2.coffee and converters pretty often to check myself so am I saving time? :iiam:

bartkusa
Sep 25, 2005

Air, Fire, Earth, Hope
TIL
code:
<link rel="prefetch" />
is a worthless steaming pile.

Chrome eagerly downloads prefetches before the current page's assets.
Safari does nothing, which is actually an improvement.
Firefox waits until the current page is loaded , then only downloads 1 or 2 of my 15 links.
IE11, miraculously, does everything perfectly.

Thermopyle
Jul 1, 2003

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

Does anyone have any thoughts about best practices for a US State field on an address input form?

Most forms seem to have a select input, but I was just sitting here thinking that a field just does real-time-ish validation on a text field seems better. When I'm typing my address into a form, I breeze through it quickly by tabbing between fields...it seems like changing from a series of text fields to a select box breaks up the flow of "type in field, hit tab, type in field, hit tab, type in field, hit tab". I mean, I realize that usually a select box will select the characters a person types in when its focused, but I'm just thinking the visual switch is more jarring and I'm not sure what you gain by using a select box in this instance. People know what state they live in.

ufarn
May 30, 2009

Thermopyle posted:

Does anyone have any thoughts about best practices for a US State field on an address input form?

Most forms seem to have a select input, but I was just sitting here thinking that a field just does real-time-ish validation on a text field seems better. When I'm typing my address into a form, I breeze through it quickly by tabbing between fields...it seems like changing from a series of text fields to a select box breaks up the flow of "type in field, hit tab, type in field, hit tab, type in field, hit tab". I mean, I realize that usually a select box will select the characters a person types in when its focused, but I'm just thinking the visual switch is more jarring and I'm not sure what you gain by using a select box in this instance. People know what state they live in.
I'd consider playing around with <datalist>.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Thermopyle posted:

Does anyone have any thoughts about best practices for a US State field on an address input form?

Most forms seem to have a select input, but I was just sitting here thinking that a field just does real-time-ish validation on a text field seems better. When I'm typing my address into a form, I breeze through it quickly by tabbing between fields...it seems like changing from a series of text fields to a select box breaks up the flow of "type in field, hit tab, type in field, hit tab, type in field, hit tab". I mean, I realize that usually a select box will select the characters a person types in when its focused, but I'm just thinking the visual switch is more jarring and I'm not sure what you gain by using a select box in this instance. People know what state they live in.

I have always wondered why, if you asked for my zip code, you need to ask me for my state.

kloa
Feb 14, 2007


Lumpy posted:

I have always wondered why, if you asked for my zip code, you need to ask me for my state.

I love websites that auto-fill the state for you :swoon:

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Lumpy posted:

I have always wondered why, if you asked for my zip code, you need to ask me for my state.

I think in some rare cases a zip code can span multiple states

Data Graham
Dec 28, 2009

📈📊🍪😋



fletcher posted:

I think in some rare cases a zip code can span multiple states

Having implemented many a zip code db lookup interface / reverse geocoding deely, I would love to know if this is a real thing.

Thermopyle
Jul 1, 2003

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

Data Graham posted:

Having implemented many a zip code db lookup interface / reverse geocoding deely, I would love to know if this is a real thing.

All my Googlin' leads me to believe the answer is yes, but its very rare.

Bhaal
Jul 13, 2001
I ain't going down alone
Dr. Infant, MD
I would categorize it as rare enough that anybody in that spot is already used to it. Zips change all the time but the state level designation hardly ever does. It shouldn't be much trouble to get a zip:state mapping (first 3 digits should be all you need), set it once and be done with it.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
With a zip code there's the problem that this system isn't internationally portable, so just doing a lookup table of digits=>state, even with multiple options, fails completely when you start looking up things like UK post codes. Because of this a lot of systems just reject the idea of trying to figure it out automagically and let the user type in a few extra digits to save development costs. Most of the ones that try to roll their own soon find its a lot more complicated than they thought it was.

It's not that hard to implement an internationally compatible lookup using the Google Geocoding API, it's just a little slow (because AJAX) and occasionally unreliable (There are a lot of results for "Oxford"). Sometimes that can muddy the UX and get in the way, but there are still ways to make it work without irritating your visitors if their address isn't found in a lookup, or they're half way through typing an address when the lookup comes back.

Then there's the problem of which order your fields appear in. Most of the time they follow the format of a letter, which is <number> <street>, <province>, <state>, <zipcode>, <country>, but that's rear end-backwards for a lookup. You could put Country and then Zipcode first to narrow the results, but that's pretty weird. Conveniently the Geocoding API (IIRC) can have a stab at the full address based on the street and province, so that's another option.

Now can someone tell me why I have to select between VISA and MasterCard in a dropdown after I put in my credit card number. :argh:

v1nce fucked around with this message at 00:58 on Jul 7, 2015

Data Graham
Dec 28, 2009

📈📊🍪😋



Okay, cool. So it's stuff like weird pseudo-towns that straddle state borders, like military bases (Fort Campbell, KY/TN). Interesting.

Impotence
Nov 8, 2010
Lipstick Apathy
I'm working on a new site, what is the latest/hipsteriest frontend framework now? http://www.getmdl.io ?
I'm looking to specifically not use bootstrap/pure/foundation

Rubies
Dec 30, 2005

Live Forever
Die Every Day

:h: :s: :d: :c:
I hate on lazy frameworks as much as the next guy, but if you're going that route why not pick the best supported? Chop up Foundation, it won't break but you won't be a slave to it.

Impotence
Nov 8, 2010
Lipstick Apathy
Oh nah, I'm not hating on any of them, I just want to use something different for a change pretty much. Probably sounds dumb.

Thermopyle
Jul 1, 2003

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

Biowarfare posted:

Oh nah, I'm not hating on any of them, I just want to use something different for a change pretty much. Probably sounds dumb.

Not dumb. This is how I find all sorts of cool stuff.

Loezi
Dec 18, 2012

Never buy the cheap stuff

quote:

States!

Please stop asking me for a "state or provice" when I'm living in a country that does not use them as part of their postal system. Forcing a user to mangle his/her address to a format that is illogical and foreign just to satisfy some database schema you brewed up is just stupid from the user's perspective.

Impotence
Nov 8, 2010
Lipstick Apathy

Loezi posted:

Please stop asking me for a "state or provice" when I'm living in a country that does not use them as part of their postal system. Forcing a user to mangle his/her address to a format that is illogical and foreign just to satisfy some database schema you brewed up is just stupid from the user's perspective.

revmoo
May 25, 2006

#basta
Select your region:
o_o
-_-

onionradish
Jul 6, 2006

That's spicy.
Is there a current "best" animation/video format based on compatibility with browsers, mobile devices and responsive design for a smallish, 2-3 second animated logo/graphic that I'm converting from an FLV?

MP4, GIFV, WEBM, something else? It's going into a Bootstrap-themed site if that matters.

Rubies
Dec 30, 2005

Live Forever
Die Every Day

:h: :s: :d: :c:

Biowarfare posted:

Oh nah, I'm not hating on any of them, I just want to use something different for a change pretty much. Probably sounds dumb.

That's not dumb at all, I was not paying attention and read your question as "first time making a site, want framework but also want to be edgy for no reason". I subscribe to /r/web_dev and /r/freelance (and a lot of other subreddits that people who think 'wordpress theme = developer = $$$' gravitate towards) and that comes up a lot so I have an itchy trigger finger when it comes to that kind of request. If you're doing it for your own self improvement and to explore new things as a person with a background in what actually makes these frameworks work, more power to you.

Rubies fucked around with this message at 16:30 on Jul 7, 2015

Munkeymon
Aug 14, 2003

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



onionradish posted:

Is there a current "best" animation/video format based on compatibility with browsers, mobile devices and responsive design for a smallish, 2-3 second animated logo/graphic that I'm converting from an FLV?

MP4, GIFV, WEBM, something else? It's going into a Bootstrap-themed site if that matters.

H.264 encode in an MP4 container has the best cross-browser support right now if you're dead set on just making one file, but it's fairly trivial to also include a webm container to scoop up the last few percent of potential visitors.

spacebard
Jan 1, 2007

Football~

Munkeymon posted:

H.264 encode in an MP4 container has the best cross-browser support right now if you're dead set on just making one file, but it's fairly trivial to also include a webm container to scoop up the last few percent of potential visitors.

Comedy option: SVG is fairly well supported too.

I still need to learn how to do things in SVG rather than CSS animation fuckery. It's a lot of math I don't want to think about though.

gbaby
Feb 6, 2015
SVG with animations/transitions is a good suggestion. Maybe check out D3.js too for more complex stuff?

LabiaBadgerTickler
Feb 12, 2014

by Ralp
This is going to be a pretty open question, so apologies in advance for the inevitable poo poo storm that will rise as a result. But I've been programming for a few years now (c# mainly) and I'm looking to get into web development and change career paths.

The only thing is, I've no idea what aspect of web development to go into. From what I've looked into, there seems to be a million and one ways to build a website and I'm hoping to land a web developer role over in Canada. So my question is this: what would you recommend as the technologies I should learn in order to gain a web development role?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
Along with a million and one ways to build a website, this begs the question; what do you want to do? Besides "get a job in a new industry", what sort of thing do you hope to be able to do?

At ground level for what you're familiar with, there's always ASP .NET C#, but if you're looking to branch out from C# then I guess this applies to you.

my bony fealty
Oct 1, 2008

LabiaBadgerTickler posted:

This is going to be a pretty open question, so apologies in advance for the inevitable poo poo storm that will rise as a result. But I've been programming for a few years now (c# mainly) and I'm looking to get into web development and change career paths.

The only thing is, I've no idea what aspect of web development to go into. From what I've looked into, there seems to be a million and one ways to build a website and I'm hoping to land a web developer role over in Canada. So my question is this: what would you recommend as the technologies I should learn in order to gain a web development role?

Web development is generally split into 'front end' and 'back end' roles (not a hard and fast rule and there are a lot of devs who do both)

Front end is the client side, user interaction part - what someone sees and interacts with when they go to a website. This involves HTML, CSS, and Javascript (and the various Javascript libraries & frameworks and CSS preprocessors).

Back end is the server side, what the server does with the requests it gets from the client side, which generally involves databases and the like. There are multiple server-side languages you can choose from but the biggest ones are probably PHP, Python, and Ruby. Javascript can also be used for back end now with node.js.

I would say that everyone should know HTML and CSS, be familiar and comfortable with Javascript, and from there it's up to you - if you want to do front-end then invest your time in getting really good with HTML/CSS/JS, and if you want to do back end then check out one of the languages mentioned above (I like PHP but that's maybe an unpopular opinion around here :v:).

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

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



spacebard posted:

Comedy option: SVG is fairly well supported too.

I still need to learn how to do things in SVG rather than CSS animation fuckery. It's a lot of math I don't want to think about though.

That's true, but I've seen some browsers *cough* Chrome *ahem* do a much worse job resizing SVG than video or regular images. That could have been because Inkscape makes bad SVGs or I didn't find some magic CSS trick to make them look like not-poo poo, though.

gbaby posted:

SVG with animations/transitions is a good suggestion. Maybe check out D3.js too for more complex stuff?

Starting with a video and re-encoding in a different format is still going to be a hell of a lot easier.

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