« first day (1714 days earlier)      last day (3237 days later) » 

2:00 PM
@argentum47 yep, show me a better pattern, and I'll adopt that instead. I have been using this very same pattern for loaders-support for the past 2.5 years.
 
@ElliotBonneville how do humans express emotion?
everyone is different.
 
We anthropomorphize them, like we do with a lot of pets.
 
@rlemon well yeah but people have like. faces and things that we understand. I don't even know what there is to anthropomorphize on a fish.
even cats and dogs can sorta smile
it's easier to pretend they can, anyways
 
"he thinks he's people!" .. "no.. he whats that hamburger meat you are holding"
 
fish turn colors, change position, swim differently, hide, etc.
if my puffer is black, he's pissed.
 
2:01 PM
if you think your cat is smiling at you..
 
if he's curled into a ball, he is scared.
 
shoot ink
 
if he's swimming at the top of the tank back and fourth, he wants attention
 
well. not fish..
 
puffers must be pretty sophisticated, then. huh.
 
2:02 PM
hint: a lot of salt water fish are
it's common fresh water plebs people always think about when they think fish
idk why, salt water makes up more of the fish.
 
@ElliotBonneville You speciesist.
 
¯_(ツ)_/¯
 
@FlorianMargaine ping: dystroy.org/miaou/20
 
use a \ on the left arm
 
2:05 PM
@Luggage I did.
It's not visible.. :/
 
ah
 
¯\_(ツ)_/¯
 
I wonder if salt water people would be smarter too
 
you are a salt person. your blood is roughly the same salinity as seawater
 
There are salt water people.
 
2:08 PM
neat
 
reef fish need to be smarter. reefs are a tough place to live without cooperation from other fish, communication (however primitive) and a decent set of smarts.
fresh water fish are like "okay, swim swim swim, do it, die"
 
that's actually really fascinating, rlemon.
 
so the reef is like the ghetto and the fresh water is like starbucks?
 
no reefs are like the working world, freshwater is college.
4
 
^ lol
 
2:10 PM
lol
 
Is this a good place to hang if you wanna learn Node.js?
 
yes
 
@Gemtastic the bestest
 
but the best way to learn node.js is to use node.js
 
We live and breather node stuff.
 
2:11 PM
more accurately we take breathers from node stuff here
 
oops, i'll just leave it.
 
@ElliotBonneville :D
@rlemon Oh, I am
 
@uselesschien cool
 
But it's nice to get some tips on what stuff to try/read/derp/whatever
 
require('http').createServer(function(req, res) {
  res.writeHead(200, {
    'Content-Type': 'text/plain'
  });
  res.end('Hello Gemtastic!');
}).listen(80);
 
2:12 PM
It looks really easy to do website applications in node. Kinda makes you wonder why not everyone is using it :')
 
done and done
 
well, I love node but it isn't a silver bullet because nothign is.
 
node is great. does all things (if you have patience and booze)
 
but yea.. it can be a good choice for a wide range of apps.
 
Naming a function instead of making it anonymous I've been "told" is a better convention. Your thoughts?
 
2:13 PM
depends on why they say so?
 
@Luggage The right tool for the right thing
;)
 
sometimes helps with stack traces.
 
true, but don't bend over backward to do it constantly. sometimes a small anonymouse funciton is more readable
 
I should get a bullet made out of silver, just so when someone says "there are no silver bullets" I can be like "oh yea!?".
 
IE had a memory leak issue.. but not anymore
 
2:14 PM
@rlemon nicer looking code
 
@Gemtastic not always
arr.sort(function(a,b) {
  return a - b;
});
why would I need to name that... and then worry about naming collisions in the future?
 
Do we have a lot of anti semi-colon slavery in the Node.js community?
 
there is no point.
 
Hello
 
And quite recently Chrome is making the "name anonymous functions" thing much less important; it's dev tools have gotten a lot smarter about identifying functions
 
2:15 PM
^
 
@rlemon I agree with that, and I was kinda asking so I'd know if it was ok for me to write code like that
 
@rlemon Can I ask your opinion on something?
 
When do I use this instead of the passed argument with .map()?
 
sure, but I reserve my right to ignore it :P
 
2:15 PM
no, semi-colons are highly suggested. JS will 'insert' them for you but it's not always right.
 
Can you not do this in async callbacks? done(null, callbackObj.getRates())
 
ASI is an error correction routine. don't rely on it in your code.. that is just admitting you know your code sucks but the engine will deal with it.
don't write shitty code.
 
