by zvrba · 7y ago · 0 comments
> 1. Create a language to solve your problem; > 2. Solve your problem.
belongs mainly to Lisp and Smalltalk. Each time you define a method or a class (C#, Java, C++), you're extending and defining your "language".
I'm the leader of a 2.5-developer startup, we use C++, Java and C# for different purposes, and I have not once thought "shit, we'd be so much more productive if we used XXX instead of C# or Java" (C++ being the exception). Because the real problems are around the business domain. Understanding customer needs, wrapping our heads around Azure AD, etc, etc, etc.
The programming language has ZILCH to do with our challenges and I do not feel hampered by PL during refactoring either -- thanks to static types.
I have some regrets, and these go against frameworks we decided to use (EFCore, i.e., ORM, being the biggest regret of mine).
Programming language? Almost not a factor. I'm happy with all of the 3 we use, though I'm least productive in C++ due to the amount of ceremony needed -- header/implementation files, linkage, fixing preprocessor mess by variations of PIMPL (looking at you windows.h), slow compilation, etc, etc, etc.
If anything is indispensable for our productivity, it's a good ide and becoming comfortable with its capabilities.
One mostly only adds new words to these languages: nouns and verbs. With Lisp you can add new syntax as a user as part of the program. This allows us to do code transformations at compile time as part of a program. This allows us relatively straight forward to generate more complex code from simpler descriptive code.
"With Lisp you can have any syntax, as long as it looks like Lisp."
CL-USER 14 > (loop for i from 0 below 10
sum i into isum
when (evenp i) sum i into evensum of-type integer
else when (oddp i) sum i into oddsum
finally (return (* isum evensum oddsum)))
22500It's what EFCore does, translates C# method calls into SQL statements via lambdas bound to expression trees.
So, no, LISP is not special in that regard.
It's just MUCH MUCH easier, standardized and widely used.
For routine code generation, there are even simpler T4 templates. That one gets as easy as one could want.
> standardized
So are expression trees: https://docs.microsoft.com/en-us/dotnet/api/system.linq.expr...
> and widely used
By what statistics?
At other times, too little control over how the query is translated to SQL, or DB features not being exposed. With time the frustration piles up..
EDIT: I'd be OK with a light-weight ORM, like stuff these columns into these fields of that class. Leave the rest to me. Though EFCore got a bit better with support for query types so I can map classes to views / stored procedures and do the "real" work there.
You can't run (as far as I'm aware) things like query analyzers like I can with SQL to get execution plans.
It can be an absolute nightmare to debug. Like proper hell that where you can lose a day or so over something that ends up being stupidly simple.
I hate it and would choose just doing SQL with a plain ORM anyday over ever touching EF again.
When I was using it it also had poor support for immutable types. I imagine this has got better.
You should also have database profiling tools in your disposal at all times, regardless if you use an ORM or just raw SQL.
ORMs are great when used sparingly and properly. For a bunch of normal crud operations they are great because they get rid of a lot of boilerplate code.
Also as with any ORM you can always drop down to raw sql in the situations that require it.