Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for AI generated the 90% of this post
JoelBonetR 🥇
JoelBonetR 🥇

Posted on

     

AI generated the 90% of this post

The heading image has been generated with Dall·E 2

In the previous post

I explained these concepts in a way that I felt "enough understandable" for a wide range of people, though I can be wrong because it's my point of view at the end, so I've decided to try and make Chat GPT to explain what it does.

The conversation went like that:

Me:
can you explain me the following function

exportconstpipeAsync:any=(...fns:Promise<Function>[])=>(input:any)=>fns.reduce((chain:Promise<Function>,func:Function|Promise<Function>|any)=>chain.then(func),Promise.resolve(input));
Enter fullscreen modeExit fullscreen mode

Chat GPT:

This function is creating a utility function called "pipeAsync", which allows chaining multiple asynchronous functions together in a pipeline.

It takes a list of functions as input, passed as rest parameter, which are all wrapped inside a promise.

It returns a new function that takes an input value as an argument. This returned function uses the Array.prototype.reduce method to iterate over the array of functions, and calls each function in sequence, passing the result of the previous function call as input to the next function.

The reduce function starts with an initial value of Promise.resolve(input), which is the input passed to the returned function. This is the starting point of the pipeline.

The reduce function then calls the next function in the pipeline with the result of the previous function call, and this process continues for each function in the pipeline.

The result of the reduce function is a new promise that resolves with the final result of the pipeline.

The "pipeAsync" function allows you to chain together multiple asynchronous functions in a way that makes the code more readable and maintainable. It is similar to the "pipe" function from functional programming, but it's adapted to work with async/await.


While it is 100% accurate, the language and language resources it uses may require a bit of focus to understand in my opinion.

What do you think? Is it better explained by GPT or by flesh and bones people? Let me know in the comments!

Top comments(16)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
aneshodza profile image
anes
Writing every now and then
  • Location
    Switzerland
  • Education
    ZHAW, School of engineering
  • Work
    Software developer
  • Joined

It's actually crazy how it's hard for us humans to tell when an article was written by AI and when it wasn't. I did the same thing but to a bigger extend, which was documentedhere if you are interested

CollapseExpand
 
joelbonetr profile image
JoelBonetR 🥇
Tech Lead/Team Lead. Senior WebDev.Intermediate Grade on Computer Systems-High Grade on Web Application Development-MBA (+Marketing+HHRR).Studied a bit of law, economics and design
  • Location
    Spain
  • Education
    Higher Level Education Certificate on Web Application Development
  • Work
    Tech Lead/Lead Dev
  • Joined

Hi@aneshodza thank you for sharing! I'll take a gander for sure 😁

CollapseExpand
 
blindfish3 profile image
Ben Calder
  • Location
    Europe
  • Education
    Educated
  • Joined

So far I'm fairly confident I can tell when AI has been used. It's pretty sad if people's reading ability and discernment are so poor that they airways fall for it; though too many people fall for the lies spouted by politicians, so go figure...
From what I've seen so far AI generated text is usually highly descriptive; verbose and has no personality. It avoids expressing an opinion, but instead presents all possible sides of an argument. It's soulless and boring. Just what you would expect...

CollapseExpand
 
joelbonetr profile image
JoelBonetR 🥇
Tech Lead/Team Lead. Senior WebDev.Intermediate Grade on Computer Systems-High Grade on Web Application Development-MBA (+Marketing+HHRR).Studied a bit of law, economics and design
  • Location
    Spain
  • Education
    Higher Level Education Certificate on Web Application Development
  • Work
    Tech Lead/Lead Dev
  • Joined
AI generated text is usually highly descriptive; verbose and has no personality. It avoids expressing an opinion, but instead presents all possible sides of an argument.