@Gemtastic I hate those who're too lazy to insert some fucking semicolons.
 
I contributed to a codebase once whose policy was "only insert semi-colons where strictly needed". I think they're crazy.
 
2:17 PM
it's not even that much work to include semicolons.
 
There are some strange bugs that can happen without semi-colons and it's not always clear. I think the one single piece of advice I can give it to always try to write complete, well formatted code.
 
@uselesschien Java is my native language so semicolons are innate to me, but I'm not immutable when it comes to other languages
 
@rlemon I wish to display a table of data from mySQL, I also wish to filter it. Now I can re-query the database with new filters applied or I can just grab the whole table and filter with JS and filter it in an array. Which is better?
 
@StephenWolfe depends on your situation, and which is more expensive, querying the database or filtering with JS
 
omitting semi colons is like not wiping your ass after using the bathroom. sure you can do it, but everyone is going to notice your reek every time they are near you (or, your code)
 
2:18 PM
Table is about 100k rows
 
^ also you will get unexplained... bugs
 
@rlemon I love your way of describing things XD
 
@StephenWolfe if you plan on showing the entire set to the user as a default pull it and store in memory
 
then don't re-query
 
2:19 PM
Well, the arguments I heard is that the bugs are pretty much non-existing in modern browsers and in Node
 
unless the data can change while they are viewing
 
Actually its paginated
 
then it is upto you
I personally would query
db's are much faster today (and were never really THAT slow)
 
I don't swallow things straight off from only one source though, that's why I'm asking :P
 
i agree. 100k rows is a lot. query.
 
2:20 PM
@rlemon well I was going to query any way and then if JS is enabled let it use js
 
@Gemtastic Follow the best practices.
 
if you're query is ordered and the DB is indexed for that order you can do paginated ones fairly efficiently
 
Okay great I will leave it to mysql
 
@Gemtastic ask yourself what makes sense? saying "fuck you breaks my airbags got this" or just slowing down before you hit the light post?
because that is ASI (the air bags)
@StephenWolfe use postgres
 
@uselesschien Well, what they are is what I'm trying to distinguish.
 
2:21 PM
@rlemon the data is in a WordPress DB
 
@rlemon I can't do that. Sadly a lot of communities think kinda dumb things are awesome and refuse to change. Not all programmers are logical :/
 
sorry
 
@StephenWolfe well that is your third strike.
 
2:21 PM
@Gemtastic YOU choose to contribute to those communities. don't.
there are many many many more sane ones.
 
@Gemtastic The thing is it has already been done. shop.oreilly.com/product/9780596517748.do
 
@rlemon I know, but I still have to ask to find out.
 
the overwhelming consensus is to always use semi colons. even Eich thinks ASI was probably a mistake.
 
I'm still a bit of an empty canvas when it comes to coding. What are the best practices? Why? What do I want to do? What is the best way of doing things?
 
Advice #2: Avoid jQuery. Use it when you have to or when it's a dependency of somethign else you wan tot use. You can't avoid it altogether. Just don't think jQuery is the solution to all your browser DOM manipulation.
 
2:23 PM
I lack the experience to decide a lot of things for myself since I haven't been faced with all the possible situations yet
 
avoid libraries until you know how they work, unless it's something really really practical. this includes jquery, etc.
 
@Luggage I feel at home with that advice <3
 
unless the library is moment.js
because Dates in JS fucking suck
 
right.. you are better able to choose a library after you've tried it and know what to look for
 
moment.js = really really practical
 
2:24 PM
I'm actually using moment already :D
feels pretty welcome in this community already
 
If a page is already using Jquery is it not acceptable to use it instead of vinilla js
 
depends.
$(this).prop('id'); // GTFO
 
jQuery is great c:
because it does all the things
 
$(this).val(); // also no
 
GTFO?
 
2:25 PM
So great JS has been written in jQuery
@StephenWolfe lol
 
jQuery is a pretty cool guy; he doesn't afraid of anything
 
Do you know some tutorials/reads you think are important for increased quality in the development for node?
 
@StephenWolfe If you are contributing t a project hat uses jQuery, follow the project standard.
 
but what if jQuery were not kill?
 
There are times you get to choose, and times you do it the project owner's way or get out.
 
2:26 PM
!!s/not/to/
 
@uselesschien That didn't make much sense. Use the !!/help command to learn more.
 
@StephenWolfe GTFO === Get the Fuck Out.
 
