Comments (15)
@igaray y @jfacorro can you help me on this while i finish gutenberg code?
You can use https://github.com/unbalancedparentheses/genserver-gutenberg-generator and https://github.com/unbalancedparentheses/supervisor-gutenberg-generator as examples for file generation.
from gut.
@unbalancedparentheses I can do gen_fsm
, gen_event
and lasse cowboy
. I'm not really sure what worker_pool
is supposed to include.
from gut.
@jfacorro lets sync up in the gitter room
from gut.
@unbalancedparentheses @jfacorro
please review two new generators:
https://github.com/igaray/cowboy-rest-basic-gutenberg-generator
https://github.com/igaray/cowboy-rest-full-gutenberg-generator
from gut.
No records please. In 99% cases they are superseded by maps. Since gut needs Erlang 17, we can use them.
from gut.
I think it is better to add the comments of what a function do in top of the header of the function and not inside of it:
https://github.com/igaray/cowboy-rest-full-gutenberg-generator/blob/master/name.erl#L73
from gut.
I disagree, as you said, maps do not replace all record use cases, and IMHO maintaining process state is precisely the 1%.
edit: comments moved outside of functions.
from gut.
Why a reacord would be better for managing the state of a handler? It has the same feautres as a map but with much more cubersome syntax. Cowboy 2 will even use maps as the default.
We were using maps for managing state in all the new projects. Even brujo was the one that told me to migrate everything.
from gut.
Why the long wait? - we wanted maps to be a replacement for records and to be as efficient as records, and its not blindingly obvious how to do so.
https://joearms.github.io/2014/02/01/big-changes-to-erlang.html
from gut.
"Maps is the only dynamic key/value data structure in Erlang that we can match directly to extract values, allowing users to greatly simplify their code as they don't need to call functions to do everything anymore."
http://ninenines.eu/articles/cowboy2-qs/
Maps let's you code the same thing a lot less lines of code and you with a better syntax than records.
from gut.
The only advantage of the records is that all keys are known at compile-time. In a LOT of cases you do not know all the keys at compile time in a http handler.
from gut.
I think using maps makes the code a lot more readable. In my opinion there is no advantage to using records over maps, at least not when maintaining a process' state. Records are awkard to work with, maps are more flexible in all regards. There might be some use cases where records are preferable to maps, but I can't think of any.
That said, at the end of the day, 'tis all love.
from gut.
We need an elli https://github.com/knutin/elli project. @jfacorro can you create one?
from gut.
You can check: https://github.com/unbalancedparentheses/tinyerl/tree/master/elli
from gut.
@jfacorro let me know when you have done elli project, gen event and worker pool so that I close the issue
from gut.
Related Issues (20)
- create module for dealing with paths
- create module to do the cleanup only in one place
- Correct logs to make them useful
- Delete LICENSE and .gitignore files if present. HOT 1
- Allow users to star generators using the gut command
- gut executable is not deleted on linux
- Write better README
- Support parallelization
- Homebrew formula
- Change user by owner in gut find
- Change find command by search command
- Erlang 17.0 not working HOT 2
- timeout error HOT 3
- refactor thorerl to have a task dir
- Change gut find to gut search
- a way to ask for specific tags or branches for a generator
- Use rebar3 syntax generators
- port to go and generalize HOT 3
- repository 'https://github.com/unbalancedparentheses/yamerl.git/' not found HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gut.