Especially for a company that prides itself on great API design, this is head scratching.
‘shopify.Init()’ seems like such an obvious solution
Shopify is the first one I've seen, so I don't think it's quite as common as you are implying, but I'm curious to know what other bad behavior you have found
https://github.com/opencv/opencv/blob/master/modules/python/...
If you're moving fast, you don't have time for this. Especially if it isn't your core competency / core product.
I thought we are talking about Shopify... where people browse and search products, buy products, make a transaction, and review past orders/invoices/transactions.
Where does PATCH fit?
I still think the major promise of RESTful APIs is avoided by the prevalence of SDKs.
What do you use to consume the openapi docs and generate models with?
Can't remember the exact name of it but it's one of the open API generators that supports all the major languages. Unfortunately the csharp and dotnet core generator generates clients with RestSharp which doesn't use the almighty HttpClient, so I consider them unusable, but it generates the models faithfully. If it so happens the open API spec is wrong that's unfortunate. Though usually if they have an SDK I just use the models directly from the SDK! That's the absolute sweet spot for me. Especially if their SDK is generated off open API it probably stays perfectly or acceptably accurate with incentives to correct any inaccuracies.
If you dont use a language with strong type safety the benefits are less.
For instance the OpenAPI3 (Swagger-NG) standard. It allows the typing/schema'ing of the JSON bodies. It also provides a bunch of generators[1] that can be used to generate client libs. And when the languages of the client libs permit it, those libs come with lots of type safety and greatly reduce boilerplate.
There really shouldn't be much boilerplate to passing JSON around back and forth.
The python api doc is not good. I'm always not sure about how to call the api. I can only leave an issue on GitHub.
The ecosystem obviously leans toward react and ruby. The examples are not suitable for me most of the time. The tooling like CLI, example will not include what you need.
Use Polaris for your UI? Sorry, it's not supporting vue. You need to build it with npm. Only for react. But I want the easy way to work with CDN
Need python examples on the latest session token auth? Sorry, there is no such thing. I spent 2 - 3 weeks working on it (and still working now). What I got are the workflow diagram and step instructions. Welcome back to the uni!
But the session token auth is mandatory for all new apps. You must use it NOW!
Developer / Partner support? Please provide a store id to identify yourself. But I clicked the link INSIDE the partner portal. (Half an hour later, still got nothing. ) I spend an hour and get nothing most of the time. The worst thing is that they answer you 'Sorry, I don't know or it is not feasible' with a thousand word long email.
Yes, every 3 months you need to revisit the API. It's good and bad. It means that if you're casually developing an app, this will consume a lot of time. Good because if forces you to update and keep your app relevant.
The real question we should be asking is, is churn adding value? I understand security updates but otherwise you can only improve the wheel so many times before it just becomes a waste of time (decreasing marginal returns). Software engineering _badly_ needs a concept of finished version and mature software. Often there is very little gained from a new framework every few months besides assuaging the egos of a new generation of developers.
It used to be like that. Back before the expectation of regular updates, in fact back before downloading updates off the internet was considered desirable or even feasible, when releasing a patch was a borderline embarrassing admission that we didn't get it right the first time, software shipped on CD and the version that shipped was understood to be the version installed on the vast, vast majority of customer systems, so it had better be a finished product or there were reputations on the line.
That's the opposite of good.
"Relevant" to whom? As long as the store is selling stuff, it's highly relevant to the buyer and seller.
That is the consumer being "good". There is nothing regarding the provider there which is good.
Never good.
I think the programming community largely agrees that indenting is good. If something is forcing you to do something that is good, then it definitely doesn't fall into the category of "never good."
I can't think of a single time in the nearly 10 years of using Python daily that made me want it to operate differently w.r.t. indenting.
Indenting as code always struck me as a horrible idea. Better than, say, type coercion... but still horrible.
(Full disclosure, Saleor Head of Growth. A friend sent me this link. Yes, my account is new.)
- `import shopify` makes an API request. If their API rate limits you, your server will probably crash. This happened to us in production.
- That API request gets a dynamic list of supported API versions. If the version you've hard-coded in your app (because it's what you support) is no longer in that list, it will raise a VersionNotFoundError and your app will probably fail in some significant way.
- There's no connection persistence. Every API call sets up and tears down a full connection, a noticeable performance impact.
- Internally the library uses a lot of global state, it's certainly not safe to use in async code – too easy to use the wrong credentials on a request – and I suspect it's also not thread safe.
- Despite having something called a Session, very similar in documentation to a requests.Session or httpx.Session, it's neither, it's just a container for some creds. No sessions are available at all.
- It's mostly a wrapper around Pyactiveresource, which appears to have a lot of similar issues – internal state that's hidden that causes things to not work as you expect.
I suspect that the Python library was developed by Ruby engineers, some of the practices are things I've seen in Ruby but that just don't fit into the Python ecosystem.
From what I can tell their API deprecation strategy is quite hostile to developers.
I think it would be difficult to build what I'd consider to be production-grade services on top of the library. This is in stark contrast to others such as Stripe's API/libraries which are fantastic.