|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
|
On September 24 2015 21:09 Cynry wrote: Well, Meteor isn't really pure JS. It even introduces ECMAscript 6 as its language with its last update. I'm no expert on Meteor yet, only been working with it for a couple months now, so there's that too.
As I see it, this issue is pretty much solved by using intelligent queries when fetching data from the database, be it client or server. Basically, the client gets a mirror of the server database, filtered by the following: -Meteor.publish on the server, which allows you to set some names (a bit like routes) for access to specified data. Specification of what is returned uses the regular mongodb queries syntax, so you can limit (even dynamically) the fields you want to return, according or not to the user status (connected, admin etc); -Meteor.subscribe on the client, which calls the previously defined published data by its name, and you can specifiy here too which data you want to receive.
These 2 combines forms the client side database (minimongo collections), but does not fetch any documents in it. It's just which data and fields of this data you can even see. You then need to fetch it with the usual mongo .find().fetch() or .findOne(), and here again, you can limit the field you're actually returning to your logic. This is also valid on the server side, except it works with the whole database instead of the minimongo mirror.
So there's that, built-in Meteor, that could work. There's also a schema package, that works a lot like Doctrine (except it's JSON), called SimpleSchema, which provides an customisable autoform option It can even turn mongo into a SQL-like database by attaching schema directly to collections (thus forcing checks on a user defined allowed set of fields for every insert/update)
Edit: I tried to ctrl + s this message way too many times ...
Heh, somehow the thought of JS having anything to do with the database sends cold shivers down my spine...
|
Guess that's the good thing about being a noob in the different langages and their legacy, I don't have that kind of perception, for better or worst. Why would you think that ? From the little I know, JS has grown a lot lately, node is gaining popularity quickly (I think it also handle databases ?). But that may be the scewed perception of a student in a school filled with hipster wannabe coders, such as the ones claiming that declaring a variable with xor is better than = 0.
For what I've used, I feel like I have a pretty tight control over what's going on with the database, except the part that meteor takes over to do its reactive stuff. But again, I have very little experience with all this stuff. Might be that our app would simply crash with 1000 documents ^^
|
Meteor is pretty smart with data management + rendering. Having a client shard reduces needs for roundtrips to the server and utilises the client for all filtering + aggregation work. Meteor also maintains eventual consistency with websocket updates based on the oplog tail from the mongo db / minimongo, so they get almost realtime sync across all clients and the backend without long polling.
It also has a templating system called Blaze which does incremental updates of the DOM based on the diff based on Meteor.deps which is their internal reactive programming microlibrary (I think is now called Tracker but I stopped following Meteor dev like a year ago).
|
By the way, if anyone would be willing to do some kind of code review on our project, it would be really helpful. We basically have noone with an experienced look on what we're coding, I'd just like to make sure we're not taking dead end anywhere...
Edit : Doing some testing with bigger collections today, any hint on what to aim for, or some good ressources to figure it out on my own ? Guess it's very app dependant..
|
On September 26 2015 00:50 Cynry wrote: Guess that's the good thing about being a noob in the different langages and their legacy, I don't have that kind of perception, for better or worst. Why would you think that ? From the little I know, JS has grown a lot lately, node is gaining popularity quickly (I think it also handle databases ?).
I simply don't think that JS's place is in the backend. The inconsistencies in it scare me - like the implementation of the Date object, which is one of the most commonly used things in web development, being different across browsers. I hate working with dates in JS, it's needlessly convoluted. The comparison operators not working properly is another big issue (I'm working with PHP so I know how much such things can screw you over).
I don't know, maybe it's because I simply don't know enough about JS and I'm biased against it. In the company I work at we're trying to use as little JS as possible, only utilizing it in the frontend.
|
Does anyone know what a "Senior .Net Professional" does?
|
On September 29 2015 01:39 spinesheath wrote: Does anyone know what a "Senior .Net Professional" does?
Probably whatever their boss tells them to.
|
On September 26 2015 21:27 Manit0u wrote:Show nested quote +On September 26 2015 00:50 Cynry wrote: Guess that's the good thing about being a noob in the different langages and their legacy, I don't have that kind of perception, for better or worst. Why would you think that ? From the little I know, JS has grown a lot lately, node is gaining popularity quickly (I think it also handle databases ?). I simply don't think that JS's place is in the backend. The inconsistencies in it scare me - like the implementation of the Date object, which is one of the most commonly used things in web development, being different across browsers. I hate working with dates in JS, it's needlessly convoluted. The comparison operators not working properly is another big issue (I'm working with PHP so I know how much such things can screw you over). I don't know, maybe it's because I simply don't know enough about JS and I'm biased against it. In the company I work at we're trying to use as little JS as possible, only utilizing it in the frontend. "Php developer talking smack bout JS he he" On a serious note though what's not working properly with the comparison operators? They working fine for me
|
On September 29 2015 03:07 njt7 wrote:Show nested quote +On September 26 2015 21:27 Manit0u wrote:On September 26 2015 00:50 Cynry wrote: Guess that's the good thing about being a noob in the different langages and their legacy, I don't have that kind of perception, for better or worst. Why would you think that ? From the little I know, JS has grown a lot lately, node is gaining popularity quickly (I think it also handle databases ?). I simply don't think that JS's place is in the backend. The inconsistencies in it scare me - like the implementation of the Date object, which is one of the most commonly used things in web development, being different across browsers. I hate working with dates in JS, it's needlessly convoluted. The comparison operators not working properly is another big issue (I'm working with PHP so I know how much such things can screw you over). I don't know, maybe it's because I simply don't know enough about JS and I'm biased against it. In the company I work at we're trying to use as little JS as possible, only utilizing it in the frontend. "Php developer talking smack bout JS he he" On a serious note though what's not working properly with the comparison operators? They working fine for me
Just a few examples:
'' == '0' // false 0 == '' // true 0 == '0' // true
false == 'false' // false false == '0' // true
false == undefined // false false == null // false null == undefined // true
' \t\r\n ' == 0 // true
var a = [1,2,3]; var b = [1,2,3];
var c = { x: 1, y: 2 }; var d = { x: 1, y: 2 };
var e = "text"; var f = "te" + "xt";
a == b // false a === b // false
c == d // false c === d // false
e == f // true e === f // true
"abc" == new String("abc") // true "abc" === new String("abc") // false
// true as both operands are Type String (i.e. string primitives): 'foo' === 'foo'
var a = new String('foo'); var b = new String('foo');
// false as a and b are Type Object and reference different objects a == b
// false as a and b are Type Object and reference different objects a === b
// true as a and 'foo' are of different type and, the Object (a) // is converted to String 'foo' before comparison a == 'foo'
I find there to be a bit too many rules to remember of what is being turned into what (and in which specific case does it occur) when evaluating.
|
Well id argue there being a difference between something not working properly and someone not knowing how something works.
But I do understand your point. It is more complicated then some other languages. But it is also a useful feature and has nothing to do with not being a useful language to be used in the backend for specific projects.
If all languages was equal what would the need for languages be?
|
The problem with JS (and PHP for that matter) is that they let you slide with some horrendeous stuff. They're also super popular on the web so many people without proper knowledge or skill are polluting it hardcore. I especially hate the common practice of adding tons of JS to your page for things that could be handled better with pure HTML/CSS if someone just stopped for a moment and used their brain. It's frequently being used for monkey-patching pages, quick and dirty, without any consideration.
It's not the languages that are bad (although PHP kinda is because of Zend's approach to it, even though it's going to get much, much better in version 7 it's still not enough to weed out some really bad practices) but the majority of people who use them daily, spewing shitty code all over.
|
On September 26 2015 21:27 Manit0u wrote:Show nested quote +On September 26 2015 00:50 Cynry wrote: Guess that's the good thing about being a noob in the different langages and their legacy, I don't have that kind of perception, for better or worst. Why would you think that ? From the little I know, JS has grown a lot lately, node is gaining popularity quickly (I think it also handle databases ?). I simply don't think that JS's place is in the backend. The inconsistencies in it scare me - like the implementation of the Date object, which is one of the most commonly used things in web development, being different across browsers. I hate working with dates in JS, it's needlessly convoluted. The comparison operators not working properly is another big issue (I'm working with PHP so I know how much such things can screw you over). I don't know, maybe it's because I simply don't know enough about JS and I'm biased against it. In the company I work at we're trying to use as little JS as possible, only utilizing it in the frontend.
The bane of JavaScripts existence is that it is always seen in the context of browsers. Basically all the hate for it comes from that aspect of it. JavaScript is actually a fairly intriguing and powerful language, it just was used wrong by Microsoft and now everyone hates it for it's most common environment instead for it's actual properties.
I hated JavaScript in the past as well, mostly for the same reasons as you, but I've actually learned to like it for what it is instead of hating it for where it's used or for what it's not. It has a surprising amount of similarities to my first "real" programming language Perl.
|
|
I started internship 2 weeks ago, and using mainly python. I had no experience before, but it feels quit natural to use.
But i would be interested in reading some book/online guide on good practices. I have been reading python hitchhiker's guide little.
Commenting has been makeing me wonder for while already. Not only python, but in each lanquage i have no idea how, much should i comment. It feels like it would be stupid to comment on everything, but then again something clear to me might not be clear to the reader.
|
|
Quick question, might be a meaningless one and I might be overthinking it but I feel like I'm not since I've heard different things about coding practices. Anyways, I'm working in java and I have a class that stores different information like strings, integers, and also a list of arrays that's of size 2. The array is supposed to store a time range. So if 6 is the first value, and 7 is the second value then that represents 6 am to 7 am. So I was just wondering if it's correct to code this way or should I define a separate class for time range that holds a value for start and end? I feel like that would make the code more readable and easy to understand, but it might be a bit "out of the way" to code in such a fashion.
|
|
On October 03 2015 18:07 Itsmedudeman wrote: Quick question, might be a meaningless one and I might be overthinking it but I feel like I'm not since I've heard different things about coding practices. Anyways, I'm working in java and I have a class that stores different information like strings, integers, and also a list of arrays that's of size 2. The array is supposed to store a time range. So if 6 is the first value, and 7 is the second value then that represents 6 am to 7 am. So I was just wondering if it's correct to code this way or should I define a separate class for time range that holds a value for start and end? I feel like that would make the code more readable and easy to understand, but it might be a bit "out of the way" to code in such a fashion. I haven't used Java in ages, but one would assume that there either already is a timespan class, or range and datetime classes. You certainly shouldn't use an array of size 2 to represent a range.
|
It's cool there's an existing class for this and all, but it doesn't really solve my problem/answer my question. My point being that I feel it would be best for me to hold my times as a set of 2 to represent a beginning and an end, my interest is not with the duration between those two time periods. I would still have to create 2 localtime objects for each set of values. So the essence of my question is how should I structure this in my class? Even if I use these APIs?
To explain a bit further on what I'm working on, I want to hold multiple time sets for each person object. Later on I'm going to use these time sets in an algorithm which, as far as I know, isn't covered by existing APIs. Also, I feel that the localtime class is overly complex for what I want to store which doesn't involve minutes or seconds.
edit: I guess the interval class structures it the way I'm thinking of now that I look at it. It still has a lot of fields that I find unnecessary so I might make my own class.
|
|
|
|