@uselesschien but what if jQuery were to kill? (source)
 
@rlemon ahh thought it was something like that.
 
I've watched and read a few tutorials, but it's all very low level and all caters to websites and I'm more interested in the backend part that isn't related to frontend web.
 
2:26 PM
I use jQuery at work because I was too lazy to write the utility methods I needed.
but I know the tradeoffs.
 
Do you think learning Node.js is a good career choice for a Java developer?
 
and I bet you don't chain 20 calls together and use it to generate/manipulate a bunch of dom at once
 
oh mah gawd the chat
o/
 
I have so many questions
 
@Gemtastic sure
 
2:27 PM
FRiDAY wut
 
@Loktar o/
 
Node.js is a good career choice, period
 
Loktron
 
at least right now.
 
destroyer of worlds
 
2:27 PM
lol
 
even if you do front-end only, node.js will likely be involed in your build process.
 
I use to hate JS ten years ago so much that I refused to add it to my web pages, then Query came along and I finally had the patiences to learn
 
Loktari Odinson
 
@rlemon I did the thing
 
2:28 PM
@rlemon die
 
@rlemon AH!
 
/me dances
 
@rlemon Do you mean that out of the point that I can develop in two markets or that I get the better of two worlds? I can make Java apps and Node apps for whatever they are the most suitable to be built in?
 
@StephenWolfe patients don't learn things, they usually just die
 
@rlemon not today
 
2:28 PM
HAHAHAHAHAHAHA
who flagged friday?
 
there may come a day when I accidentally click on black friday, but it is not this day
 
BRO! DO YOU EVEN CEREAL?!
@Gemtastic no, learning is always good.
 
I've clicked on so on so many black friday's but not that one.
 
5 things that everyone should know about Node.js http://bit.ly/X4rgke
 
2:29 PM
not clicking
 
T_T
 
I clicked that one :(
 
not. clicking.
 
I probably played that card too early
 
@NickDugger fuuuuuuu
 
2:29 PM
always click all links
 
I have yet to actually hear the friday song
 
@Gemtastic Good.
 
best advice
 
I have no idea how it goes
 
You aren't a node developer until you hear it.
 
2:30 PM
@NickDugger yes, exactly what I expected it to be
 
@Luggage You're not the boss of me.
 
You're right. I hire people with more experience.
 
:)
 
Hey, with Git, what will it mean if I merge master into a branch under PR to catchup with latest features?
 
2:31 PM
 
PR = some branch? you can merge master into a branch to catch up
 
@Luggage PR = pull request
 
that's normal. If it's a pull request to someone else, they may require that it's up-to-date with master to merge it back to master
 
that way YOU do the work of merging and their final merge is just saying "ok, i'll take that"
 
2:32 PM
@Luggage they should require that
otherwise you introduce a lot of risk with the upstream handling merge conflicts
we require that at work before you file a MR
 
simple branches like fixing a typo acn just be merged back, but yea.. anything non-trivial I merge master -> branch first.
 
hallo tiny internet shapes
 
@AwalGarg hallo :D Wie geht es dir?
 
wie what again?
 
Meh :(
 
2:34 PM
don't leave me curious now :(
 
I asked if you wanted to ead
Soo... Project architecture in Node? Any standards?
 
guys learn how to troll better
shortened links are stupid
 
hmm not bad, 8/10
 
@Gemtastic Too broad of a question. Lots of good patterns but it depend what you are doing.
Just write code and be prepared and willing to refactor as you learn more. You'll never write a nicely organized app the first try without going back and refactoring
 
2:37 PM
@Luggage Backend applets that has nothing to do with frontend
 
user1596138
Err
 
!!rebecca
 
@uselesschien That didn't make much sense. Use the !!/help command to learn more.
 
@Luggage Well, that's a given, but I still wanna at least try :P
 
@Gemtastic write a chat system with node + express + websockets + postgres
 
user1596138
2:37 PM
^ I did that
 
that should be a good starting point
 
user1596138
And then socket.io
 
@rlemon I've done that
 
Maybe it's just how bitbucket does diffs, but I never merge master->branch, unless there's conflicts; it's just an unnecessary commit.
 
postgres for chat? I'd use redis.
 
2:38 PM
@Gemtastic okay, now post it and get some feedback
 
But I'm learning MongoDB
 
We will tear that shit apart.
j/k :)
 
best way to improve is to write a lot of code, and let other people pick it apart.
 
@Luggage or both ;)
 
