Hacker News new | past | comments | ask | show | jobs | submit login

Since you do say it in HN tagline, what are the "3 lines of code"? I can only see 43 LoC in the landing page. A tool to help massively with payments is always welcome of course, but if this is really 43 lines instead of 3 it'd feel like shady marketing (no judgement until there's a reply/clarification).



It'd be more accurate to say 3 steps, but I see where they're coming from:

    // 1. Import
    import { ISO20022 } from 'iso20022.js'
    // 2. Instantiate the sender
    const iso20022 = new ISO20022(initiatingPartyInfo);
    // 3. Send
    iso20022.createSWIFTCreditPaymentInitiation(paymentInstructions);


It's the import, the "const iso20022 = new ISO20022" line, and the "const creditPaymentInitiation = iso20022.createSWIFTCreditPaymentInitiation". The big data chunks are being counted as one line.

I will admit I'm usually very skeptical about "Do X in Y line" claims because usually you can do anything in one line by shoving the entire codebase behind a "DoIt()" call. But I'll actually give them this one. I'm not even worried about the data taking up so many lines as clearly the data is necessary. If they were full of mandatory function calls or something I'd ding 'em too, but they're not, it's just the data you need.


If it was free text content I'd agree, but this being configuration code where you need to be very precise on the key names and values, possibly reading some docs and consulting multiple sources per line, I would not count this as 3 lines... 3 simple steps sure, but calling that 3 lines is not being honest IMHO.


You import the library, initialise an object and call its method. I think it's fair enough to call that example three lines of code.

The bigger question of course is what do you end up with. Clearly that method call isn't going to actually send an instruction to your bank to debit your account and credit somebody else's. I guess `creditPaymentInitiation` is an object that has can be converted to a properly formatted message that can then be sent to your bank using an external tool?


I'd bet the .toString() method returns an XML payload you can shove into your API call when you've configured a client for it.


Yup - see https://docs.iso20022js.com/quickstart#step-4-send-the-payme... if you wanna see how that's done


I imagine they are counting object literals as one line of code, I'm inclined to agree. Maybe they could have said in "3 statements of code".

> import { ISO20022 } from 'iso20022.js'

> const iso20022 = new ISO20022({ /.../ });

> const creditPaymentInitiation = iso20022.createSWIFTCreditPaymentInitiation({ /.../});

> console.log(creditPaymentInitiation.toString());

Now are we counting the import and not counting the log statement, or are we counting the log statement and not the import?

I'm not too worried about it.


Thanks for checking out what I'm working on Francisco - you're right - expanding all the data models here increases the LoC. The objective of iso20022.js is not to be overly simplified, but rather offer the best way to interface with the ISO20022 standard. That's a big reason for the large payloads - no obfuscation.


Nothing shady with that at all and extremely obvious what 3 LoC refers to.


I mean, it's 3 statements with like 40 lines of JSON options. Debatable what counts as a LOC, but it's still pretty impressive.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: