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
pepito sanchez
Apr 3, 2004
I'm not mexican

So may I ask a stupid question? For server-side, and as someone who's learned very little Python: What's the difference between using Django with a RESTful API in mind, and a fully JS app? Apart from the obvious. Both are interpreted languages, and JS has the ability to inject dependency (specially going to be true in JS when ECMA6 is finalized), making them in a way similar in my view, except Python *can* be compiled, and except for the whole callbacks/prototyping fucktruck you can't get around. That's JS. Django really handles performance issues that much better? I'll have to read up more on the whole I/O blocking point for node. I ask humbly, not knowing a poo poo about Python and barely now getting the grasp on JS in the backend.

I'd also like feedback from you/others on recommendations. Would you recommend someone learn Spring instead for server-side code? Or something else? I'd prefer something Java-based, just because it's one of the big focuses for this school semester. I guess you really hate JS, but I like Angular. At my current job I only work front-end, and I work it a lot, so for personal projects I just need a good, small, simple, and maintainable backend. I don't even care what kind of database it uses as long as it's secure. Obviously for small projects I could just use anything, but I like imagining everything might become something huge.

Adbot
ADBOT LOVES YOU

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

pepito sanchez posted:

So may I ask a stupid question? For server-side, and as someone who's learned very little Python: What's the difference between using Django with a RESTful API in mind, and a fully JS app? Apart from the obvious. Both are interpreted languages, and JS has the ability to inject dependency (specially going to be true in JS when ECMA6 is finalized), making them in a way similar in my view, except Python *can* be compiled, and except for the whole callbacks/prototyping fucktruck you can't get around. That's JS. Django really handles performance issues that much better? I'll have to read up more on the whole I/O blocking point for node. I ask humbly, not knowing a poo poo about Python and barely now getting the grasp on JS in the backend.

I'd also like feedback from you/others on recommendations. Would you recommend someone learn Spring instead for server-side code? Or something else? I'd prefer something Java-based, just because it's one of the big focuses for this school semester. I guess you really hate JS, but I like Angular. At my current job I only work front-end, and I work it a lot, so for personal projects I just need a good, small, simple, and maintainable backend. I don't even care what kind of database it uses as long as it's secure. Obviously for small projects I could just use anything, but I like imagining everything might become something huge.

Nobody was saying Django or Ruby on Rails are good ideas either! They really aren't! And Angular is really, really loving stupid even by web dev standards. Most commercial web developers couldn't find their own asses with two hands and a map.

Thermopyle
Jul 1, 2003

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

pepito sanchez posted:

So may I ask a stupid question? For server-side, and as someone who's learned very little Python: What's the difference between using Django with a RESTful API in mind, and a fully JS app? Apart from the obvious. Both are interpreted languages, and JS has the ability to inject dependency (specially going to be true in JS when ECMA6 is finalized), making them in a way similar in my view, except Python *can* be compiled, and except for the whole callbacks/prototyping fucktruck you can't get around. That's JS. Django really handles performance issues that much better? I'll have to read up more on the whole I/O blocking point for node. I ask humbly, not knowing a poo poo about Python and barely now getting the grasp on JS in the backend.

I'd also like feedback from you/others on recommendations. Would you recommend someone learn Spring instead for server-side code? Or something else? I'd prefer something Java-based, just because it's one of the big focuses for this school semester. I guess you really hate JS, but I like Angular. At my current job I only work front-end, and I work it a lot, so for personal projects I just need a good, small, simple, and maintainable backend. I don't even care what kind of database it uses as long as it's secure. Obviously for small projects I could just use anything, but I like imagining everything might become something huge.

For one thing, many people would argue that there's not much difference between Python and JS because neither have static typing and thus both are bad for large scale, long term projects.

From a usage standpoint there are a lot of similarities between Python and JS. Python+Django isn't a performance beast either.

However, some arguments someone might make for why Python is better than node:

  • Python has threading/multiprocessing.
  • Python is better suited to avoiding the callback hell of JS/Node.
  • The norm in Python land is for libraries and the standard library to be well-tested and used in the wild for a long time.
  • If you follow the "modern web development" thread you'll see examples of the shitshow that node libraries are. Dependency management, stable APIs, blah blah blah are wishful thinking.

pepito sanchez
Apr 3, 2004
I'm not mexican
Okay so Django is another no. Thanks for the replies. I still think Python is a pretty cool language, just for small projects. I'm just slowly making a game on the side with it, and it's a joy to play with, really like a toy language where you can see the structure of a real language play out in simplified pseudo-code (almost).

Suspicious Dish
Sep 24, 2011

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

Thermopyle posted:

  • Python has threading/multiprocessing.
  • Python is better suited to avoiding the callback hell of JS/Node.
  • The norm in Python land is for libraries and the standard library to be well-tested and used in the wild for a long time.

