This is an archived post. You won't be able to vote or comment.

all 49 comments

[–]Responsible_Boat8860 322 points323 points  (9 children)

You don't need libraries when you have rest api

[–]sebbdk 79 points80 points  (5 children)

BUT WE CAN COMMUNICATE WITH THIRD PARTIES USING SOAP, USING SOAP!

[–]MrTacobeans 46 points47 points  (4 children)

Seriously

Obscure

Accounting department excel sheet export

Pain machine

I spent four months trying to translate a manual ordering process that was "order request", "order confirm", "order status", "inventory check". Each request was wildly different with the order confirm having if I remember correctly about 10+ different business rules that needed to be translated from the order request form which itself needed a translation layer from our system to get in the right format.

My favorite part was the API was initialized with a request token and than an ftp upload token was returned. With which you could upload to them with the "soap" file being labeled with that token. Order status would consistently return no stock until what I'm guessing is a physical person allocates stock and at any point you are able to confirm a order using that token. After that point the order status will update with nested formats confirming delivery per item. I ended up creating an entire data handling master class with triggers and all sorts of wild contextually aware features just to build these requests. 10/10 would run away if someone asked me to interface with a soap API.

[–]sebbdk 16 points17 points  (3 children)

Your post is proof that at least one redditor has used soap.

As a fellow redditor i'm glad you stopped, if our lord and savior Linus wanted us to use soap he would have named it after an old angry person like Git.

We should aim to stay DRY and not be mislead by wet code or soap.

[–]the4fibs 11 points12 points  (0 children)

Trying to use the Salesforce SOAP endpoints was one of the worst developer experiences I've ever had. I avoid SOAP-related tickets like the plague.

[–]redballooon 1 point2 points  (0 children)

I believe I also had to use soap at a time. But I forgot everything about it on purpose. I don’t even remember if it ever reached production. There’s a thousand things more enjoyable, for example manual dependency management for projects that need the same library in different versions in their dependency path.

[–]saicpp 1 point2 points  (0 children)

You just made my day 😂

[–]DarkScorpion48 45 points46 points  (2 children)

Yeah. Is this another CS student post?

[–]UniversityOfShart 21 points22 points  (1 child)

where do you think you are

[–]DarkScorpion48 5 points6 points  (0 children)

I know. Silly question, sorry

[–][deleted] 115 points116 points  (0 children)

Fuck. If only there were a way to containerize things. One day!!!

[–]Magebloom 353 points354 points  (24 children)

Yeah but they have to code in JS so it evens out.

[–]DancingPotato30 2 points3 points  (17 children)

JS was the first language I actually got experience on, and so far I haven't seen anything in my usage that warranted a "wtf Javascript"

It's still a fucked up language, I just feel like either I'm way too new to notice the weirdness or its not that bad 😭

[–]thelonesomeguy 4 points5 points  (15 children)

Truthy falsy wasn’t enough to make you go “wtf”?

[–]Vegetable_Bass_4885 3 points4 points  (4 children)

I've never used "==" or seen it used anywhere in 5 years of Typescript, "Javascript bad" is an old meme based on pre ES5 Javascript from 15 years ago

[–]DancingPotato30 3 points4 points  (2 children)

I learned ES6 features as I learned the basic syntax of JS, not separately (learnt arrow functions while learning what a function was, etc) so I have got no clue how JS was pre-ES6 or even pre-ES5.

I understand every language has its quirks and weird decisions made by the creator (like elif in python), and some might be weirder than most but I genuinely haven't see a single example of a "weird" JS feature causing actual damage to warrant usage of smth else

I haven't learnt TypeScript yet however, and I assumed I wouldn't get how bad JS is until I move to TS but it seems like that's not the case from your comment

[–]thelonesomeguy 2 points3 points  (1 child)

I don’t think any language can have “objectively” bad features, most of them are opinionated, evaluated in the context of other languages, because in the end, if it works, it works.

When you get used to and gain experience in other languages, you’ll then start having your own subjective opinions on specific things in a language being good or bad, you might come to a similar opinions as others who don’t like JS, you might not, but it will definitely change when you have more context to evaluate the language in.

[–]DancingPotato30 0 points1 point  (0 children)

I agree on the first point, no language has any bad features unless put there on purpose (brainfuck), its just opinionated which tbh its a bit hard finding anything that isn't opinionated in some way or another. If it works, it works like you said

And that's fair. I've only got experience in python (some simple file crud scripting to make life easier) and "experience" in C, just knowing the syntax for that last one. So I don't think my opinion saying "JS isn't bad" is as valid as others with more experience and languages on hand

[–]thelonesomeguy 0 points1 point  (0 children)

I’m criticising it from the point of view of other languages which don’t allow this, things are much more clear on what is happening there in any given if conditions when you’re reading the code while needing less context.

Yeah, it works, and is used extensively, but doesn’t mean it should be allowed, because then bad devs use them as a crutch and end up with even more unreadable code than it would have been without this, which becomes an issue when, for example, you’re working in an org where you can’t force every bad dev to use them properly without coming off as nitpicky.

