While it's a good idea, I feel like it should rename with real words, or not rename at all. From the example: function(bedad, latay, vublu) { if (!adag(this, "on", bedad, [ latay, vublu ]) || !latay) return this; this._events || (this._events = {}); var cyem = this._events[bedad] || (this._events[bedad] = []); bedad, latay and vublu don't make it much easier to remember which variable is which than just using a,b,c
I forked the original to address this [1]. Here's a sample: var strategy = moduleInterfaceFactory.Events = { on: function(strategyFacade, strategyFactoryDecorator, interfaceFacade) { if (!flyweight(this, "on", strategyFacade, [ strategyFactoryDecorator, interfaceFacade ]) || !strategyFactoryDecorator) return this; this._events || (this._events = {}); var strategyPattern = this._events[strategyFacade] || (this._events…
Show HN: Beautify-with-words unminifies JS with unique words for variable names
31–35 of 35 posts
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#32I've always wondered what coding is like for those who don't speak english, or only speak a little. I imagine it's something like working with code beatified by this tool. Almost every codebase is filled with english verbs and nouns. They are one of the primary tools for making source code readable by humans, not just machines. Very cool tool.
The biggest benefit of being an english native speaker is that most resources on the web are in English(docs,articles,videos). And since being a developper is about learning new things all the time, it's easier to learn about new technologies or tools when one can read english articles or documentations.
My english (writing and speaking) is horrible but i force myself to read english docs on a regular basis,because it's just mandatory today.
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#33While it's a good idea, I feel like it should rename with real words, or not rename at all. From the example: function(bedad, latay, vublu) { if (!adag(this, "on", bedad, [ latay, vublu ]) || !latay) return this; this._events || (this._events = {}); var cyem = this._events[bedad] || (this._events[bedad] = []); bedad, latay and vublu don't make it much easier to remember which variable is which than just using a,b,c
I'm the author. Since "a", "b", "c" get recycled by different scopes, it makes it really hard to figure out which "a" you're looking that. By having unique names, you can easily spot where one variable is used exclusively. I was going to use a dictionary but I didn't want the tool to be language specific or run into unsavory words.
†http://www.census.gov/genealogy/www/data/1990surnames/names_...
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#34Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#35Earlier quoted context omitted.
You might find ngmin[1] helpful for that. Then you can use the shorter injection syntax and have it expanded via a compilation step. Since you mentioned Grunt, you'd probably want to just use grunt-ngmin[2]. [1] https://github.com/btford/ngmin [2] https://github.com/btford/grunt-ngmin
How I never found that.. thanks! That is going to save us a world of pain in debugging.