So at the end it outputs what any adult discussion should look like (at least in the science-related world, though it won't be true in yellow journalism for example) 😅

CollapseExpand
 
aneshodza profile image
anes
Writing every now and then
  • Location
    Switzerland
  • Education
    ZHAW, School of engineering
  • Work
    Software developer
  • Joined

@blindfish3@jonrandy sometimes it is really obvious, don't get me wrong. But as someone that picked up english as his 3rd language I would lie if I told you that I can always pick up on it.

CollapseExpand
 
jonrandy profile image
Jon Randy 🎖️
🤖 Artisanal developer - coding with varying degrees of success since 1983
  • Location
    Bangkok 🇹🇭
  • Joined

Mostly it isn't that hard - they always have a certain 'feel' to them... whenever I'm suspicious I run it through a GPT detector and my hunch is usually correct

CollapseExpand
 
hr21don profile image
Helitha Rupasinghe
Developer 💻 | Technical Writer 📝 @ThePracticalDev @Medium @Teelfeed @Hashnode @LinkedIn | Open to collaborate 🔓 | AI Enthusiast 🤑 | Caught 🔥 Coding | 4.4 Blog Subscribers
  • Education
    University Of Hertfordshire
  • Work
    Let's chat about your brand projects: Contact me 👉 providedByGatsby@outlook.com
  • Joined

AI generated this comment!

CollapseExpand
 
polterguy profile image
Thomas Hansen
CEO at AINIRO.IO - Obsessed with ChatGPT, AI and Machine Learning. Delivering AI solutions and development platforms based upon No-Code and AI.
  • Location
    Cyprus
  • Work
    CEO and Founder of AINIRO Ltd
  • Joined

Hi Joel, if you build your own model it'll typically do a much better job :)

CollapseExpand
 
joelbonetr profile image
JoelBonetR 🥇
Tech Lead/Team Lead. Senior WebDev.Intermediate Grade on Computer Systems-High Grade on Web Application Development-MBA (+Marketing+HHRR).Studied a bit of law, economics and design
  • Location
    Spain
  • Education
    Higher Level Education Certificate on Web Application Development
  • Work
    Tech Lead/Lead Dev
  • Joined

Thanks@polterguy I'll take a look at it 😀

At first glance I doubt I can create "easily" a good enough training model to compete with Chat GPT though 😂😂

CollapseExpand
 
polterguy profile image
Thomas Hansen
CEO at AINIRO.IO - Obsessed with ChatGPT, AI and Machine Learning. Delivering AI solutions and development platforms based upon No-Code and AI.
  • Location
    Cyprus
  • Work
    CEO and Founder of AINIRO Ltd
  • Joined

Of course not, but ask ChatGPT"who is Joel Bonet", then realise every single company out there might want a chatbot answering similar questions, such as"What's the price of your products?" or"Why should I chose your company?", etc, etc, etc.

If you ask the publicly available ChatGPT these questions, it will (at best) try to sell you a pro OpenAI account.

CollapseExpand
 
ventolin profile image
ventolin
  • Location
    México
  • Joined

Some people gonna have to start writing better posts if they don't want to be replace by AI.

CollapseExpand
 
joelbonetr profile image
JoelBonetR 🥇
Tech Lead/Team Lead. Senior WebDev.Intermediate Grade on Computer Systems-High Grade on Web Application Development-MBA (+Marketing+HHRR).Studied a bit of law, economics and design
  • Location
    Spain
  • Education
    Higher Level Education Certificate on Web Application Development
  • Work
    Tech Lead/Lead Dev
  • Joined

I already tried it on detail and we still need to wait a bit more till this situation is present, so we have a bit more of time to train ourselves! 😂

CollapseExpand
 
ventolin profile image
ventolin
  • Location
    México
  • Joined

😂

CollapseExpand
 
codewithbernard profile image
Bernard Bado
Building Income Streams With Code | Creator of http://deapmarket.com | Owner of http://upbeatcode.com
  • Location
    Slovakia
  • Joined

AI understands code better than developers.
That's why I've createdWhisprAI - code review assistant.

CollapseExpand
 
kunashir profile image
Aleksandr Korolev
  • Location
    Berlin
  • Work
    Backend-developer at Latana
  • Joined

I think it is true in regard to the technical side but AI still has difficulties when it is related to the business side.

CollapseExpand
 
codewithbernard profile image
Bernard Bado
Building Income Streams With Code | Creator of http://deapmarket.com | Owner of http://upbeatcode.com
  • Location
    Slovakia
  • Joined

For now

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Tech Lead/Team Lead. Senior WebDev.Intermediate Grade on Computer Systems-High Grade on Web Application Development-MBA (+Marketing+HHRR).Studied a bit of law, economics and design
  • Location
    Spain
  • Education
    Higher Level Education Certificate on Web Application Development
  • Work
    Tech Lead/Lead Dev
  • Joined

More fromJoelBonetR 🥇

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp