• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 04:40
CET 10:40
KST 18:40
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
SC2 All-Star Invitational: Jan 17-1815Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises2Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4
StarCraft 2
General
SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises Chinese SC2 server to reopen; live all-star event in Hangzhou Starcraft 2 Zerg Coach ComeBackTV's documentary on Byun's Career !
Tourneys
WardiTV Mondays OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ I would like to say something about StarCraft (UMS) SWITCHEROO *New* /Destination Edit/ What monitor do you use for playing Remastered? BW General Discussion
Tourneys
[BSL21] Grand Finals - Sunday 21:00 CET SLON Grand Finals – Season 2 [Megathread] Daily Proleagues [BSL21] LB SemiFinals - Saturday 21:00 CET
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Game Theory for Starcraft Current Meta
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Awesome Games Done Quick 2026! Stormgate/Frost Giant Megathread Mechabellum
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia
Community
General
US Politics Mega-thread Canadian Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread 12 Days of Starcraft
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1101 users

The Big Programming Thread - Page 666

Forum Index > General Forum
Post a Reply
Prev 1 664 665 666 667 668 1032 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
Poland17554 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
Poland17554 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
Poland17554 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
Poland17554 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
Poland17554 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 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1d 3h
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
DivinesiaTV 31
StarCraft: Brood War
Sea 2125
Stork 423
actioN 407
Soma 277
GuemChi 244
PianO 201
ZergMaN 164
Zeus 149
Leta 112
Sharp 108
[ Show more ]
Shuttle 106
Larva 101
ToSsGirL 53
Shine 34
Nal_rA 32
NaDa 26
Sacsri 21
yabsab 18
ajuk12(nOOB) 8
ggaemo 4
Dota 2
NeuroSwarm144
febbydoto95
League of Legends
C9.Mang0604
Other Games
Happy648
Fuzer 247
kaitlyn46
Mew2King26
Organizations
Other Games
gamesdonequick952
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Adnapsc2 19
• Light_VIP 17
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• HappyZerGling201
Upcoming Events
OSC
1d 3h
Korean StarCraft League
1d 17h
OSC
2 days
IPSL
2 days
Dewalt vs Bonyth
OSC
2 days
OSC
3 days
uThermal 2v2 Circuit
3 days
Replay Cast
3 days
Patches Events
4 days
Liquipedia Results

Completed

C-Race Season 1
WardiTV 2025
META Madness #9

Ongoing

IPSL Winter 2025-26
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025

Upcoming

Escore Tournament S1: W2
CSL 2025 WINTER (S19)
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Thunderfire SC2 All-star 2025
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
Underdog Cup #3
NA Kuram Kup
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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 © 2026 TLnet. All Rights Reserved.