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
Forgall
Oct 16, 2012

by Azathoth

Gildiss posted:

We almost had to develop exclusively on IE at Bank of America after an IT director saw a dev change a dollar amount using the dev console. He issued an order to force all devs to remove Chrome.
There was obviously push back but I don't think he got called a retard which is unfortunate.
This can't be real :staredog:

Adbot
ADBOT LOVES YOU

Count Thrashula
Jun 1, 2003

Death is nothing compared to vindication.
Buglord
I heard that computers can be used to change numbers in spreadsheets, therefore I ordered all my staff to remove their computers.

Also pencils because they have erasers.

Also their brains.

Thermopyle
Jul 1, 2003

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

Gildiss posted:

We almost had to develop exclusively on IE at Bank of America after an IT director saw a dev change a dollar amount using the dev console. He issued an order to force all devs to remove Chrome.
There was obviously push back but I don't think he got called a retard which is unfortunate.

lol, this is perfect.

Odette
Mar 19, 2011

Gildiss posted:

We almost had to develop exclusively on IE at Bank of America after an IT director saw a dev change a dollar amount using the dev console. He issued an order to force all devs to remove Chrome.
There was obviously push back but I don't think he got called a retard which is unfortunate.

What the gently caress does he think you do all day? Steal money from customers? If that's the case, why even come in to work? :v:

ROFLburger
Jan 12, 2006

I don't get it. Could you not demonstrate to that person that you could do the exact same with with the IE dev tools? Or was this at a much earlier time

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I was following this tutorial for Django + Webpack: http://owaislone.org/blog/webpack-plus-reactjs-and-django/

Things seem to be working well but I've got a ton of ./assets/bundles/main-[hash].js files accumulating now as I'm making changes. Is there something that is supposed to be cleaning this up?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

ROFLburger posted:

I don't get it. Could you not demonstrate to that person that you could do the exact same with with the IE dev tools? Or was this at a much earlier time

The guy is busy yo, probably saw it and then ran off furrowing his brow, saying 'this must not be' under his breath.

luchadornado
Oct 7, 2004

A boombox is not a toy!

fletcher posted:

I was following this tutorial for Django + Webpack: http://owaislone.org/blog/webpack-plus-reactjs-and-django/

Things seem to be working well but I've got a ton of ./assets/bundles/main-[hash].js files accumulating now as I'm making changes. Is there something that is supposed to be cleaning this up?

Your build script should have a clean step to start with a pristine, empty dist directory.

Sample package.json:
code:
"scripts": {
    "build": "npm run clean && npm run copy-assets && NODE_ENV=production webpack",
    "clean": "rm -rf ./dist",
    "copy-assets": ". ./build_scripts/copy_assets.sh",
    "dev": "npm run clean && npm run copy-assets && NODE_ENV=development webpack-dev-server",
    "test": "mocha -r preMocha.js 'src/**/*.test.ts'",
    "test:coverage": "nyc npm test"
  },

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Helicity posted:

Your build script should have a clean step to start with a pristine, empty dist directory.

Sample package.json:
code:
"scripts": {
    "build": "npm run clean && npm run copy-assets && NODE_ENV=production webpack",
    "clean": "rm -rf ./dist",
    "copy-assets": ". ./build_scripts/copy_assets.sh",
    "dev": "npm run clean && npm run copy-assets && NODE_ENV=development webpack-dev-server",
    "test": "mocha -r preMocha.js 'src/**/*.test.ts'",
    "test:coverage": "nyc npm test"
  },

But if I have webpack in watch mode while I'm developing and it's recompiling every time I make a change, am I just supposed to run the clean command periodically?

luchadornado
Oct 7, 2004

A boombox is not a toy!

fletcher posted:

But if I have webpack in watch mode while I'm developing and it's recompiling every time I make a change, am I just supposed to run the clean command periodically?

Preferred option would be to use something like webpack-dev-server that keeps your dev builds in memory only, or only generate hashes when NODE_ENV=production. When you're not actively testing cache busting or deploying to prod, there's no real reason to append hashes to all your assets. The webpack-dev-server method might be a little tricky depending on what you're doing with Django - don't fret if it doesn't work easily.