mongo is shit
:P
 
2:38 PM
mongo is good
 
no, mongo is shit
 
@rlemon Oh, well.. I followed a tutorial so that doesn't give much >_>
 
well. if you use like, mongoose it's good
 
@DenysSéguret true. redis for halding live clients and postgres for the persistent log (and other metadata)
 
no, mongo itself is seriously flawed
 
2:38 PM
@rlemon I don't have an option on that I'm afraid since we use it at work
 
@Gemtastic I started a projec ton mongo and then realized I had no use for it's unique features and was only paying for it's oddities
 
postgres is great and does all things.
 
I'd use redis as well for a simple chat. Working with pub/sub gives you confidence.
 
@Gemtastic start talking work into using a database
mongo will screw you over, probably sooner instead of later
 
@Luggage Cool story bro, but that's not really an advice or an argument O.o
 
2:40 PM
depends on what you're trying to do with Mongo
 
@rlemon agreed. I've used Postgres up 'til now on my own
 
postgres: Can do mongo-like documents (JSON blobs), can index and query json, can RUN JS for stored procedures.
 
you use it for the wrong project you definitely can get screwed over.
 
@ElliotBonneville no, it doesn't

Why Mongodb sucks

Dec 5 '14 at 16:51, 8 minutes total – 33 messages, 4 users, 0 stars

Bookmarked Dec 5 '14 at 17:00 by Florian Margaine

 
@ssube It's a specific project we're using it for. We have other databases in production
 
2:41 PM
@Gemtastic Lots of other people are givng you those, I'm just saying "I fell into the mongo trap too, and understand why it look so damn appealing at first"
 
mongo does not scale. Their disk usage is absurd (never defragmenting), searching gets to be awfully slow (it doesn't really tell you when you're hitting indexes and queries will hit an index one time and skip it the next), stuff like that
 
@Luggage Well, I don't really think it's appealing, I don't dislike it either. And I was letting you know that to a neutral person, that story really doesn't give me anything :/
 
ok
 
interesting, @ssube. but I still stand by what I said--if you're not doing stuff that needs to scale, it's a quick and easy database to get started with
 
the whole query optimizer, kicking in repeatedly, causes a ton of problems
@ElliotBonneville so is postgres
 
2:42 PM
@Luggage If you don't want feedback I can stop :)
 
I already stopped.
But yea.. you can stop telling me that i'm not helpful. I get it.
 
You had other nice advice though so please don't stop
 
HAMMERTIME!
 
@CapricaSix yay
 
That alone makes Caprica worth it.
 
2:44 PM
@ssube well, this is true. can't argue with that. heh
 
Postgres is easy to setup, fast enough, feature rich, stable, and we'll documented.
 
And has transactions.
 
What else do you want? To be hip?
 
Should you encrypt your information before using TCP to make it safe or is that an unnecessary step?
 
@rlemon yes
that's exactly how we ended up using mongo in prod
it's been a multi-million dollar mistake so far
 
2:45 PM
@rlemon AND! It supports JSON :D
 
we're replacing it with cassandra
 
"We need to be cutting edge without doing proper business analysis" @ssube??
 
aaaayup
 
