関数型ドメインモデリングの著者、Scott Wlaschinさんの出たポッドキャストが良すぎたので和訳した(2)-1
Domain Modeling Made Functional Part 2 with Scott Wlaschin
最近聞いたポッドキャスト、 Compiled Conversation #8, #9 がドメイン駆動設計の入門としてすごくよかったので、英語で文字起こしして、和訳をしました。参加者のお二人に和訳をブログに載せる許可をいただきました。LLMによる機械翻訳ベースなので、細かな表現が意訳されていたり、また文字起こしの間違いにより一部おかしな内容になっているかもしれません。ぜひ英語でわかる方は本編を英語で聞かれることをお勧めしますが、日本語の和訳だけでもニュアンスが十分伝わるので、よろしければご覧ください。
(1)-1はこちら
(1)-2 はこちら
(1)-3 はこちら
(2)-2 はこちら
(2)-3 はこちら
podcastのリンクはこちらです。
登場人物
- Ed Mann(ホスト): ポッドキャストの司会者
- Scott Wlaschin(ゲスト): 『関数型ドメインモデリング』著者、F# for Fun and Profit ブログ執筆者
はじめに - エピソード2への導入
Ed Mann
英語はこちら
Hello and welcome to the show. My name is Ed Mann and today we're continuing our chat on Domain Modelling made Functional with Scott Wlaschin. Last episode, we explored the foundations of domain, different design, the concepts, the strategic first tactical approaches and how to model domains in a way that reflects the business rather than just the technology. In this episode, we'll be diving into functional programming, how it helps us design clearer models and why it appears so naturally with DD. So without further ado, let's get back into the show.
こんにちは、番組へようこそ。私の名前はEd Mannです。今日はScott Wlaschinとの『関数型ドメインモデリング』についての対談を続けていきます。前回のエピソードでは、ドメインの基礎、様々な設計、概念、戦略的・戦術的アプローチ、そして単なる技術ではなくビジネスを反映した方法でドメインをモデル化する方法を探求しました。今回のエピソードでは、関数型プログラミングに深く入り込み、それがより明確なモデルの設計にどのように役立ち、なぜDDDと自然に調和するのかを探ります。それでは早速、番組に戻りましょう。
関数型プログラミングとは何か
Ed Mann
英語はこちら
So yes, not like moving on. So we see in the book that you wrote Domain Modelling Made functional, we talked about the domain driven design part there. And then you're able to slowly quite beautifully, I think be able to start introducing functional programming. And I think this is another one of those big topics and there's a lot of confusion around it. I think because a lot of the paradigm, a lot of the ideas behind functional programming has bled into a lot of areas. So I was, I think it'd be really great. Maybe the first question around function programme is what is functional programming? Functional programming is programming.
はい、次に進みましょう。あなたが書いた『Domain Modelling Made Functional』の本では、そこでドメイン駆動設計の部分について話しました。そして、あなたはとても美しく、徐々に関数型プログラミングを導入し始めることができると思います。これもまた大きなトピックの一つで、多くの混乱があると思います。関数型プログラミングのパラダイムや背後にあるアイデアの多くが、多くの分野に浸透しているためだと思います。そこで、関数型プログラミングに関する最初の質問は、関数型プログラミングとは何か?ということでしょう。
Scott Wlaschin
英語はこちら
With functions, that's not very helpful. So what I mean by that is as opposed to object-ended programme, which is programming with objects. But I mean what it really means is if if you if you want to, for example, connect two things together to make a bigger thing, in functional programming you connect to functions together to make a bigger function, rather than connecting 2 objects. If you want to control the behaviour of something, for example like the strategy pattern where you pass in another object that controls the behaviour, in functional programming you pass in a function that controls somebody else's behaviour.
関数を使うプログラミングです、というのはあまり役に立ちませんね。私が言いたいのは、オブジェクトを使うプログラミングであるオブジェクト指向プログラミングと対照的だということです。本当の意味は、例えば2つのものを接続してより大きなものを作りたい場合、関数型プログラミングでは2つのオブジェクトを接続するのではなく、2つの関数を接続してより大きな関数を作ります。何かの振る舞いを制御したい場合、例えばストラテジーパターンのように別のオブジェクトを渡して振る舞いを制御するのではなく、関数型プログラミングでは誰かの振る舞いを制御する関数を渡します。
Scott Wlaschin
英語はこちら
And you know, so basically all the things you would do with objects you do with functions. So that to me is functional programming. And it takes a while. Essential. Well, that sounds pretty obvious, but it actually takes a while to get your head around it because you use functions for everything. So the unit of the basic unit that you build things out of its functions. So you connect functions together to make bigger functions. That's composition you can manipulate functions, you know, you can make. You can have a thing about in functional programming, you have functions as inputs. Functions are things so you can assign.
ご存知のように、基本的にオブジェクトで行うすべてのことを関数で行います。それが私にとっての関数型プログラミングです。これを理解するには時間がかかります。当たり前に聞こえますが、実際にはすべてに関数を使うため、頭を切り替えるのに時間がかかります。基本単位は関数です。関数を接続してより大きな関数を作ります。これがコンポジションです。関数を操作できます。関数型プログラミングでは、関数を入力として持つことができます。関数はモノなので代入できます。
Scott Wlaschin
英語はこちら
A function to a variable and you can pass it around. So you can have functions as parameters and you can have functions as inputs and you can have functions as outputs. They're just things like like a normal programme, we'd have strings and integers that you pass around. In functional programming, you have functions that you pass around. So in very common technique is what I call a function transformer, where you pass in a function to another function and it converts that function into a different shape and it spits out a different function as the output. Now that's not something you do in object oriented programming, but it's incredibly common.
関数を変数に代入して、それを渡すことができます。関数をパラメータとして持つことも、入力として持つことも、出力として持つこともできます。通常のプログラムで文字列や整数を渡すように、関数型プログラミングでは関数を渡します。非常に一般的なテクニックは、私が「関数トランスフォーマー」と呼ぶもので、ある関数を別の関数に渡し、その関数を異なる形に変換し、出力として異なる関数を吐き出します。これはオブジェクト指向プログラミングではしないことですが、関数型プログラミングでは非常に一般的です。
Scott Wlaschin
英語はこちら
And functional programming. So function Transformers and things where functions are passed as parameters and connected together. It's just this is how functional programming works. So that's what I call function, but it's literally the tool you reach for first. Is a function rather than objects.
関数型プログラミングでは、関数トランスフォーマーや、関数がパラメータとして渡されて接続されるものが基本です。これが関数型プログラミングの仕組みです。文字通り、最初に手に取るツールは、オブジェクトではなく関数なのです。
関数型プログラミング言語とは
Ed Mann
英語はこちら
That's so, that's so interesting. And I guess this is where it goes into in today's age. Now it's like what classifies a language as a functional programming language.
それはとても興味深いです。今日の時代において、何が言語を関数型プログラミング言語として分類するのかという話になりますね。
Scott Wlaschin
英語はこちら
Right, so I mean, So the thing about functional programming is you can do it in any language which allows functions to be.
そうですね、関数型プログラミングの特徴は、関数を扱えるあらゆる言語で実行できることです。
Ed Mann
英語はこちら
Independent and would you class that as the paradigm? So functional programming?
独立していること、それをパラダイムとして分類しますか?関数型プログラミングパラダイムとして?
Scott Wlaschin
英語はこちら
Paradigm. So function programming paradigm is the paradigm of using functions to get stuff done. Now you can do that in any language that has functions as first class things. So in C you can pass in functions as parameters and in Java you can pass. In Python you can pass functions in as parameters and have a function as the output and so on. However, a functional programming language is where that is the language is designed around doing that. So in a lot of languages.
パラダイムですね。関数型プログラミングパラダイムは、関数を使って物事を成し遂げるパラダイムです。関数がファーストクラスのものである任意の言語でそれができます。C#では関数をパラメータとして渡せますし、Javaでも渡せます。Pythonでも関数をパラメータとして渡したり、出力として関数を持つことができます。しかし、関数型プログラミング言語は、その言語がそれを中心に設計されているものです。
Scott Wlaschin
英語はこちら
Python is not designed as a functional programming language. It's not. I mean, you can do it, but it's just not natural. You know, C is getting better, but it's not really designed as a functional product. But you know, F# and Haskell and Ocaml, and they're designed from the ground up to be functional programming languages. And for example, you know, you mentioned, we've talked about before with something called currying and partial application, which is where you, if you have a function with two or three parameters, you can skip some of the parameters and pass them in later. So you can have.
Pythonは関数型プログラミング言語として設計されていません。できますが、自然ではありません。C#は改善されていますが、本当に関数型として設計されたわけではありません。しかし、F#、Haskell、OCamlなどは、最初から関数型プログラミング言語として設計されています。例えば、以前話したカリー化と部分適用があります。これは、2つまたは3つのパラメータを持つ関数で、いくつかのパラメータをスキップして後で渡すことができるというものです。
言語の自然な使い方
Scott Wlaschin
英語はこちら
Function with one parameter passed in now and another parameter passed in later. That is all functional programming languages will allow you to do that, but the O languages typically do not allow you to do that. You have to pass it all the parameters at once. So there's just a very simple example of a language which makes that kind of thing very easy. Again, there's always workarounds, but it's just unnatural. The other thing is it's unnatural if you're doing partial application or currying in a language like C or Java, I mean JavaScript or TypeScript.
今1つのパラメータを渡し、後で別のパラメータを渡す関数です。すべての関数型プログラミング言語でそれが可能ですが、OO言語では通常それができません。すべてのパラメータを一度に渡す必要があります。これは、そのようなことを非常に簡単にする言語の単純な例です。回避策は常にありますが、不自然なのです。C#やJava、JavaScriptやTypeScriptのような言語で部分適用やカリー化を行うのも不自然です。
Scott Wlaschin
英語はこちら
It just doesn't feel. You mean you can do it. It just doesn't feel very natural. It's not. It's not really what the language is assigned for. And also, if I do that in these languages, someone else who comes along to try and maintain my code will have no idea what I'm doing because it's like, it's just not a natural thing. But if I'm writing the same type of techniques in F# or Haskell or something, I would expect that other programmers would know exactly what I'm doing because that's the part of the functional paradigm to do this kind of stuff. So there are techniques I would use in F that I would not use in C because I would expect.
自然に感じられません。できますが、とても自然とは感じられません。言語がそのために設計されていないのです。また、これらの言語でそれを行うと、私のコードを保守しようとする他の人が何をしているのか全くわからなくなります。自然なことではないからです。しかし、F#やHaskellなどで同じテクニックを書いている場合、他のプログラマーは私が何をしているか正確に理解できると期待します。それが関数型パラダイムの一部だからです。F#で使うテクニックでも、C#では使わないものがあります。
Scott Wlaschin
英語はこちら
Sharp, I want to understand what I'm doing, but I wouldn't expect a typical C# programme. So it's just, you know, it's about the community. So it's not just about the technical capabilities of the language. It's about the community around the language, what they expect and how, you know the way that you expect people to use their language. I would expect an object oriented language to be used in an object oriented way and I would expect a functional language to be used in a functional way. You know, and I, I, I'm a great believer and user and I just want a little a little rant here. I'm a great believer in.
F#プログラマーには理解してもらえることを期待しますが、典型的なC#プログラマーには期待しません。これはコミュニティについての話です。言語の技術的能力だけでなく、言語を取り巻くコミュニティ、彼らが何を期待し、どのように言語を使うことを期待するかということです。オブジェクト指向言語はオブジェクト指向的に使われることを期待し、関数型言語は関数型的に使われることを期待します。私は強く信じています。
Scott Wlaschin
英語はこちら
Using a language the way it was designed to be used and it frustrates me when people come to a new language.
言語を設計された通りに使うべきだと信じており、新しい言語に来た人々がそうしないときは苛立ちます。
言語の「木目」に沿ったプログラミング
Scott Wlaschin
英語はこちら
And they try and squeeze their old methodologies into it. So you're coming, you know, you're learning functional programme. You say, well, how do I do a four loop? And it's like, well, that's not how it works. So how do I do so well, that's not how it works. And it's like, well, this is a stupid language. And it's like, that's not, you know, you need to come, you need to in the in, in woodworking. You know, the idea of a piece of wood has a grain. And if you cut, if you split it along the grain, it's very easy. If you go across the grain, it's very hard. You want to go with the grain. So if you have a functional language, you need to learn to think functionally, but and.
古い方法論をそこに押し込もうとするのです。関数型プログラミングを学んでいるとして、「forループはどうやるの?」と言います。「それはそういう仕組みではない」と答えると、「これは愚かな言語だ」となります。でもそうではありません。木工では、木には木目があります。木目に沿って割ると簡単ですが、木目に逆らうと難しいです。木目に沿って行くべきです。関数型言語があれば、関数型的に考えることを学ぶ必要があります。
Scott Wlaschin
英語はこちら
If I'm doing object oriented programming, I would use objects. If I was using, you know, Python, I would write in a Python. Like AI wouldn't try and bring, you know, F# style programming to Python because it's just not appropriate. And it's all Visual Basic. You know, if I'm writing Visual Basic, I'm writing in that kind of style or Prologue or.
オブジェクト指向プログラミングをしているなら、オブジェクトを使います。Pythonを使っているなら、Pythonらしく書きます。F#スタイルのプログラミングをPythonに持ち込もうとはしません。適切ではないからです。Visual Basicを書いているなら、そのスタイルで書きます。Prologueならそのスタイルで。
Scott Wlaschin
英語はこちら
Erlang, whatever it is, there's a certain, most languages have a certain natural way of working and that's the way you should work. So, you know, functional programming languages have a sort of a natural way of working. And it's frustrating if you're coming from a different paradigm, like, oh, it's very frustrating to try and get your head around the way of working. But I mean, this is something you have to do if you want to become comfortable.
Erlangであれ何であれ、ほとんどの言語には自然な動作方法があり、そのように動作すべきです。関数型プログラミング言語には自然な動作方法があります。異なるパラダイムから来ると、その動作方法を理解しようとするのは非常にフラストレーションがたまります。しかし、快適になりたいならこれをする必要があります。
不変性とデフォルト値
Ed Mann
英語はこちら
In that language, you know, Yeah. So from what there then? So when I think then of a functional programme language, then I'm really seeing like it's a syntactic thing. It's like, what have they made it? Easy to do exactly.
その言語で、ですね。では、関数型プログラミング言語について考えると、それは構文的なものだと思います。何を簡単にできるようにしたか、ということです。
Ed Mann
英語はこちら
Like, and also in the case of, so let's talk about F#. Like in F#, you can actually use objects if you really want to. You can use classes and things, but it feels unnatural to do that. And in a similar way to C#, it's what the language has been tailored towards classes. O and then there is obviously, you know, and I think there's a beautiful thing. There is a lot of these functional paradigm concepts that you can sprinkle in, but fundamentally it is no language. And trying to write everything in a functional programming paradigm in that language feels unnatural. The syntax isn't right.
F#について話しましょう。F#では、本当に望めばオブジェクトを使うことができます。クラスなども使えますが、それは不自然に感じます。C#と同様に、言語がクラスに向けて調整されているからです。関数型パラダイムの概念を散りばめることはできますが、根本的にはOO言語です。その言語ですべてを関数型プログラミングパラダイムで書こうとすると不自然に感じます。構文が合わないのです。
Scott Wlaschin
英語はこちら
Exactly. All these things. Another good example is mutability. In O languages, everything typically is mutable by default. So if I have a variable and I assign it something, it can easily assign it something else very easily that's built in to oh, programming is a mutable state. Now there are ways of making immutable data structures, you know, there are ways of doing, but that's typically it's an extra keyword, it's an extra step you have to do. Now in functional programming languages is the exact opposite. So in F# things.
その通りです。別の良い例は可変性です。OO言語では、通常すべてがデフォルトで可変です。変数に何かを代入したら、簡単に他のものを代入できます。それがOOプログラミングに組み込まれています。不変データ構造を作る方法はありますが、それは通常追加のキーワードや追加のステップが必要です。関数型プログラミング言語では正反対です。F#では、
Scott Wlaschin
英語はこちら
Are immutable by default. I cannot reassign A variable once I've assigned it. Now there is a way to get around it, but that's an extra step. So it's exactly. There are ways, you know, there are kind of backdoors to doing things, but that's considered a code.
デフォルトで不変です。一度変数に代入したら、再代入できません。回避する方法はありますが、それは追加のステップです。裏口のような方法はありますが、それはコードスメルとみなされます。
Ed Mann
英語はこちら
Against the grain it's against.
木目に逆らっている、
Scott Wlaschin
英語はこちら
The grain, exactly. It's a code smell. It's just something you don't do. It's just, you know, it's just not done. So it makes it so it makes it easy to do if you want to do immutable coding, it's really easy in a functional language. It's a standard way of doing it if you want to do immutable programming in C#.
木目に逆らっています、その通り。コードスメルです。単にやらないことです。不変プログラミングをしたいなら、関数型言語では本当に簡単です。それが標準的な方法です。C#で不変プログラミングをしたい場合、
Scott Wlaschin
英語はこちら
Java or JavaScript it's hard it just the language is probably there are ways of doing it, but it just doesn't.
JavaやJavaScriptでは難しいです。方法はおそらくありますが、言語がそれを簡単にしてくれません。
Ed Mann
英語はこちら
Make it easy for you. And I think something there, because we've only just talked, we've essentially talking about functional programming and we talked about a couple of languages there and they are all different flavours, you know, because something I think about, you know, talk about like closure as a functional programme because it's functions, but that is a dynamic language like similar with Erlang. Something that I consider with functional programming that comes up a lot is like obviously these rich type systems, right? Is that something that you could consider to be a functional programming?
簡単にはできません。私たちは関数型プログラミングについて話してきて、いくつかの言語について話しましたが、それらはすべて異なる味わいがあります。Clojureは関数型プログラムですが、Erlangと同様に動的言語です。関数型プログラミングでよく出てくるのは、これらの豊かな型システムですよね。それは関数型プログラミングの特徴と考えられますか?
Ed Mann
英語はこちら
Thing or is that?
それとも?
静的型付け関数型プログラミング
Scott Wlaschin
英語はこちら
Yeah, so it's good question. So when I my original definition of programming with functions applies to dynamic languages as well. So closure, for example, and Erlang and whatever could be considered dynamic functional programme languages. But yeah, the statically typed functional programming which is F and Ocaml and Haskell and Elm and pure scripts and a couple of other ones, that's a whole thing because everything is done through types and.
良い質問です。私の「関数を使ったプログラミング」という元の定義は、動的言語にも適用されます。例えば、ClojureやErlangなどは動的関数型プログラミング言語と考えられます。しかし、F#、OCaml、Haskell、Elm、PureScriptなどの静的型付け関数型プログラミングは、すべてが型を通じて行われるため、全く別のものです。
Scott Wlaschin
英語はこちら
Types are done in functional programming. Types are very different from.
関数型プログラミングの型は、
Scott Wlaschin
英語はこちら
Object oriented types, they are types are not the same thing as classes. And that's when I discovered that I was thrilled because I realised you could do all these things with these static types that are very different from doing classes. And that's one of the kind of insights that got me to write my book because it's like, oh, this is very cool, let's do some very cool things with this. So yeah, you can definitely do things in static type language that you can't do in a dynamically like dynamic language like Closure. So closure would have a different, again, they would have a different sort of paradigm for how they do data modelling than they would.
オブジェクト指向の型とは全く異なります。型はクラスと同じものではありません。それを発見したとき、私は感激しました。静的型でクラスとは全く異なることができることに気づいたからです。それが本を書くきっかけの一つになりました。とても素晴らしいと思ったからです。静的型言語では、Clojureのような動的言語ではできないことができます。Clojureは、データモデリングの方法について異なるパラダイムを持っているでしょう。
Scott Wlaschin
英語はこちら
Then you wouldn't have Sharp or Haskell or something.
F#やHaskellとは異なります。
Ed Mann
英語はこちら
And again, very similar to F# where it's based on the JVM. Like yes, you can do classes and you know you can do objects in closure, but it feels unnatural. You're going against the grain on what you would typically use that language for.
そして、JVMベースのF#と非常に似ています。はい、Clojureでクラスやオブジェクトを使うことはできますが、不自然に感じます。その言語を通常使う方法に逆らっています。
Ed Mann
英語はこちら
Exactly, exactly. So again, if I'm, if I want to learn closure, I want to learn the closure way of doing things I wouldn't want to, I wouldn't try and use Java techniques in closure, just would feel, well, absolutely.
その通りです。もしClojureを学びたいなら、Clojureのやり方を学びたいです。ClojureでJavaのテクニックを使おうとはしません。それは不自然に感じます。
TypeScriptとRustについて
Ed Mann
英語はこちら
Kind of a little aside there, but like what are your thoughts on languages like TypeScript and Rust that have like much more richer type system? Than we've ever seen before kind of in.
少し脇道にそれますが、TypeScriptやRustのような、これまでにないほど豊かな型システムを持つ言語についてどう思いますか?
Scott Wlaschin
英語はこちら
These well rush is a very interesting because Rust is basically Ocaml is like low level Ocaml because it was originally written in no Camel and it's got a lot of the functional ideas of algebraic beta types of stuff. However, it has the whole thing of the lifetimes and the memory stuff which.
Rustは非常に興味深いです。RustはもともとOCamlで書かれており、基本的に低レベルのOCamlのようなものです。代数的データ型などの多くの関数型のアイデアを持っています。しかし、ライフタイムやメモリ管理の全体的な仕組みがあります。
Ed Mann
英語はこちら
Of our checker and all.
借用チェッカーとか。
Scott Wlaschin
英語はこちら
That exactly, which is something that Ocaml doesn't need to do, so it's interesting. And then again, TypeScript is basically adding types to JavaScript in an interesting way, but again, they're stuck.
その通りです。OCamlはそれをする必要がないので、興味深いです。TypeScriptは基本的にJavaScriptに型を追加する興味深い方法ですが、彼らは制約されています。
Scott Wlaschin
英語はこちら
With they, they really wanted to have the idea that it was compatible with JavaScript. So they had to have a lot of compromises about what you can do. And so, you know, a language like Haskell does not have to make any of those compromises whatsoever, but TypeScript does. So again, the pure functional programme, people find it hard because it's like, well, there's all these kind of backdoors and gateway loopholes, but compared to JavaScript, I'm sure it's a lot better. I haven't never, I haven't not used TypeScript seriously, but I mean, I would personally.
JavaScriptとの互換性を保ちたかったため、できることについて多くの妥協をしなければなりませんでした。Haskellのような言語はそのような妥協を一切する必要がありませんが、TypeScriptはそうです。純粋な関数型プログラマーにとっては、これらの抜け道や逃げ道があるため難しいと感じますが、JavaScriptと比較すれば、はるかに良いでしょう。私はTypeScriptを本格的に使ったことはありませんが、個人的には、
Scott Wlaschin
英語はこちら
Polymerfer TypeScript over using JavaScript just because I like. I like using statistically typed languages and the main reason I do it is I like being able to come back to a project.
JavaScriptよりもTypeScriptを好みます。静的型付け言語を使うのが好きだからです。主な理由は、プロジェクトに戻ってきたときに、
Scott Wlaschin
英語はこちら
You know, six months later and work on it and, and not get a whole bunch of errors. That's always a win. I mean, I a while ago I worked on a Python, so I know Python pretty well and I worked on a Python project and it was quite a complex piece of code and it worked really well. And then a year later they said, well, can you come back and rewrite this and maybe and add some new changes to it and.
6ヶ月後に作業をして、大量のエラーが出ないことです。それは常に勝利です。以前Pythonで作業しました。Pythonはよく知っていて、かなり複雑なコードのプロジェクトでうまく動作していました。1年後、戻ってきて書き直し、新しい変更を加えてくれと言われました。
Scott Wlaschin
英語はこちら
When I was trying to rewrite it, you know, even though I had unit tests and stuff, I was very worried that I was going to break.
書き直そうとしたとき、ユニットテストがあったにもかかわらず、壊してしまうのではないかととても心配でした。
Scott Wlaschin
英語はこちら
The original version.
元のバージョンを。
Scott Wlaschin
英語はこちら
By tweaking it. So I ended up literally just copying the entire script and tweaking the copy and not not changing the original 1 because I was worried that I might break something. And that's one of the things with dynamic languages. Now in F#, I would not worry about doing that because if I made a thing that didn't work, I would get thousands of compiler errors. And that's a standard thing. It's like you deliberately break something, you get thousands of compilers. You just work your way through each error. By the time you fixed all the errors and there's no more compiler errors, chances are it's going to work again. You don't get that kind of.
変更することで。結局、スクリプト全体をコピーして、コピーを変更し、オリジナルは変更しませんでした。何かを壊すかもしれないと心配だったからです。これが動的言語の問題の一つです。F#では、そんな心配はしません。動作しないものを作ったら、何千ものコンパイラエラーが出ます。それは標準的なことです。意図的に何かを壊すと、何千ものコンパイラエラーが出ます。各エラーを一つずつ修正していきます。すべてのエラーを修正し、コンパイラエラーがなくなったときには、おそらく再び動作するようになります。
Scott Wlaschin
英語はこちら
Horrible. Dreadful.
恐ろしい、恐ろしい、
Scott Wlaschin
英語はこちら
Feeling that what have I? What have I missed? I might have missed something and I've broken it by mistake. I never get that feeling with F#, but I used to get.
何か見逃したのではないか?何か見逃して間違って壊してしまったのではないか?という感覚。F#ではその感覚を持つことはありませんが、
Ed Mann
英語はこちら
That feeling with Python quite a lot. No, it's interesting. I mean, it's the guardrails, isn't it? And it's the, you know, it's the fact that you've got this ability and this looseness that then, I mean, it's a joke with Python.
Pythonではその感覚をよく持っていました。興味深いです。ガードレールですよね。この能力と緩さがあることで、Pythonでは冗談のようになっています。
Scott Wlaschin
英語はこちら
Like there is types in Python, I know they it's not very strict on There are now. Yeah, when I was doing Python then there wasn't, but there are now. But again, to be compatible, everything has to be typed and there's all these backdoors. I mean, if I'm using a piece of Python code, how do I know that?
Pythonには型があります、今はあります。私がPythonをやっていた頃はありませんでしたが、今はあります。しかし、互換性のために、すべてに型を付ける必要があり、多くの抜け道があります。Pythonコードを使うとき、どうやって知ることができるでしょうか?
Scott Wlaschin
英語はこちら
Forming. How do they?
どのように?
Ed Mann
英語はこちら
He's going against the grain again. Isn't it the language? Exactly. I think that's the view of a language like these multi paradigm languages or calling Sanka multi parallel language. Like we're the best of everything. You can't be the best of everything. Like you have to make decisions upfront.
また木目に逆らっています。言語の問題ですね。その通りです。マルチパラダイム言語と呼ばれるものの見方だと思います。すべての最良を持つことはできません。前もって決定を下さなければなりません。
マルチパラダイムプログラマー
Scott Wlaschin
英語はこちら
Right. And so I actually think the programmer should be programmers should be multi paradigm. If I'm going to work with a database, I should use SQL. I don't really like using Orms. I just want to write my SQL directly because I know exactly what I'm getting. If I'm doing functional programming, I want to use a functional programming.
その通りです。私は実際、プログラマーはマルチパラダイムであるべきだと思います。データベースを扱うならSQLを使うべきです。ORMを使うのは好きではありません。直接SQLを書きたいです。何を得ているか正確にわかるからです。関数型プログラミングをするなら、関数型プログラミング言語を使いたいです。
Scott Wlaschin
英語はこちら
Want to do functional programming in JavaScript, You know, I'd rather write it in F and transpire it to JavaScript. And if I'm doing logic programming, I want to do it in Prologue or whatever. It's not that hard to learn lots of different languages. I think first of all, I think it's actually good for your brain to learn lots of languages. I have a whole talk about that as well. It's like why, you know, people should learn lots of languages. I think as a programmer, being stuck with only one language is actually bad for your skill set. You know, you should be, you should have a, just like any tradesperson will have a, you know, a bunch of tools. You have a screwdriver and a hammer.
JavaScriptで関数型プログラミングをしたいなら、F#で書いてJavaScriptにトランスパイルしたいです。論理プログラミングをするならPrologueなどを使いたいです。多くの異なる言語を学ぶことはそれほど難しくありません。実際、多くの言語を学ぶことは脳に良いと思います。なぜ人々が多くの言語を学ぶべきかについて話もあります。プログラマーとして、一つの言語に固執することは実際にはスキルセットに悪いと思います。職人がツールを持つように、ドライバーやハンマーなど、
Scott Wlaschin
英語はこちら
Wrench and stuff. As a programmer, you should have a bunch of tools just like if I need, I'll use SQL for this and I'll use object oriented for this and I'll use functional for this and I'll use, you know, Python for this. I'm doing data science something, I use Python. That's fine, you know, whatever, but don't think I have to do everything in one language. I think that's a bit short sighted myself, but I mean, I can understand why people do it. A lot of people, they only want to learn, you know, you learn the whole framework and stuff and the environments.
レンチなど。プログラマーとしても、ツールのセットを持つべきです。SQLをこれに使い、オブジェクト指向をこれに使い、関数型をこれに使い、Pythonをこれに使います。データサイエンスをするならPythonを使います。それで良いのですが、一つの言語ですべてをやらなければならないと考えるべきではありません。それは少し近視眼的だと思いますが、人々がそうする理由は理解できます。多くの人々は、フレームワーク全体や環境を学びたがります。
Scott Wlaschin
英語はこちら
The ecosystem. So you want to do everything in C#, You want to do everything in JavaScript, I mean.
エコシステムです。C#ですべてをやりたい、JavaScriptですべてをやりたい、
Ed Mann
英語はこちら
I can sort of sympathise with that. Yeah, it kind of, it solves the problem good enough, but not to the best. And I think, you know, when I look at it from a business hat point of view on, it's like if you have a lot of languages in your stack because they were the right that Dow is trying to hire people with these things. It's like, you know, hey, we're a Python shop. And then you think that's the thing. It's like you think, hey, we're a Python company. It's like, wow, you literally are just a Python company. Like, you know, you're not solving as you say, you're not saying like, well, actually we probably should be.
それには同情できます。問題を十分に解決しますが、最良ではありません。ビジネスの観点から見ると、スタックに多くの言語があり、それらが正しい選択だった場合、それらのスキルを持つ人を雇うのは難しいです。「私たちはPythonショップです」と言います。文字通りPython会社なのです。解決すべき問題に対して最適な言語を選んでいないのです。
Ed Mann
英語はこちら
May be a functional programming language here or it may be really useful to, you know, to delve into that. It's like, no, we're just this, but it's because of maybe hiring reasons and stack reasons, like all.
ここでは関数型プログラミング言語が適切かもしれません、それに深く入ることが本当に有用かもしれません。しかし、いいえ、私たちはこれだけです。雇用の理由やスタックの理由で。
Scott Wlaschin
英語はこちら
These types of, but this goes to that we define ourselves by the programming language we use, not by the domain we're expert in and not by the tools that we have in our toolkit. So it's just funny. Programmers are, you know, I mean, I can't imagine a plumber saying I only work in plastic pipe. I never do metal pipe. Maybe they do.
私たちは使用するプログラミング言語で自分自身を定義し、専門分野やツールキットのツールで定義しません。面白いことです。配管工が「私はプラスチックパイプでしか作業しません。金属パイプは決して扱いません」と言うのを想像できません。
Ed Mann
英語はこちら
I don't know. Well, I was going to say like Worcester boilers or something. I guess they do.
わかりません。ウスターボイラーとか何かと言おうとしていました。たぶんそうです。
Ed Mann
英語はこちら
Actually think you know about. I only handle.
実際、私は扱うのは、
Scott Wlaschin
英語はこちら
These types of toilet, no, but no boilers like gas boilers versus electrical boilers, that is a different domain and it's a different knowledge. But that's my that's the domain knowledge. Yeah. I'm talking about someone who only works with plastic pipes and someone who doesn't work with copper pipes. And it's like, that's like two different programming languages that achieve exactly the same thing. And it's like as a plumber, I would expect to say, well, this situation calls for a copper pipe. This one calls for a plastic pipe, and this one calls for, you know, a metal pipe or whatever, you know, but it's like you, you use the right tool for the job.
これらのタイプのトイレ、いいえ、ガスボイラー対電気ボイラーのようなボイラーは、異なるドメインであり異なる知識です。それはドメイン知識です。私が話しているのは、プラスチックパイプだけで作業する人と銅パイプで作業しない人のことです。それは全く同じことを達成する2つの異なるプログラミング言語のようです。配管工として、この状況では銅パイプが必要、これはプラスチックパイプ、これは金属パイプが必要と言うことを期待します。適切なツールを使用するのです。
Scott Wlaschin
英語はこちら
It's shocking to me that's like I, you know, someone who say I only ever use plastic pipe and copper pipe people is too complicated. I mean, I can't imagine that other people saying that kind of.
「私はプラスチックパイプしか使わない、銅パイプは複雑すぎる」と言う人がいることに衝撃を受けます。他の人々がそのようなことを言うのを想像できません。
Ed Mann
英語はこちら
But we say we very much do.
でも私たちはまさにそう言います。
Scott Wlaschin
英語はこちら
Though you're so I only ever use JavaScript, you know, and I would never use another language. I can't imagine saying.
「私はJavaScriptしか使わない、他の言語は決して使わない」と言います。そんなことを言うのを想像できません。
Ed Mann
英語はこちら
That anyway, it's so boring as well. There's so much out there, that's the thing. There is so much interesting stuff out there.
とにかく、それはとても退屈です。そこにはとても多くのものがあります。とても多くの興味深いものがあります。
Scott Wlaschin
英語はこちら
Yeah, exactly. I'd like to learn. I like to learn new things. Part by part of my reasons of being a programme is I like to learn new things. I've always.
その通りです。学ぶのが好きです。新しいことを学ぶのが好きです。プログラマーである理由の一部は、新しいことを学ぶのが好きだからです。
Scott Wlaschin
英語はこちら
To learn new things. And if you're a programmer who doesn't like to learn new things, I think it's a little bit suspicious.
新しいことを学ぶのが好きです。新しいことを学ぶのが好きではないプログラマーは、少し疑わしいと思います。
Ed Mann
英語はこちら
Well, that I mean, that's the thing, because also the learning new things is not only tech stacks, languages, programme, it's also the problems you get to solve. Like we're very lucky, as you say, you dive into these companies, these businesses and you're able to learn all these interesting things, right? Like it's amazing.
それは重要なことです。新しいことを学ぶというのは、技術スタックや言語やプログラムだけでなく、解決する問題についても学ぶことです。私たちは非常に幸運です。これらの会社やビジネスに飛び込んで、これらすべての興味深いことを学ぶことができます。素晴らしいです。
Scott Wlaschin
英語はこちら
Yeah. I mean, I loved. I loved. I loved. That's one of the reasons I love domain design. I like, I learned a lot about how you do skin care formulations. I learned a lot about how you do tax law. I learned a lot about, you know, I'm not an expert.
はい、私は大好きです。ドメイン設計が大好きな理由の一つです。スキンケア配合について多くを学びました。税法について多くを学びました。私は専門家ではありませんが、多くを学びました。
Scott Wlaschin
英語はこちら
But it's not interesting to me to learn how these people are expert in their domain. I find that.
しかし、これらの人々が自分のドメインでどのように専門家であるかを学ぶことは私にとって興味深いです。
Ed Mann
英語はこちら
Fascinating. I think that's definitely a mindset thing. And I think again, not everyone's not got that mindset. It doesn't mean you're a programmer that you've got that mindset. It's just yeah, kind of certain people and as you say, you can be very.
魅力的です。それは確実にマインドセットの問題だと思います。誰もがそのマインドセットを持っているわけではありません。プログラマーだからといってそのマインドセットを持っているとは限りません。特定の人々だけです。
Ed Mann
英語はこちら
Excited by it. Yeah, absolutely. Yeah, yeah. So we're talking about functional languages, a little bit more programming languages, like I'm just wondering maybe it would be good before we delve into the DDD side of things with this and apply that. It's like talk about some of the ways you do solve certain aspects. So if you're coming from an OO background.
それに興奮することができます。絶対にそうです。関数型言語についてもう少し話していますが、DDDの側面に入る前に、特定の側面をどのように解決するかについて話すのが良いかもしれません。OOバックグラウンドから来ている場合、
(2)-2 はこちら
(2)-3 はこちら
Discussion