Hackier options are not worrying about dist files until you go to publish (at which point you'd run the clean) or using something like the webpack shell plugin to execute the clean command before every build during a watch.

luchadornado fucked around with this message at 00:37 on Apr 20, 2017

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Right on, thanks for the help Helicity!

Gildiss
Aug 24, 2010

Grimey Drawer

ROFLburger posted:

I don't get it. Could you not demonstrate to that person that you could do the exact same with with the IE dev tools? Or was this at a much earlier time

This was about a year ago.

Rubellavator
Aug 16, 2007

We only support IE.

Our dev environments are linux.

Honest Thief
Jan 11, 2009
How would you deal with a designer who's been on the company longer and that person structures the whole sites' structure, html and even script tags?
My approach has been to simply take what I'm given, transition scripts and so on, and just adapt them into commonjs modules so I can bundle everything with webpack, but it honestly just seems a backwards approach. Having never worked with codekit, can I just say "hey, write your scripts and dependencies like so" and avoid later headaches?

Count Thrashula
Jun 1, 2003

Death is nothing compared to vindication.
Buglord
Another question. If I'm separating my concerns, and having Nginx serve the frontend portion of the site, and Node running the backend of the site, how would I handle something like page login? If Node isn't dynamically generating the pages, I'm not sure how to check for login status.

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

COOL CORN posted:

Another question. If I'm separating my concerns, and having Nginx serve the frontend portion of the site, and Node running the backend of the site, how would I handle something like page login? If Node isn't dynamically generating the pages, I'm not sure how to check for login status.

Usually, you do some sort of REST request to perform the login, and this returns a token. The token is then passed into subsequent REST requests that require authentication. You can also have the login request return some sort of user object that the UI can use to enforce things on the UI side for the sake of better UX.

Count Thrashula
Jun 1, 2003

Death is nothing compared to vindication.
Buglord

Skandranon posted:

Usually, you do some sort of REST request to perform the login, and this returns a token. The token is then passed into subsequent REST requests that require authentication. You can also have the login request return some sort of user object that the UI can use to enforce things on the UI side for the sake of better UX.

Ah, thanks. I'm used to Django which takes care of all that itself, so I have some reading up to do :)

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
I have Visual Studio Code question: what's the difference between the built-in "Javascript React" language and the "Javascript (Babel)" language I get by installing the Babel ES6/ES7 extension? I'm working in Angular for work and so have been using the "Javascript (Babel)" language. Lately, though, I've been dabbling in React on the side and am now wondering if there's any value or utility I'd gain by switching to "Javascript React" when I'm editing a .jsx file.

geeves
Sep 16, 2004

Is there a stand alone library that's similar to Angular Translate? Like how axios is a stand alone version of $http?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

geeves posted:

Is there a stand alone library that's similar to Angular Translate? Like how axios is a stand alone version of $http?

http://i18next.com/ is my port of call for Javascript translation.

porksmash
Sep 30, 2008

COOL CORN posted:

Ah, thanks. I'm used to Django which takes care of all that itself, so I have some reading up to do :)

I'm using json web tokens: http://www.django-rest-framework.org/api-guide/authentication/#json-web-token-authentication

geeves
Sep 16, 2004

Maluco Marinero posted:

http://i18next.com/ is my port of call for Javascript translation.

Thanks! That's exactly what I'm looking for!

luchadornado
Oct 7, 2004

A boombox is not a toy!


Pro-tier: use the nginx http_auth_request module to talk to an LDAP or similar service, or use an oauth proxy like https://github.com/jirutka/ngx-oauth. Then your app doesn't care about authn/authz - it's all offloaded so you can put multiple sites/APIs under its aegis and don't have to duplicate auth logic, and allows you to squeak out more performance from your apps.

luchadornado fucked around with this message at 13:10 on Apr 22, 2017

Kekekela
Oct 28, 2004
I was taking another look at Vue today for a small project that I want to knock out this weekend. Every time I come back to checking out a framework like this however, I'm kind of struck by one big thing:

Now that React has happened, I pretty much feel like having a programming language handle templating is superior to having a templating language handle programming, if that makes sense.

Anyone else have an opinion one way or the other on this?

luchadornado
Oct 7, 2004

A boombox is not a toy!

Kekekela posted:

I was taking another look at Vue today for a small project that I want to knock out this weekend. Every time I come back to checking out a framework like this however, I'm kind of struck by one big thing:

Now that React has happened, I pretty much feel like having a programming language handle templating is superior to having a templating language handle programming, if that makes sense.

Anyone else have an opinion one way or the other on this?

Yes, anytime you can leverage an extensively used/tested/proofed piece of hardware/OS/stack/library to provide automation and guarantees, you are practicing the informal art of design by guarantee and making your code better and your life easier. You just discovered the beauty of code generation, as React is essentially a code generator that transforms in-memory objects to HTML that is spit out onto a page. I'd highly recommend this book to touch on these concepts more: https://pragprog.com/book/tpp/the-pragmatic-programmer

Speaking of, I've been asked which books I consider essential for any fullstack developer. I've come up with the following list, and would love to hear feedback:

  • The Pragmatic Programmer - helps you think about how to write software in a more maintainable way and prevent headaches.
  • Clean Code - If you struggle with how to organize code, name variables and classes, when to write comments, how to style your code, this is your book.
  • The Art of Unit Testing - If you aren't writing unit tests and writing them *well*, your code is already legacy.
  • Patterns of Enterprise Application Architecture - A small section on when/why to use patterns, and then a huge reference section on each pattern.
  • Service Design Patterns - Most full stack devs need to write services/APIs, this is the bible for that.

edit: the top three apply to pretty much any developer, including people that only stay on the front-end

luchadornado fucked around with this message at 16:23 on Apr 22, 2017

Thermopyle
Jul 1, 2003

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

Those are all pretty good books.

When I'm asked for book recommendations I always struggle to come up with a list because I feel like I learn stuff from everything I read. Even when I read wrong stuff.

geeves
Sep 16, 2004

Helicity posted:


Speaking of, I've been asked which books I consider essential for any fullstack developer. I've come up with the following list, and would love to hear feedback:


That list is great, I have all of them and they are great reads.

If the stack involves Java, add

Effective Java by Joshua Bloch
Concurrency in Practice by Brian Goetz

I would recommend Effective Java to anyone, actually. It deals with programming concepts, such as Immutability, which would be good for any programmer to read.

I would also add a good book on functional programming (I haven't looked for one, yet) since that's the way JavaScript seems to be headed. Those functional programming concepts would translate well to other languages.

porksmash
Sep 30, 2008

Helicity posted:

Pro-tier: use the nginx http_auth_request module to talk to an LDAP or similar service, or use an oauth proxy like https://github.com/jirutka/ngx-oauth. Then your app doesn't care about authn/authz - it's all offloaded so you can put multiple sites/APIs under its aegis and don't have to duplicate auth logic, and allows you to squeak out more performance from your apps.

That's neat, but Django is my auth service and I'm assuming that other guy's too.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Helicity posted:

Yes, anytime you can leverage an extensively used/tested/proofed piece of hardware/OS/stack/library to provide automation and guarantees, you are practicing the informal art of design by guarantee and making your code better and your life easier. You just discovered the beauty of code generation, as React is essentially a code generator that transforms in-memory objects to HTML that is spit out onto a page. I'd highly recommend this book to touch on these concepts more: https://pragprog.com/book/tpp/the-pragmatic-programmer

Speaking of, I've been asked which books I consider essential for any fullstack developer. I've come up with the following list, and would love to hear feedback:

  • The Pragmatic Programmer - helps you think about how to write software in a more maintainable way and prevent headaches.
  • Clean Code - If you struggle with how to organize code, name variables and classes, when to write comments, how to style your code, this is your book.
  • The Art of Unit Testing - If you aren't writing unit tests and writing them *well*, your code is already legacy.
  • Patterns of Enterprise Application Architecture - A small section on when/why to use patterns, and then a huge reference section on each pattern.
  • Service Design Patterns - Most full stack devs need to write services/APIs, this is the bible for that.

edit: the top three apply to pretty much any developer, including people that only stay on the front-end

Haven't read the others, but those top two are outstanding.

luchadornado
Oct 7, 2004

A boombox is not a toy!

porksmash posted:

That's neat, but Django is my auth service and I'm assuming that other guy's too.

Understood. I tossed it out there as more of something to think about as a potential next step. Handling auth flows in applications has been done for a long time and works, but having what is essentially an auth termination at the reverse proxy is such as amazing feeling when you see how it separates concerns, prevents dupe auth logic in each of your apps, and allows your apps to perform better.

Munkeymon
Aug 14, 2003

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



Kekekela posted:

I was taking another look at Vue today for a small project that I want to knock out this weekend. Every time I come back to checking out a framework like this however, I'm kind of struck by one big thing:

Now that React has happened, I pretty much feel like having a programming language handle templating is superior to having a templating language handle programming, if that makes sense.

Anyone else have an opinion one way or the other on this?

And now you understand why PHP is bad, too :)

ROFLburger
Jan 12, 2006

All languages are bad

PlaneGuy
Mar 28, 2001

g e r m a n
e n g i n e e r i n g

Yam Slacker

ROFLburger posted:

All languages are bad

all languages are ok. all programmers are bad.

Vesi
Jan 12, 2005

pikachu looking at?

PlaneGuy posted:

all languages are ok. all programmers are bad.

Only the Buddha can write the perfect php4 webmail application.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

PlaneGuy posted:

all languages are ok. all programmers are bad.

All languages are bad because they were written by programmers, who are all bad.

Munkeymon
Aug 14, 2003

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



Lumpy posted:

All languages are bad because they were written by programmers, who are all bad.

Rasmus Lerdorf posted:

I'm not a real programmer.

:colbert:

HaB
Jan 5, 2001

What are the odds?

If the saga of Supa Hot Fire is to be believed, that guy is an amazing programmer.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

This means PHP doesn't even qualify as a language it's that bad. Something we can all agree on no doubt.

luchadornado
Oct 7, 2004

A boombox is not a toy!

I want to agree with languages being good and programmers being bad, but I've never seen good PHP or VB. Sometimes language decisions are just so garbage, you can't escape :smith:

(programmers are still bad)

Adbot
ADBOT LOVES YOU

Plavski
Feb 1, 2006

I could be a revolutionary

Helicity posted:

I want to agree with languages being good and programmers being bad, but I've never seen good PHP or VB. Sometimes language decisions are just so garbage, you can't escape :smith:

(programmers are still bad)

We have three in-house PHP programmers here, and boy do they hate that language. Even worse, they are WordPress PHP developers - a nightmare! I'm quite grateful to just write C# and TypeScript all day. For their quirks, they're pretty nice languages to use.

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