• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Five Lines Code:functional design pattern

 
Greenhorn
Posts: 27
Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christian!!, do you use some examples of functional design in the book?.  what's your favorite characteristic in TS?
I think I could your book to learn type system with Kotlin ,

BR from PY.


 
Author
Posts: 31
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Enrique,

Thank you for your question.

I wasn't familiar with functional design, so my quick study of it may not be sufficient to answer your question. Although I agree with the single responsibility and low coupling these are quite abstract concepts, my book aims at providing rules that will yield the same benefits but without judgement. Single responsibility eg. arises from encapsulating things about specific data (ie. variables). It is probably something we could discuss at length, and I likely will do a conference talk about it at some point.

I cannot choose only one favorite characteristic in TS:
* Ease of adoption
* Union and intersections types
* Its type inference
 
Marshal
Posts: 70234
282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does TS (I presume that means TypeScript?) infer types? Is it strictly typed, like Java┬«? I have tried strictly‑typed languages, and Forth which is type‑free and can give all sorts of strange errors because it doesn't notice wrong types until runtime.
 
Christian Clausen
Author
Posts: 31
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TypeScript is actually much more strongly typed than Java. In fact, I discuss this quite a bit in the forthcoming chapter 7.

I have worked with both very strongly typed languages like Coq, and untyped languages like Scheme. There are some fancy (mostly theoretical) tricks you can do in untyped languages which are not possible in typed languages, such as writing a decompiler in the language itself. However, in practice, if the community is good, and developers are disciplined it doesn't change much. Unfortunately, it seems a lot of especially young programmers lack a strict discipline, and then untyped code becomes a nightmare to maintain. This is my main concern with python, the culture for copying and pasting, with no regard for architecture or safety scares me. I think you need either discipline or types to build and maintain large systems.
 
Campbell Ritchie
Marshal
Posts: 70234
282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. Last time I tried any compiler writing, my supervisor kept asking about things like READ, which allows direct input, but I was convinced that would violate the strict typing I had implemented. Also he had the notion that people would only use languages in a responsible fashion and I took a much more jaundiced view of users' likely actions
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic