• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 03:34
CEST 09:34
KST 16:34
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL54Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Weekly Cups (June 23-29): Reynor in world title form? The SCII GOAT: A statistical Evaluation PiG Sty Festival #5: Playoffs Preview + Groups Recap The GOAT ranking of GOAT rankings Statistics for vetoed/disliked maps
Tourneys
Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) RSL: Revival, a new crowdfunded tournament series [GSL 2025] Code S: Season 2 - Semi Finals & Finals $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Player “Jedi” cheat on CSL BW General Discussion Flash Announces Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ Unit and Spell Similarities
Tourneys
[Megathread] Daily Proleagues [BSL20] Grand Finals - Sunday 20:00 CET Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Trading/Investing Thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 746 users

The Big Programming Thread - Page 666

Forum Index > General Forum
Post a Reply
Prev 1 664 665 666 667 668 1031 Next
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.
InvaderUK
Profile Joined January 2011
225 Posts
September 25 2015 09:17 GMT
#13301
On September 17 2015 12:51 Birdie wrote:
Donald Knuth's Art of Computer Programming are supposed to be the best books on comp sci algorithms. I haven't had a chance to get my hands on them yet though.


Lol don't recommend those books for someone starting out, it's probably some of the most dense material published. I'm pretty sure exactly 0 people have been able to finish those.

The intro to algorithms book mentioned is canon, I'd also recommend:

* http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202
* http://www.amazon.com/Algorithms-4th-Edition-Robert-Sedgewick/dp/032157351X
patriarch of the church of howard. may maokai smile upon you.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
September 25 2015 13:22 GMT
#13302
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...
Time is precious. Waste it wisely.
Cynry
Profile Blog Joined August 2010
810 Posts
September 25 2015 15:50 GMT
#13303
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 ^^
InvaderUK
Profile Joined January 2011
225 Posts
September 25 2015 17:00 GMT
#13304
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).
patriarch of the church of howard. may maokai smile upon you.
Cynry
Profile Blog Joined August 2010
810 Posts
Last Edited: 2015-09-26 10:31:57
September 25 2015 17:42 GMT
#13305
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..
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
September 26 2015 12:27 GMT
#13306
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.
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 28 2015 16:39 GMT
#13307
Does anyone know what a "Senior .Net Professional" does?
If you have a good reason to disagree with the above, please tell me. Thank you.
InvaderUK
Profile Joined January 2011
225 Posts
September 28 2015 17:37 GMT
#13308
On September 29 2015 01:39 spinesheath wrote:
Does anyone know what a "Senior .Net Professional" does?


Probably whatever their boss tells them to.
patriarch of the church of howard. may maokai smile upon you.
njt7
Profile Joined August 2012
Sweden769 Posts
September 28 2015 18:07 GMT
#13309
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
"All the casters who flamed me ever for anything."
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
Last Edited: 2015-09-28 20:03:47
September 28 2015 20:00 GMT
#13310
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.
Time is precious. Waste it wisely.
njt7
Profile Joined August 2012
Sweden769 Posts
September 28 2015 20:28 GMT
#13311
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?
"All the casters who flamed me ever for anything."
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
September 28 2015 22:48 GMT
#13312
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.
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
October 01 2015 15:06 GMT
#13313
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.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
October 01 2015 15:42 GMT
#13314
--- Nuked ---
SacredCoconut
Profile Joined October 2010
Finland121 Posts
October 03 2015 08:03 GMT
#13315
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.
I apologize for possible grammar errors.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
October 03 2015 08:58 GMT
#13316
--- Nuked ---
Itsmedudeman
Profile Blog Joined March 2011
United States19229 Posts
Last Edited: 2015-10-03 09:08:29
October 03 2015 09:07 GMT
#13317
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.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
Last Edited: 2015-10-03 09:28:36
October 03 2015 09:21 GMT
#13318
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.


First thing you should do in any language is do some research, so you don't end up reinventing the wheel...

https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html
https://docs.oracle.com/javase/tutorial/datetime/iso/period.html
http://joda-time.sourceforge.net/api-release/org/joda/time/Period.html
http://joda-time.sourceforge.net/api-release/org/joda/time/Interval.html
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
October 03 2015 09:21 GMT
#13319
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.
If you have a good reason to disagree with the above, please tell me. Thank you.
Itsmedudeman
Profile Blog Joined March 2011
United States19229 Posts
Last Edited: 2015-10-03 09:53:15
October 03 2015 09:34 GMT
#13320
On October 03 2015 18:21 Manit0u wrote:
Show nested quote +
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.


First thing you should do in any language is do some research, so you don't end up reinventing the wheel...

https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html
https://docs.oracle.com/javase/tutorial/datetime/iso/period.html
http://joda-time.sourceforge.net/api-release/org/joda/time/Period.html
http://joda-time.sourceforge.net/api-release/org/joda/time/Interval.html

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.
Prev 1 664 665 666 667 668 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2h 26m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Reynor 167
StarCraft: Brood War
GoRush 23
Larva 20
Dota 2
XaKoH 469
NeuroSwarm117
XcaliburYe52
League of Legends
JimRising 653
Counter-Strike
Stewie2K1145
Heroes of the Storm
Khaldor135
Other Games
summit1g4910
WinterStarcraft744
Organizations
Other Games
BasetradeTV43
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH332
• practicex 27
• Adnapsc2 18
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1552
• Stunt511
Upcoming Events
CranKy Ducklings
2h 26m
RSL Revival
2h 26m
ByuN vs Cham
herO vs Reynor
WardiTV European League
4h 26m
FEL
8h 26m
RSL Revival
1d 2h
Clem vs Classic
SHIN vs Cure
FEL
1d 4h
WardiTV European League
1d 4h
BSL: ProLeague
1d 10h
Dewalt vs Bonyth
Replay Cast
2 days
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV European League
3 days
The PondCast
4 days
Replay Cast
4 days
RSL Revival
5 days
Replay Cast
5 days
RSL Revival
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.