None of these things are true.

Volguus
Mar 3, 2009

pepito sanchez posted:

Okay so Django is another no. Thanks for the replies. I still think Python is a pretty cool language, just for small projects. I'm just slowly making a game on the side with it, and it's a joy to play with, really like a toy language where you can see the structure of a real language play out in simplified pseudo-code (almost).

Python is great for prototyping. Other than that is just abuse.

gbaby
Feb 6, 2015
all web dev languages suck

piratepilates
Mar 28, 2004

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



gbaby posted:

all web dev languages suck

the world is just a terrible place

edit: C# is pretty alright aside from that whole Windows thing though

pepito sanchez
Apr 3, 2004
I'm not mexican

gbaby posted:

all web dev languages suck

if there's anything you could gather from all of these threads put together it's this. there is no good option. maybe php and i refuse to learn php out of pure spite.

Thermopyle
Jul 1, 2003

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

Suspicious Dish posted:

None of these things are true.
Hah!

I knew exactly who would post this.

Suspicious Dish
Sep 24, 2011

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

Thermopyle posted:

Hah!

I knew exactly who would post this.

I'm happy my posting is so recognizable.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

pepito sanchez posted:

if there's anything you could gather from all of these threads put together it's this. there is no good option. maybe php and i refuse to learn php out of pure spite.

Just learn C#/ASP.NET MVC if you can tolerate Microsoft and IIS, or Java/Spring MVC if you don't like Microsoft, and just learn how to do javascript front end without relying on monolithic javascript "frameworks" that suck rear end.

Thermopyle
Jul 1, 2003

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

Anyway, yes, I agree they're not exactly true which is why I don't claim them. They're just the standard arguments in python vs node arguments.

ExcessBLarg!
Sep 1, 2001

pepito sanchez posted:

What's the difference between using Django with a RESTful API in mind, and a fully JS app? Apart from the obvious.
Don't discount the obvious. Python is a mature server-side language with fantastic libraries and great community support. Comparing the perfect (well, bug free) Python-based implementation with the perfect node one, it's probably a wash. The problem is obtaining "bug free" with node, especially, with third party libraries. And then maintaining it.

pepito sanchez posted:

Would you recommend someone learn Spring instead for server-side code?
Java is the opposite end of the spectrum. It's quite ceremonial and, at times, heavy-weight. It's not necessarily a terrible thing with large projects (in terms of code or number of contributors), but it can still feel like being too much for a prototype where the advantages of being statically typed doesn't have as much immediate benefit. It's worth looking at though, just to see what's going on there. I'd start by looking at the JAX-RS/Jersey tutorials.

pepito sanchez posted:

I don't even care what kind of database it uses as long as it's secure.
The vast majority of web apps get by absolutely fine doing CRUD with relational databases. There's a reason the relational model has been around for so long, it works really well for data that most folks deal with. As a bonus, it helps that everyone is familiar with SQL and relational databases, and there's plenty of resources on how to manage them should your application grow large enough that you actively have to start thinking about managing a database.

NoSQL databases may have their place in providing solutions to specific problems. But I wouldn't use Mongo "by default", but only when you have data sets that really don't mesh well with the relational model.

pepito sanchez posted:

Obviously for small projects I could just use anything, but I like imagining everything might become something huge.
You're far more likely to be stuck maintaining something of moderate popularity for a long time, than you are maintaining something of immense popularity for a small amount of time. There's no perfect solution, but generally consider when building a system what technologies will enable it to be maintained at reasonable cost for a period of 5-10 years.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
WebSharper and Yesod are the only two unmistakably Good™ web frameworks. The only problem is that roughly no one uses them, so they don't have all that much support.

aBagorn
Aug 26, 2004

piratepilates posted:

the world is just a terrible place

edit: C# is pretty alright aside from that whole Windows thing though

Who needs windows anymore?! .NET is open source and portable now, baby.

That being said, I have a "take home project" for an interview, and I'm probably going to write it in Node, because it's a tiny prototype and I can bootstrap it in an hour, tops

let i hug
Dec 25, 2011

I don't understand why everyone ITT is insisting that all web apps be written in statically typed languages from the start. My experience is that if you're starting from scratch on something you're not going to understand your end product/the business domain well enough to build anything that you won't want to totally replace after you start gaining momentum. If you know you're going to want to start over again when your app hits ~40k lines of code, why would you spend that time writing in verbose, clunky languages? Better just to code it Ruby/Python/even Node, get it out the door, and then when it starts to get too big on you, just move to microservices in Java/.NET/whatever.

