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.
 
  • Locked thread
rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

MononcQc posted:

"fixed"

For plenty of websites it's a new era of "optimized for" where webkit is often the winner and people just don't give a crap about other browsers.

yeah i think we're just at a lull in the browser wars.

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

MononcQc posted:

Basically, you push your code to Heroku, and a file called a buildpack that contains instructions about how to set up the runtime environment (language dependencies, how to build your app). After that, each buildpack can pretty much do whatever the hell it wants if you feel like modifying it and using your own, and have it fetch dependencies statically from a trusted host, or whatever.

So yeah, if you don't manage your own repos, you'll generally get whatever your build system fetches for that one. If your language fetches 3rd party libraries from github, that's what it's likely gonna do. If your language's build tools don't, then they shouldn't. That's part of building as you deploy, I guess.

There are also plugins that allow to push a directory or package as-is, rather than doing the usual git thing, which could allow us to build before you deploy, getting closer to real releases and probably helping with the rollback mechanisms in the platform.

(Disclaimer: while I work for Heroku, I rarely ship code using the client APIs -- what I know of these things might be wrong or inaccurate)

o i c, that makes me feel better

still tho, i think the bulk of people are likely not fetching static dependencies. I feel like this whole idea of build-to-deploy is weird and i dont like it, but that may just be me being old fashioned. I feel like a tested artifact is the proper thing to be pushing around as opposed to instructions on how to recreate the tested artifact.

Pollyanna
Mar 5, 2005

Milk's on them.


Suspicious Dish posted:

I've recently built a web app that uses all of this new stuff (raw DOM, not jQuery/Angular), and it feels like fresh air.

Do you mind elaborating on this? I'm not sure what you mean by 'raw DOM', which I assume means non-HTML webpages. This is new to me.

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

Pollyanna posted:

Do you mind elaborating on this? I'm not sure what you mean by 'raw DOM', which I assume means non-HTML webpages. This is new to me.