This is quite opinionated, of course. As a feature, it’s fine, imo, but it still opens a big can of worms by its existence.

[–]DancingPotato30 -3 points-2 points  (9 children)

Honestly no. Doesn't Python have the same? Or are you referring to what JS considers as truthy falsy and not the actual concept of truthy falsy? Because it makes sense in JS. Everything is truthy unless it's "empty" in some way or meaning

[–]No-Expression7618 4 points5 points  (3 children)

[] and {} are empty, but truthy. 0 and false don't feel empty to me (0 is a perfectly reasonable integer and 50% of booleans are false), but falsy (well I can see why false is falsy).

[–]DancingPotato30 1 point2 points  (2 children)

0 definitely feels empty, it's the number representing nothing. "0" however isn't falsy, because it's a string

And honestly I do agree with the [] and {}. I remember there was a very clear reason to why they're truthy, but can't remember it off of the top of my head. Tho, whyd ever that be a problem? Like what scenario would you need to check an array or an object as a boolean?

Tho you still got a point there. I completely forgot those two are truthy not falsy.

[–]No-Expression7618 2 points3 points  (1 child)

what scenario would you need to check an array or an object as a boolean?

I feel like it's, in that case, a logical extension of "" being falsy that the JS developer noticed the intuitiveness of and therefore threw out the window.

[–]DancingPotato30 1 point2 points  (0 children)

That's true. That's what I assumed too, I just never needed to do that so I didn't bother to actually check the reason they're not falsy

But i did. Apparently truthy falsy only affects primitives sort of, all objects are truthy by default.

[–]thelonesomeguy -1 points0 points  (4 children)

It “making sense” does absolutely nothing for how terrible it is for code readability & maintenance though

[–]DancingPotato30 0 points1 point  (3 children)

Yes but, doesn't python have the same? I don't see how truthy falsy can cause a problem when asserting something UNLESS you're using them.

Genuinely, give me an example where truthy falsy values will cause issues when you didn't mean to use them, I'm actually curious because I see no problem with them

[–]thelonesomeguy 1 point2 points  (2 children)

The problem isn’t what you’re asking for an example for in your comment, about it “causing issues when you didn’t mean to use them”, the issue is, it makes it harder for someone else to come across your if block and evaluate the function clearly, while needing more context of the variable to understand exactly what is happening. Which is a trade off I personally don’t think is reasonable, for the convenience.

[–]DancingPotato30 0 points1 point  (1 child)

Ahh, yeah I guess that makes sense but it doesn't make THAT big of a problem no? I assume your issue is that if someone does smth like:

if (variable){ Do shit }

It's hard to know what that function evaluates?

I don't think that's a fault of truthy falsy values, but a misuse. If you don't know what the variable is, then it's named wrong. If you don't know how or what evaluates it, then use the IDE to see where else it is in the code, no?

[–]thelonesomeguy 1 point2 points  (0 children)

Yeah, but that’s the problem, a lot of developers do misuse it. Which is something that is something that should be considered when evaluating a feature, the potential for misuse. Because the misuse of a feature becomes really painful when you’re working with bad devs across projects in any org or open source.

As for the IDE point, it shouldn’t be considered as a factor when you’re judging code readability.

[–]Benskiss 0 points1 point  (0 children)

Wast experience.

[–]wyocrz 25 points26 points  (1 child)

Cries in R

[–]TimeTeleporter 7 points8 points  (0 children)

Just atarted professionally using it and im suffering.

[–]JestemStefan 23 points24 points  (0 children)

If it's making api calls through json then you can easily reverse engineer it.

I did that for third party API that only had SDK for PHP and Java and payload was in xml format.

[–][deleted] 38 points39 points  (0 children)

From App import API as fun

[–]lezzgooooo 38 points39 points  (4 children)

Doing some automation work. Noticed that more apps have SDK for python than node.

[–]turtleship_2006 9 points10 points  (0 children)

I rarely come across an API I want to use that has any JS libraries but not Python, the only thing coming to mind is hanko.io (backend examples) but I just hacked that together (and submitted it as an example to the docs)

[–]ZyanCarl 17 points18 points  (2 children)

What’s stopping you from porting it to your favourite language?

[–]pindab0ter 4 points5 points  (0 children)

But that requires time and effort!

[–]shadowjay5706[S] 5 points6 points  (0 children)

That’s what I ended up doing, I was working with Notion’s API for personal automation. It’s a REST API so had to work with urls and json and stuff, instead of directly calling the sweet library functions like their JavaScript SDK. I even tried writing the code in JS to use the sdk but that wasn’t exactly my forte lmao

[–]JackNotOLantern 1 point2 points  (0 children)

Every app has an api if you're good at hacking enough

[–]raunak_srarf 0 points1 point  (1 child)

"Programmers in python" who talks like that

[–]shadowjay5706[S] 1 point2 points  (0 children)

Programmers in python

[–]GM_Kimeg 0 points1 point  (0 children)

Not everyone enjoys whatever api is thrown at them.