Full-time web dev; JS lover since 2002; CSS fanatic. #CSSIsAwesome I try to stay up with new web platform features. Web feature you don't understand? Tell me! I'll write an article! He/him
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
What I do is, whenever I code something that I know is very similar to a previous thing I make it a template. Surely, it takes more time to create one in the beginning but you regain that when when you use it a third and fourth time. The time efficiency can get ridiculous!
It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
I'm in the "snippets are a symptom of poor organization" camp. If they're big, they should be dependencies; if they're small, it adds about as much cognitive load to remember that they exist and how to apply them as it does to type whatever it is out from scratch.
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
In my opinion snippets are very useful in frontend where you have a lot of HTML accompanied by some boilerplate JavaScript.
But for backend I find very rare occasions to use them. Only when I create new REST calls or implement some fairly boilerplate code that talks to the database we need such things... although that is a limitation of the technologies we use.
Maybe frontend will get there at one point in terms of redundant code but for now, snippets are a decent alternative.
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
The project currently has hundreds of controller/directives/service all made in AngularJS. It isn't very feasable as long as it is supported by the authors. Maybe in 10 years... who knows?
Thanks for the suggestion! I also think AngularJS is a bit rusty and the newer frameworks are better ;)
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
Our application was written in CoffeeScript (per my suggestion) and I was the one most involved in porting it to JavaScript. Maybe that would be an interesting story to tell. Who knows?
We are also porting old AngularJS code to the new standard (AngularJS 1.6/1.7) and that was also a point where you can notice how the framework evolved.
Interesting! I know the feature but never really used more complex snippets. But I use a text-expander to transform "colog" into "console.log('');" and the ALT-SPACE-space into a regular space.
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
I didn't know about this feature! 😲But now I'm trying to think how I would actually use it, haha.
Am I correct in assuming the $1 and $2 in the last example mean you can tab over to the next location? That would be super useful!
That is exactly it! And if you have $1 multiple times, you'd be editing them simultaneously! It's awesome
Now that right there is a game changer
You can even name each tag so you don't just work with numbers. It's a million times faster to be using them.
PhpStorm does this quite nicely too, but I just started to use it, so only one from my side (syntax out of config):
That looks good!
What I do is, whenever I code something that I know is very similar to a previous thing I make it a template. Surely, it takes more time to create one in the beginning but you regain that when when you use it a third and fourth time. The time efficiency can get ridiculous!
I'm in the "snippets are a symptom of poor organization" camp. If they're big, they should be dependencies; if they're small, it adds about as much cognitive load to remember that they exist and how to apply them as it does to type whatever it is out from scratch.
Do you work on backend or frontend?
Both, although my preference is very much for backend and infrastructure.
In my opinion snippets are very useful in frontend where you have a lot of HTML accompanied by some boilerplate JavaScript.
But for backend I find very rare occasions to use them. Only when I create new REST calls or implement some fairly boilerplate code that talks to the database we need such things... although that is a limitation of the technologies we use.
Maybe frontend will get there at one point in terms of redundant code but for now, snippets are a decent alternative.
Following are some Sublime snippets I use for my daily work
gist.github.com/bhaveshf-cuelogic/...
Hi there, from your html snippet I notice that you still use Angualar JS, try vue. I made the switch about a year ago and I am never going back.
The project currently has hundreds of controller/directives/service all made in AngularJS. It isn't very feasable as long as it is supported by the authors. Maybe in 10 years... who knows?
Thanks for the suggestion! I also think AngularJS is a bit rusty and the newer frameworks are better ;)
Sure, but do let us know if you decide to port it Vue, would love to know your experience in porting.
Our application was written in CoffeeScript (per my suggestion) and I was the one most involved in porting it to JavaScript. Maybe that would be an interesting story to tell. Who knows?
We are also porting old AngularJS code to the new standard (AngularJS 1.6/1.7) and that was also a point where you can notice how the framework evolved.
Interesting! I know the feature but never really used more complex snippets. But I use a text-expander to transform "colog" into "console.log('');" and the ALT-SPACE-space into a regular space.
That's a great use case. I might even borrow that idea!