He means not using the jquery element wrappers - just using the proper DOM methods (which sure are nice as well lately, I'm actually considering dumping jq in my angular project)

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
yeah i think the big use case of jquery was to rationalize browsers. now that they've largely converged, I'm not really sure how much utility jquery has.

Pollyanna
Mar 5, 2005

Milk's on them.


Mr. Wynand posted:

He means not using the jquery element wrappers - just using the proper DOM methods (which sure are nice as well lately, I'm actually considering dumping jq in my angular project)

Huh, I guess I must've learned incorrectly when I was studying JS/JQ. What are the right methods, then, and what alternatives to JQ are there? (And I thought Angular was dependent on JQ?)

My Rhythmic Crotch
Jan 13, 2011

Pollyanna posted:

Huh, I guess I must've learned incorrectly when I was studying JS/JQ. What are the right methods, then, and what alternatives to JQ are there? (And I thought Angular was dependent on JQ?)
I'm not a big front-end guy so I'm probably butchering this, but the DOM selectors follow the pattern of document.getElementById("something") while JQuery's follow $("#something").method_name(). jQuery typically gives you functionality that is not present in the plain old javascript DOM methods, like .each(), .hide(), .show() etc, and you can add nifty effects with those methods.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Angular does not depend on jQuery at all. Actually, you should not be using jQuery at all inside Angular: if you are, it's guaranteed you'll do things the wrong way...

jQuery's big initial feature was a CSS selector engine, so you could write $(".foo .bar > li.thing"). That is now in browsers as document.querySelectorAll(".foo .bar > li.thing").

It also used to be that you had to do foo.className = foo.className + ' baz' to add a class to an element, and jQuery tightened that up to foo.addClass('baz');. Now you can do foo.classList.add('baz');.

There's other things like this as well. foo.innerHTML = 'fart'; is now standardized, so you can depend on it instead of having to use foo.html('fart');. foo.text('fart'); is now foo.textContent = 'fart';.

There's still a few annoyances here and there, but overall most of my itches that make me use jQuery have been fixed.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
For modern browser you can use Zepto to get simple wrappers around the new native stuff, since the jQuery API is still quite a bit nicer.

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

Pollyanna posted:

Huh, I guess I must've learned incorrectly when I was studying JS/JQ. What are the right methods, then, and what alternatives to JQ are there? (And I thought Angular was dependent on JQ?)


You can do pretty much everything JQ can in a consistent way using standard DOM methods found on MDN (and W3C specs of course, but MDN is nicer to read). Angular does not depend on JQ but has its own wrapper called jQuery Lite that gives you some basic niceties. If it detects jQuery being present when it initializes however, it will use it for element wrapping instead (the jQL wrapper's api is intentionally identical to jQ proper so this is always safe).

My Rhythmic Crotch posted:

I'm not a big front-end guy so I'm probably butchering this, but the DOM selectors follow the pattern of document.getElementById("something") while JQuery's follow $("#something").method_name(). jQuery typically gives you functionality that is not present in the plain old javascript DOM methods, like .each(), .hide(), .show() etc, and you can add nifty effects with those methods.

Actually DOM also has querySelector so you can do things jQuery style if you wish. The main difference at this point is probably just how jQ can operate on lists of elements simultaneously (and the niceties you mention).


Suspicious Dish posted:

Angular does not depend on jQuery at all. Actually, you should not be using jQuery at all inside Angular: if you are, it's guaranteed you'll do things the wrong way...

Inside custom directives I think there are lots and lots of legit uses for jQuery. But only there...

Deus Rex
Mar 5, 2005

People make insane things on a lark, and then somebody decides to actually use it in production, and 6 months later other people working on the codebase want to kill themselves.

http://pgre.st/

quote:

In short, PgRest - is a JSON document store. - runing inside PostgreSql - working with existing relational data - capable of loading Node.js modules - compatible with MongoLab’s REST API - = LiveScript + Plv8 + Plv8x + Express

Zombywuf
Mar 29, 2008

I had to try and install a web app on my local machine for dev integration work. The web dev had written some clear instructions and remembered some of the dependencies. The steps I had to engage involved:
  • A whole shitload of Googling nonsensical error messages ("Package not found" means you have an older version of the interpreter apparently).
  • Download a shell script over an untrusted connection and run it.
  • Have said script gently caress with my .profile and spit out warnings telling me to change my terminal emulator.
  • apt-get install python-django*
  • Try to remember where you find the workon script that makes virtualenv usable.
  • Install two versions of ruby in order to compile css.
  • Install at least 3 different package managers.
  • Add a PPA to get the right version of one of those package managers (packception!)
  • Watch in horror as random unknown urls fly past my terminal followed by messages like "Installation successful" (as root)

It still doesn't work.


Seriously web devs, get your poo poo together and learn to write dpkgs, or at least learn what cryptographic signatures are.

salisbury shake
Dec 27, 2011

Zombywuf posted:

I had to try and install a web app on my local machine for dev integration work. The web dev had written some clear instructions and remembered some of the dependencies. The steps I had to engage involved:
  • A whole shitload of Googling nonsensical error messages ("Package not found" means you have an older version of the interpreter apparently).
  • Download a shell script over an untrusted connection and run it.
  • Have said script gently caress with my .profile and spit out warnings telling me to change my terminal emulator.
  • apt-get install python-django*
  • Try to remember where you find the workon script that makes virtualenv usable.
  • Install two versions of ruby in order to compile css.
  • Install at least 3 different package managers.
  • Add a PPA to get the right version of one of those package managers (packception!)
  • Watch in horror as random unknown urls fly past my terminal followed by messages like "Installation successful" (as root)

It still doesn't work.


Seriously web devs, get your poo poo together and learn to write dpkgs, or at least learn what cryptographic signatures are.

You should be using vagrant for working on stuff locally, even though you shouldn't have to. It won't solve all your problems, but having a clean slate + virtualenvwrapper + a system you can trash without (too much) worry might help you come to terms with it and accept that Stockholm syndrome is helping me more than it hurts.

Zombywuf
Mar 29, 2008

salisbury shake posted:

You should be using vagrant for working on stuff locally, even though you shouldn't have to. It won't solve all your problems, but having a clean slate + virtualenvwrapper + a system you can trash without (too much) worry might help you come to terms with it and accept that Stockholm syndrome is helping me more than it hurts.

Yeah, I had to setup Vagrant as well.

tef
May 30, 2004

-> some l-system crap ->
My web-dev story

I've been away from front end stuff for most of the last decade, mostly writing cgi-bin scripts, or things that speak http but not html. I've inherited a ruby/rails/custom cms stack for the website, running off mongo

— Mongo is terrible. Instead of the schema being in the database, it's now both in ruby and in javascript. There is essentially two applications, one in javascript, served by another in ruby.
— Every time I go to update a single thing, I have to reinstall all my packages.
— I can't grep for poo poo, and there is no real mapping between global objects and the package that introduces them
— Every package name is a pox upon mankind. Nothing is boringly named, and everything uses funny words because 'urllib' isn't rockstar enough
— We have tests, but they're defined in a pseudo english which is then translated into code by a series of regular expressions
— If ruby is such a great language, how come everyone writes a DSL in it and then you have to define your application inside of it.

I know this isn't representative of ruby/rails/webdev but oh god what is this cruft. Startup time is slow, tests are defined through mini languages, schemas are redundantly defined elsewhere, and to top it off, we're using a 'persistentish' hash table as a backend.

Similarly, I had to merge another rails app and a php app together. (Don't ask)

—The php app has ~2 meg of dependencies, but with a cache buster, so a page load ended up taking ~800 requests for shared resources.
—Nginx doesn't like having more than one application at a url so I had to use aufs to get it to play nicely.
—Nginx will occasionally lock hard when you restart it.


I imagine for all node.js's horrors it is probably still faster to boot than rails

tef
May 30, 2004

-> some l-system crap ->
aside, I saw a talk by two people learning to use html/css/ruby to make a website, it was cool.

they prototyped it using jquery, but their mentor told them to use the vanilla.js framework instead. their dependencies went from ~7000 lines of code to about ~120.

in another project I inherited, they used middleman and sass to generate static html from markdown. the generated css was ~2000+ lines long for no good reason.

it seems webdev as it stands is sending megs of data to clients to allow the developer to write one line of code to do a thing, and then using thousands of lines of code to make it happen.

and don't get me started about the asset pipeline.

tef
May 30, 2004

-> some l-system crap ->
Web development: We've written a product, ripped out the business logic, left in the assumptions, and written 10+ domain specific languages for configuration. Please reinsert your own logic atop, built on fast moving libraries, and hope that when it breaks there is a stackoverflow answer waiting. Let's rewrite half the browser inside of javascript, send it down the wire, and use json over websockets to fetch content, and use localstorage to cache it.

For what is ultimately a skin around a database.

First we spent our time trying to rewrite desktop applications in the webbrowser, with modal dialogues, and sites which would break if you opened up a new tab. Then we spent our time writing native applications which are just a custom web browser, and now we're trying to send a browser over the wire to be rendered using javascript, to build a website. It's not that webdev is a crock of poo poo, it's just that we don't make websites any more.

tef fucked around with this message at 14:40 on Dec 2, 2013

tef
May 30, 2004

-> some l-system crap ->
I think my favourite thing now is waiting for webfonts to load and looking at a blank page, hoping the two paragraphs of text will render after the four megs of dependencies load.

Zombywuf
Mar 29, 2008

Obligatory link to http://motherfuckingwebsite.com/

tef
May 30, 2004

-> some l-system crap ->

Pollyanna posted:

Reminder that Java still exists and therefore embedded/compiled programmers don't get to disparage other languages.

Reminder: If you spent more time writing terrible code than terrible posts, you might have actually learned something about programming. Don't let your naïvety hold you back from having an uninformed opinion though.

hmm yes
Dec 2, 2000
College Slice

tef posted:

We have tests, but they're defined in a pseudo english which is then translated into code by a series of regular expressions

This sounds like Cucumber. Such an awesome looking idea but such a terrible experience once you use it.

Rails lets developers go absolutely crazy with how they put their applications together, which was a big feature they pushed on the 2.x->3.x rewrite. I think it is bad. Things should be done 'the Rails way' and if you start breaking out crazy poo poo like mongo and angular.js and 1 page apps then you're using the wrong tool. CRUD app with some business logic behind it where speed doesn't matter too much? Rails is still great for that, and its OK to keep it only great at that.

tef posted:

in another project I inherited, they used middleman and sass to generate static html from markdown. the generated css was ~2000+ lines long for no good reason.

middleman/sass has nothing to do with producing that css but I understand your frustration

VVVVVV I guess I'm saying that a bad developer causes code like that, not the tool. It would be nice if Sass had some log output during a build/watch when deeply nested selectors are found and tell the user not to code like that.

hmm yes fucked around with this message at 17:07 on Dec 2, 2013

Deus Rex
Mar 5, 2005

atastypie posted:

middleman/sass has nothing to do with producing that css but I understand your frustration

a lot of people tend to write sass (or less or scss) in a style that produces verbose CSS that's also tightly coupled to markup structure. for example:

CSS code:
/* actually SCSS */
#someid {
  .someclass {
    form {
      .wow {
        .so-deep {
          color: red;
        }
      }
    }
  }
}
produces a selector like #someid .someclass form .wow .so-deep. Repeat this for a bunch of other SCSS selectors written at the same level as .so-deep and the problem is obvious. SASS/SCSS/LESS users tend to think that the nesting semantics they get in the language come for free.

edit: I inherited a SCSS codebase like this once, but with the child selector > used instead of the general descendent. Making even trivial changes to the markup was the worst thing ever.

Deus Rex fucked around with this message at 17:05 on Dec 2, 2013

jony neuemonic
Nov 13, 2009

Yeah, people are gung-ho to work in one language and compile to another. SCSS makes sense because CSS is terrible, most of the others seem pretty yak-shavey.

Deus Rex posted:

SASS/SCSS/LESS users tend to think that the nesting semantics they get in the language come for free.

I don't doubt that happens, but if someone writes SCSS or LESS that poorly they probably wouldn't write CSS any better.

jony neuemonic fucked around with this message at 17:05 on Dec 2, 2013

Deus Rex
Mar 5, 2005

fidel sarcastro posted:

I don't doubt that happens, but if someone writes SCSS or LESS that poorly they probably wouldn't write CSS any better.

I disagree. In CSS it isn't nearly as convenient to write selectors nested that deeply, so people will choose to not do it.

atastypie posted:

VVVVVV I guess I'm saying that a bad developer causes code like that, not the tool. It would be nice if Sass had some log output during a build/watch when deeply nested selectors are found and tell the user not to code like that.

There are sass/scss linters I think. The problem is that a linter doesn't really help that much when inheriting an existing codebase. It's also very hard to refactor SCSS like the example I gave, partly because automated regression testing of CSS is a hard problem that practically nobody seems interested in solving.

Deus Rex fucked around with this message at 17:12 on Dec 2, 2013

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
SASS (and all of the other CSS preprocessors) makes it so easy to generate an absolutely absurd amount of CSS that I think everyone who writes more than a trivial amount of it runs into issues with that at least once. The problem is that sometimes you actually do need absurd amounts of CSS, because CSS is sort of bad.

jony neuemonic
Nov 13, 2009

Deus Rex posted:

I disagree. In CSS it isn't nearly as convenient to write selectors nested that deeply, so people will choose to not do it.

Sure, but if they're only following that best practice because it's hard to get around it (and not because, you know, best practice) then they're almost certainly breaking others.

Zombywuf
Mar 29, 2008

So I'm trying to get clear on this, HTML should be written in Javascript. CSS should be written in a Ruby DSL. Javascript should be written in anything but Javascript. I should manage my package dependencies using Node.js, distribution using Bash and make build scripts in Python. Server side code should be a bunch of static files served up by a Django app and the Database should be programmed in Javascript. Is this webdev current best practice?

abraham linksys
Sep 6, 2010

:darksouls:

Zombywuf posted:

So I'm trying to get clear on this, HTML should be written in Javascript. CSS should be written in a Ruby DSL. Javascript should be written in anything but Javascript. I should manage my package dependencies using Node.js, distribution using Bash and make build scripts in Python. Server side code should be a bunch of static files served up by a Django app and the Database should be programmed in Javascript. Is this webdev current best practice?

Nah, web dev is a totally mixed bag. There is no standard web dev stack; it'd be like saying you need to do all desktop development with C# and XAML or whatever.

Sometimes your HTML should be rendered by the server. Sometimes it should be statically precompiled. Sometimes it should be rendered in JavaScript from client-side templates. Sometimes CSS is fine, sometimes you want LESS or SASS to give you more structure; JS is really always fine, but sometimes you might want to try something like CoffeeScript, TypeScript, or ClojureScript depending on what the developers like. Your backend is whatever you want; use Postgres in like 99% of cases.

jony neuemonic
Nov 13, 2009

Zombywuf posted:

Server side code should be a bunch of static files served up by a Django app

This part is 100% correct.

dexter
Jun 24, 2003

tef posted:


and don't get me started about the asset pipeline.

What's wrong with the asset pipeline? It solves a lot of problems that normally aren't worth managing independently.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Zombywuf posted:

So I'm trying to get clear on this, HTML should be written in Javascript. CSS should be written in a Ruby DSL. Javascript should be written in anything but Javascript. I should manage my package dependencies using Node.js, distribution using Bash and make build scripts in Python. Server side code should be a bunch of static files served up by a Django app and the Database should be programmed in Javascript. Is this webdev current best practice?

literally the only zombywuf post I've ever laughed at

Zombywuf
Mar 29, 2008

rotor posted:

literally the only zombywuf post I've ever laughed at

I was crying when I wrote it.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Zombywuf posted:

I was crying when I wrote it.

that's why it's funny

MononcQc
May 29, 2007

Zombywuf posted:

So I'm trying to get clear on this, HTML should be written in Javascript. CSS should be written in a Ruby DSL. Javascript should be written in anything but Javascript. I should manage my package dependencies using Node.js, distribution using Bash and make build scripts in Python. Server side code should be a bunch of static files served up by a Django app and the Database should be programmed in Javascript. Is this webdev current best practice?

hn.txt in a paragraph

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

salisbury shake posted:

You should be using vagrant for working on stuff locally, even though you shouldn't have to. It won't solve all your problems, but having a clean slate + virtualenvwrapper + a system you can trash without (too much) worry might help you come to terms with it and accept that Stockholm syndrome is helping me more than it hurts.

I'm starting to think the VM approach is not actually avoidable for web services or apps. Well it is but it would require a change of heart that spans the whole distribution ecosystem, so don't hold your breath for that. The major problems are (among others):

  • different services are built on different major version of the same dependency
  • sometimes the system itself needs a specific dependency as well (e.g. python)
  • too many dependencies put incompatible changes into minor versions (gently caress anyone that does this)

So we have virtualenvs and burning major versions into packages (python25 vs python27 etc). In a perfect world people would just keep their poo poo up to date and everything would always run against the latest version of everything, and every distribution would actually publish those latest versions in a prompt and reliable manner. Of course in that world we wouldn't need computers as we would all be too busy being fed bon-bons by the magic elf people.

FamDav
Mar 29, 2008

Mr. Wynand posted:

So we have virtualenvs and burning major versions into packages (python25 vs python27 etc). In a perfect world people would just keep their poo poo up to date and everything would always run against the latest version of everything, and every distribution would actually publish those latest versions in a prompt and reliable manner. Of course in that world we wouldn't need computers as we would all be too busy being fed bon-bons by the magic elf people.

In your perfect world* nothing would ever be deployed because we would all be too busy updating our dependencies.

Maybe if there was a real build system that did the big boy stuff and an equivalent deployment system web dev wouldn't be so bad.

*In my perfect world people wouldn't write "packages" which pulled code from arbitrary urls.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
writing web apps in the traditional, same (and sane imo) manner in which we used to write regular apps is 100% possible and doable and not even really that hard but boy is it ever not fashionable

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

FamDav posted:

In your perfect world* nothing would ever be deployed because we would all be too busy updating our dependencies.

Maybe if there was a real build system that did the big boy stuff and an equivalent deployment system web dev wouldn't be so bad.

*In my perfect world people wouldn't write "packages" which pulled code from arbitrary urls.

What like the build system updates everything from under you and runs test that bury the project owner in alerts if they fail until they fix it?

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

rotor posted:

writing web apps in the traditional, same (and sane imo) manner in which we used to write regular apps is 100% possible and doable and not even really that hard but boy is it ever not fashionable

Well do elaborate. I am genuinely curious.

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Writing CGI scripts in Perl is good enough for the majority of sites out there.

Perl has a good package manager.

  • Locked thread