// Determine whether the sentiment of text is positive // Use a web service async function isPositive(text: string): Promise {
const response = await fetch(`http://text-processing.com/api/sentiment/`, {
method: "POST",
body: `text=${text}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
コード生成ねぇ……🤔 (スコア:-1)
どーせ、できるのはgetter, setterの生成レベルくらいなんでしょ?
「nullの時は代わりに”hogehoge”を返す」くらいのことはコメントに書いておけば生成できるかもしれんが。
あとは、いろんなプロジェクトで同じ関数名、同じ引数、同じ処理内容でコピペされまくって頻出の慣用句みたいになってる処理とか。
「平易な英語で」表現されるレベルのコードなら、逆説的にコードに軽く目を通せば何やってるかわかるから説明コメントを書く必要がないし。(仕様書としてのコメントが必須な場合を除く)
Re: (スコア:-1)
#!/usr/bin/env ts-node
import { fetch } from "fetch-h2";
// Determine whether the sentiment of text is positive
// Use a web service
async function isPositive(text: string): Promise {
const response = await fetch(`http://text-processing.com/api/sentiment/`, {
method: "POST",
body: `text=${text}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Re:コード生成ねぇ……🤔 (スコア:0)
こういうのがまさに、あらかじめ用意された慣用句的コードじゃねえなの?
まあ数行のコメントでそれ以上のコードを生成するには用意されたテンプレを使うことになるわな