Of course, I'm also a person who doesn't understand people who only ever code in one language and I find writing code to be really easy if you already know exactly what functionality you're implementing. I know a lot of people are afraid of rewrites. But at the same time, coding a system you see being used in "5-10 years" is sort of crazy to me when you're talking about application code. You're not building a matrix manipulation library based on 200 year old math here.

Steve French
Sep 8, 2003

I think there are far more companies running rails/django stacks that are over 5 years old than you think there are. I work at one such company.

In theory rewriting is a great idea. Maybe. In practice, it rarely happens before the codebase gets huge and unwieldy and incredibly difficult to rewrite because guess what, the threshold for "ok time to rewrite because our rapidly developed product has taken off" occurs during rapid growth and gently caress you don't have time to stop everything and rewrite it all

sarehu
Apr 20, 2007

(call/cc call/cc)

let i hug posted:

If you know you're going to want to start over again when your app hits ~40k lines of code, why would you spend that time writing in verbose, clunky languages?

C# or Scala aren't verbose or clunky.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.

let i hug posted:

coding a system you see being used in "5-10 years" is sort of crazy to me when you're talking about application code.

I'm not sure I follow here. Is a large percentage of software that you use younger than 5 years?

Doh004
Apr 22, 2007

Mmmmm Donuts...

let i hug posted:

I don't understand why everyone ITT is insisting that all web apps be written in statically typed languages from the start. My experience is that if you're starting from scratch on something you're not going to understand your end product/the business domain well enough to build anything that you won't want to totally replace after you start gaining momentum. If you know you're going to want to start over again when your app hits ~40k lines of code, why would you spend that time writing in verbose, clunky languages? Better just to code it Ruby/Python/even Node, get it out the door, and then when it starts to get too big on you, just move to microservices in Java/.NET/whatever.

Of course, I'm also a person who doesn't understand people who only ever code in one language and I find writing code to be really easy if you already know exactly what functionality you're implementing. I know a lot of people are afraid of rewrites. But at the same time, coding a system you see being used in "5-10 years" is sort of crazy to me when you're talking about application code. You're not building a matrix manipulation library based on 200 year old math here.

A bad post.

qntm
Jun 17, 2009
Unfortunately, just because it's a good idea to throw away the first version/prototype doesn't mean that that ever happens in reality.

feedmegin
Jul 30, 2008

qntm posted:

Unfortunately, just because it's a good idea to throw away the first version/prototype doesn't mean that that ever happens in reality.

And when it does it turns out to be far more of a pain in the arse than you thought it would be initially. Rewriting a nontrivial code base from scratch to do exactly what it did originally is hard.

let i hug
Dec 25, 2011

Steve French posted:

I think there are far more companies running rails/django stacks that are over 5 years old than you think there are. I work at one such company.

In theory rewriting is a great idea. Maybe. In practice, it rarely happens before the codebase gets huge and unwieldy and incredibly difficult to rewrite because guess what, the threshold for "ok time to rewrite because our rapidly developed product has taken off" occurs during rapid growth and gently caress you don't have time to stop everything and rewrite it all

Newf posted:

I'm not sure I follow here. Is a large percentage of software that you use younger than 5 years?

qntm posted:

Unfortunately, just because it's a good idea to throw away the first version/prototype doesn't mean that that ever happens in reality.

Okay, first off I should acknowledge that I work at a large tech company and we have more flexibility than most and have the benefit of some very experienced people who are good with designing system architectures. I know that puts my experiences far from the norm, and I might be out of touch here.

That said, the best part of web development in the past few years as I see it is an increased use of distributed architectures that are a lot easier to transition into/make changes to than traditional more monolithic applications. The senior guys at my company are really good at mapping these sorts of things out, and once you have all your application seams identified it's easy to peel off bits of functionality and serve it as a REST API or w/e. When it's done well it's not a whole lot different than how you would normally iterate through a product's development, because you just look at the worst performing part of your code, split it off, rewrite it in a more optimal way, and plug it into the system.

In this context, you really can just (gradually) throw away that 1.0 and worry about optimization when you know more about what's going on. It also sets you up to take advantage of cloud environments, etc etc.

This obviously doesn't work if you're making desktop applications/embedded software, but with the web you really get to leverage your control over the whole server ecosystem. I mean, Facebook started out in PHP, and they figured their way out of that mess somehow.

triple sulk
Sep 17, 2014



Steve French posted:

I think there are far more companies running rails/django stacks that are over 5 years old than you think there are. I work at one such company.

Working on legacy Rails apps is the loving worst

piratepilates
Mar 28, 2004

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



let i hug posted:


This obviously doesn't work if you're making desktop applications/embedded software, but with the web you really get to leverage your control over the whole server ecosystem. I mean, Facebook started out in PHP, and they figured their way out of that mess somehow.

They figured their way out of that mess by contiuing to use PHP, and then when massive performance problems popped up they started teams to come up with different ways of making their existing PHP codebase faster, such as HHVM (new runtime for PHP), and HipHop (a transpiler that just translates PHP to C++), and Hack (a new dialect of PHP that they've just started using instead of rewriting their codebase).

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah. Facebook is basically the case in point for digging in on a technology no matter what.

piratepilates
Mar 28, 2004

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



I'm not really sure how much of a help it is to start off with something like Node.js and planning to rewrite it -- unless your long term goal is to be using some messy IBM framework that no one knows how to use then is it really that much more convenient to use Express.js for the first year instead of starting off with Dropwizard or that slim version of Spring?

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

triple sulk posted:

Working on legacy programs is the loving worst

xtal
Jan 9, 2011

by Fluffdaddy
Rails apps are particularly bad because (a) dynamic typing (b) pretty much everything changes between each version (c) you are obligated to do this several times a year to get security updates.

Web development is a clusterfuck generally speaking, but Ruby and Node are about equally as horrific. Switching my team to the JVM made work tolerable again.

Gul Banana
Nov 28, 2003

let i hug posted:

I don't understand why everyone ITT is insisting that all web apps be written in statically typed languages from the start. My experience is that if you're starting from scratch on something you're not going to understand your end product/the business domain well enough to build anything that you won't want to totally replace after you start gaining momentum. If you know you're going to want to start over again when your app hits ~40k lines of code, why would you spend that time writing in verbose, clunky languages? Better just to code it Ruby/Python/even Node, get it out the door, and then when it starts to get too big on you, just move to microservices in Java/.NET/whatever.

Of course, I'm also a person who doesn't understand people who only ever code in one language and I find writing code to be really easy if you already know exactly what functionality you're implementing. I know a lot of people are afraid of rewrites. But at the same time, coding a system you see being used in "5-10 years" is sort of crazy to me when you're talking about application code. You're not building a matrix manipulation library based on 200 year old math here.

in the line of business industry, which is pretty huge, the expectation is that some company or organisation pays to have a project delivered; there's an implementation phase, they pay a bunch of money, then it's done. then they want to keep *using* the system for as long as possible. sometimes there's a followup support contract or internal support devs; in either case these are like, part time people with little experience in the system, who have to touch it once every 18 months and want change to be as easy and reliable as possible.

if an IT system can serve its business purpose for 5-10 years, why not build it that way?

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
Geez, I was exploring trying something other than C#/.NET for server side, and this thread has scared me away from that entirely.

Cryolite
Oct 2, 2006
sodium aluminum fluoride
Java :toot:

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Uziel posted:

Geez, I was exploring trying something other than C#/.NET for server side, and this thread has scared me away from that entirely.

It's not really a bad thing to set these technologies up on your own and learn whats up. And node has its uses in like one-off/internal projects, it's just that you're committing malpractice by deliberately choosing to use this poo poo in production environments.

piratepilates
Mar 28, 2004

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



I'll tell you what though -- TypeScript is quite nice, if you're gonna use JavaScript extensively then you should probably be using it.

Jo
Jan 24, 2005

:allears:
Soiled Meat
I work in a company more than seven years old. Our backend is Python, Django, and Postgres. I completely agree that the lack of static typing is the one thing that hurts most in Python. We're at ~125k lines and refactoring loving sucks. That said, the biggest heart aches come from the UI, which is Angular and not developed by my team. We got bitten by a dependency freeze problem in a production deploy. Bower (or whatever the gently caress they use) had specified an approximate package, so testing went through staging and QA fine, but broke in prod because the package got updated. It also was still broken on the roll back, which was a pants-shittingly good time for everyone.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah ugh. Shrink wrap your dependencies and release as a .tar.gz otherwise you can face that pain so easy. Semantic versioning is good in theory but so many libraries don't respect it. (lol at the underscore library authors reaction to being called out on breaking semver)

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Even with semantic versioning, you should be releasing to prod the exact same configuration you QAd. Even for a patch release of a library, your app could have been inadvertently relying on a bug that the patch fixes, and now you're suddenly broken in production. Semantic versioning just tells you what you can expect to upgrade as a matter of course when you start your next release cycle, vs. what you're going to have to budget time in the schedule to upgrade to.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah, QA and Prod should be subject to the exact same configuration management, and deployment should be build once, deploy twice, with all packages pulled down into the build. That way the build artifact (whatever it is) can be rolled back to with absolutely zero dramas.

Adbot
ADBOT LOVES YOU

Monkey Fury
Jul 10, 2001

Uziel posted:

Geez, I was exploring trying something other than C#/.NET for server side, and this thread has scared me away from that entirely.

Scala + Spray :getin:

  • Locked thread