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
Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Winter is Cuming posted:

Tutsplus is an invaluable resource that I wholeheartedly recommend. It has so many great tutorials.

http://net.tutsplus.com/tutorials/php/aspect-oriented-programming-in-php/

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

abraham linksys posted:

Check out the source here for an example.

Huh??

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Kobayashi posted:

Not really sure how to Google for this, but for modern Javascript, what kind of style recommendations are there for quotes vs. double quotes? Sometimes people seem to use double quotes extensively. Others use single quotes. I cut my teeth on C-like languages and Perl, so by habit I tend to only use double quotes for interpolation or escaped characters, but I wondered if modern JS has other conventions?

I worked on a project long ago that used double quotes for user-visible text and single-quotes for internal strings, like identifiers, so that's what I do now. I acknowledge it's a weird personal rule and I don't really give a poo poo if people submit code to my projects that break the style.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Pollyanna posted:

We should put that in the title.

I'm amazed at all the different choices for MV* frameworks on Javascript. What the hell do I choose :gonk: we're interested in teaching our clients Ember for our upcoming class, but I dunno if I like it - too opinionated. I personally like more freeform/simple and obvious frameworks like Knockout and React (although I dunno if React is actually MV* instead of just V). I'm thinking my next project will be a for-real single page app with no reloading, RESTful CRUD, and cutesy little UX widgets so I can get right into a good MVC framework. Problem is which one to choose :v: so I'm starting with just reviewing how JS implements MVC/MVVM in general. That's what made Python/Ruby frameworks make sense to me, after all. Maybe we should also cover a little bit of how MVC works in here, too.

who gives a poo poo

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
there are people like you. they spend more time debating the correct design of their software with themself than actually sitting down and writing the drat software. they are not people i like to work with.

just write your drat software.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

My mind keeps on trying to fuse this with both "moses supposes" and "developers developers" and it's getting very confused.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
We got an Angular site shipped from some external contractor. I've been trying to hack on it to add simple functionality and it's the most insane thing I've ever done.

Angular is an incomprehensible mess and I can't figure out how to do anything in it.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
React seems very similar to how I would design my own system, which is a system composed of a tree of widgets that "render" to DOM. Angular seems to be all about data binding of strings to a premade DOM, which is impossible to do anything semi-complex with.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The page they gave us is less than 100 lines of code. It's not bad all things considered.

I just spent two hours in the Angular IRC channel and the guy there convinced me that what I'm building isn't what I should build, it can't be built in Angular, and that data binding is better and I should use it instead.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
needs the part where they announce angular 2.0 and the graph goes negative

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
That's not how that works.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It's finally deployed: https://endlessm.com/

Source code at https://endlessm.com/landing-page/build/js/timer.js

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

should be fixed now.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
one of our sysadmins hosed up the dns, it's fixed but might take time to propagate.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I really don't understand the new web build process stuff. How do I build a .html file that references my fancy new modules with something like webpack? I'm in the guts of file loaders and html webpack plugins and I really don't understand any of it.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
ok. since you can have a css loader i figured there would be some concept to inject the built css into the html but i guess not.

i am also toying around with something else. for super neat dumb reasons at work it would be nice if i had this app as a single .html file so i was wondering if it's possible to inline all the scripts and styles right into this sucker.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I don't understand why having an .html app bundle is a bad idea, to be quite honest.

The reason is because I need to be able to upload this "app" as an attachment to another service. It's an internal tool, and we don't have an intranet to deploy it on yet. It's complicated.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

ModeSix posted:

Jesus just looking at his post history in this thread, it's almost like he's trying to troll us.

What about my posting history is bad? I said Angular is bad and React is good, which seems to be the generally agreed upon Correct Opinion these days.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

abraham linksys posted:

ember doesn't have any one big company behind it but still has plenty of small shops and mid-sized mature companies using it, idk (twitch, digitalocean just moved back to ember after trying react for a while, etc)

i can't find anything about twitch trying react at all. in fact, the only mention of react is a job posting suggesting they do use react:

https://jobs.lever.co/twitch/888a6a8b-3cff-4c90-b490-33852910713e

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The problems with <div onclick="buttzone()"> was the lack of proper namespacing / scoping, since everything needed to be global. React fixes that by allowing you to bind to functions by reference rather than evaluated strings. I don't know why people switched to elem.addEventListener('click', buttzone); instead of doing elem.onclick = buttzone; when the latter is much simpler and less confusing with multiple handlers and such.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Pollyanna posted:

What's the point at which you should start using a framework? Our big ol' dynamic HTML table/Excel spreadsheet replacement/inline form editing Frankenstein has an issue with hiding/resetting forms via a cancel button and after fiddling around with jQuery spaghetti and completely disorganized, inline source code, I'm frustrated enough to want to convert the whole thing to a React component instead of Rails form helpers and wash my hands of the whole thing. Front-end poo poo has been a recurring issue for us and absolutely none of it makes sense. :gonk: The lack of a framework is making things just totally stupid.

try refactoring it before rewriting it to the latest hotness

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
the best part is him trying to count lines

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
OK. I have a problem.

I write a bunch of cool web toys. I want to try out using TypeScript on one of them, because I keep making dumb type errors. My preferred workflow: in Visual Studio Code or Atom, have TypeScript. If I press F5 on the right in my browser, I should get JavaScript that is up to date.

I do not care if I use Gulp, Grunt, Broccoli, or Webpack. You pick the tech stack and tell me how to set it up. I just want TypeScript automatically compiled when I change something. Maybe some nice debug integration.

Go.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Thanks guys! I eventually figured out how to use VS Code's builtin tasks to do it for me. Now I have a simple thing ported to TypeScript, and, wow, I am loving loving this language.

https://magcius.github.io/NITRO_BMD/
https://github.com/magcius/NITRO_BMD

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

prom candy posted:

Handcrafted code is overhead, I imagine you'd be in a much worse position if he hadn't used all these dependencies.

i would rather work with a codebase written by people that know how to write left-pad by hand than people that include it as a dependency

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Lumpy posted:

Yarn is just a thing that sits on top of npm though, right? So you can still have that npm bug using Yarn if yarn installs that npm as part of *it's* install??

npm is two parts: a website full of tar files, and a client that downloads and extracts the tar files.

yarn replaces the second thing without replacing the first thing. so no, yarn will not have that bug.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Also know when to roll your own rather than hacking around a library that isn't doing what you want. I'm in the process of ditching gl-matrix in my own app because of how... *checks paper* not good it is.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
as usual, arguing about programming metaphilosophy ends up going in circles with no new knowledge gained

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Mr Shiny Pants posted:

I don't know if this works. I thought it was fun to think about. :)

1,4 MB is not that big anyway.

The modern web, ladies and gentlemen.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
all frameworks suck and youre never gonna be happy with your decision death waits for us all hth

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
typescript is cool but just write all your own UI code from scratch and don't use one of these stupid frameworks

also npm / parcel / webpack and the whole node ecosystem are loving trash and barely work

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
wasm doesn't do what you think it does and will only make things worse hth

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
typescript is probably the only piece of anything in this stupid ecosystem that actually works

i've spent more time just yesterday fighting with webpack and parcel than i've ever spent fighting typescript.

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