:(
 
Just curious; what template module do you prefer in Node?
 
2:46 PM
we should've known it was a bad idea when compliance asked "ok, how do we manage users?" and 10gen said "oh, you'll need to turn auth off, it doesn't really work and causes performance problems"
 
Sure, some people probably use it successfully, but I will never recommend it.
@Gemtastic ejs
 
CommonJS. The node style. All other styles can be built from that using tools like browserify or webpack.
oh, template module, i misread
 
@rlemon I prefer that one too. Jade feels weird.
 
@Gemtastic handlebars erywhur
 
no Jade love?
 
2:47 PM
I use Jade.
 
Jade is pretty slick.
 
I hate jade.
 
forcibly keeping logic out of templates ftw
@rlemon +1
 
but.. my next project will (if it fits) be done in React/JSX.
 
I'm old-school and I like my HTML
 
2:47 PM
I like feeling like I'm still writing HTML
 
I use html and PHP.
 
webpack can optimize em real good, too
 
ejs feels a bit like JSP though
 
@AwalGarg Me too :D
 
@Gemtastic You mean something like L2TP or PPTP? As the names suggest, they're just for tunneling; the interesting data sits on top of TCP. For instance, SSL/TLS sits on top of TCP and before HTTP
 
2:48 PM
Not sure what I think about that :P
 
think of waht you want in a template engine and I bet there is one out there already just for you.
 
@Zirak Yeah, I'm a n00b on transfer protocol, security and encryption. But I want to learn
 
@Luggage only one?
 
any template engine will work, so long as you keep your templates simple
 
>= 1
 
2:49 PM
the instant you add actual scripting to them, like JSP allows, you're fucked
 
Encryption and safety are very important in the business I'm in after all...
@ssube is that why you don't like ejs?
 
@Gemtastic healthcare?
 
Rubix is the best template engi for node. the best. goo.gl/2pVYBH
 
Banking
 
@Gemtastic haven't used ejs, but a lot of others (like underscore templates) encourage logic
 
2:50 PM
ah. similar.
 
@rlemon attachments didn't come through :(
 
handlebars is nice because it gives you basic constructs ({{if truthy}} and {{each}}) and that's all you get
 
but it's pretty eacy to write your own helpers
 
so you can loop, you can condition on truthy/falsy, but no side effects, no complicated scripting
 
@ssube looks similar to hogan
 
2:51 PM
I wrote one to do jad-estyle mixings in just a few lines of code
 
or whatever it was called
 
you can define helpers, but those are functions you can unit test on their own
 
@rlemon ps i hate you
 
handlebars templates can also compile down to a JS function and can be pretty quick
plus, it's not HTML-specific, so you can produce markdown or just text
 
I use handlebars for XSL:FO, as an example.
 
2:52 PM
@ssube Yeah, I like that in HBS.
 
@SterlingArcher sent again (@FlorianMargaine)
 
I tend to think that if you need much more than that, you're doing too much logic in your template.
 
@MadaraUchiha for sure
if you have to do something crazy, it forces you to do it in the view or use a helper, both of which are testable
templates are always a pain to test
 
Soo.. about architecture for a backend applet.. I only know that it's standard for app.js to be the "main"?
 
@ssube reading over your analysis of Mongo--that's some pretty interesting stuff. haven't read much of that before.
 
2:54 PM
I need to be able to import, pass variables, iterate over objects and arrays.. and that is about it
 
consistency is the only standard
 
ohh and common constructs like if's and shit
a very simple example
 
@ElliotBonneville I don't have a lot of citations, unfortunately, but it's stuff we've run into in prod
 
@AwalGarg So I can call it whatever I like and structure it however and that's fine as long as it's consistent? Hmm... Not sure that's helpful since I'm still a newb to any kind of project structure/architecture...
 
a very advanced example
 
2:55 PM
our DB isn't even that big, I think all of prod (all the shards combined) is like 600GB
 
@rlemon Now we're talking!
 
@ssube well, it's enough to get me doubting mongo again. I'll probably do some of my own research on it for when I need a DB for a larger project
 
@Gemtastic Basic structure:
 
I like advanced over simple. Advanced gives me more patterns to notice and work with.
 
src/
test/
dist/
package.json
(main|app|index).js
 
2:56 PM
@Gemtastic simple is faster, cleaner, easier to test and maintain
 
app.js
/views
/public
  /js
  /css
  /images
  /fonts
/modules
how I structure my projects.
 
@FlorianMargaine @rlemon omg omg, he's a snufflewuffle ball!!
 
@rlemon That's inside src/?
 
Dat french hair!!
 
Or do you just skip tests altogether? :D
 
2:57 PM
@MadaraUchiha if I was packaging something up for the public, yes
 
@rlemon what if you want to break down app.js into multiple files? leave them all in root?
 
src/main
src/test
target/main (babel output)
target/pack (webpack output)
package.json (gets copied to target/pack just before deploy, so src doesn't go to npm)
gulpfile.js
 
@ElliotBonneville app.js calls modules from modules.js
 
I wonder if they make onezies like that my size
 
modules structure the 'parts'
 
2:57 PM
@ssube Yes, but it's easier for me to work it the other way; to build something simple after learning the complex than the other way.
 
I would also have a routes folder to handle my routes.
forgot about that
 
@rlemon ah, I see. so that's not just node_modules then
 
no
 
@Gemtastic it is your project, so ofcourse, call it whatever you like. structure depends on your app. the structure of a userscript project will be different than that of a full-fledged application like this website. and yes, consistency across the project, and good documentation helps.
 
a well established structure helps as well. even if it isn't the best. everyone understands nodeback even if it isn't the best design
 

« first day (1714 days earlier)      last day (3237 days later) »