• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:02
CEST 13:02
KST 20:02
  • 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
TL.net Map Contest #22 - Voting & Ladder Map Selection4Code S Season 2 (2026) - RO8 Preview5[ASL21] Finals Preview: Two Legacies21Code S Season 2 (2026) - RO12 Preview2herO wins GSL Code S Season 1 (2026)7
Community News
[BSL22] Non-Korean Championship from 13 to 28 June0Weekly Cups (May 25-31): Clem doubles, 2v2 circuit heads toward finale0StarCraft II 5.0.16 PTR Patch Notes may 26th151Weekly Cups (May 18-24): MaxPax wins doubles0Crank Gathers Season 4: BW vs SC2 Team League6
StarCraft 2
General
My starcraft 2 changes Glyco Honey Review 2026: Real Customer Experiences SCFusion - WoL, HotS & LotV Build Order Optimizer TL.net Map Contest #22 - Voting & Ladder Map Selection TL Poll: How do you feel about the 5.0.16 PTR balance changes?
Tourneys
Maestros of The Game 2 announcement and schedule ! Crank Gathers Season 4: BW vs SC2 Team League GSL Code S Season 2 (2026) Sparkling Tuna Cup - Weekly Open Tournament RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
[G] Having the right mentality to improve
Custom Maps
[D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 528 Infection Detected Welcome to the External Content forum Mutation # 527 Hell Train
Brood War
General
Tesagi Viewer - A new era of replay watching 14k games analyzed: Cross Spawn Nexus first good? FlaSh's ASL S21 Finals Review BGH Auto Balance -> http://bghmmr.eu/ VPN experiences
Tourneys
[ASL21] Grand Finals [BSL22] Grand Finals - Sunday 21:00 CEST [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2
Strategy
Why doesn't anyone use restoration? Any training maps people recommend? Muta micro map competition [G] Hydra ZvZ: An Introduction
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Warcraft III: The Frozen Throne Path of Exile ZeroSpace Megathread
Dota 2
Looking for a Dota Mentor 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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Trading/Investing Thread Russo-Ukrainian War Thread How cold is too cold to be outdoors? Dating: How's your luck?
Fan Clubs
The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
Gauntlet SC2: A Retrospectiv…
Ctone23
Esportsmanship: How to NOT B…
TrAiDoS
Why RTS gamers make better f…
gosubay
ASL S21 English Commentary…
namkraft
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 5490 users

The Big Programming Thread - Page 696

Forum Index > General Forum
Post a Reply
Prev 1 694 695 696 697 698 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.
tofucake
Profile Blog Joined October 2009
Hyrule19217 Posts
Last Edited: 2015-12-21 20:57:09
December 21 2015 20:57 GMT
#13901
That's not PHP sucking, that's the programmer sucking. You know what you can do in C?
#DEFINE TRUE FALSE

god C sucks
Liquipediaasante sana squash banana
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
December 21 2015 21:13 GMT
#13902
On December 22 2015 05:57 tofucake wrote:
That's not PHP sucking, that's the programmer sucking. You know what you can do in C?
#DEFINE TRUE FALSE

god C sucks


That's not even a C example. This is preprocessor. A good example why C sucks is:

void* variable


Apart from Windows API, I facepalm everytime I see this.
Acrofales
Profile Joined August 2010
Spain18302 Posts
Last Edited: 2015-12-22 00:06:25
December 22 2015 00:04 GMT
#13903
On December 22 2015 06:13 darkness wrote:
Show nested quote +
On December 22 2015 05:57 tofucake wrote:
That's not PHP sucking, that's the programmer sucking. You know what you can do in C?
#DEFINE TRUE FALSE

god C sucks


That's not even a C example. This is preprocessor. A good example why C sucks is:

void* variable


Apart from Windows API, I facepalm everytime I see this.

I disagree in any case. There are perfectly good reasons for someone wanting to call a variable "protected", for instance:

class FloppyDisk
{
protected $protected = false
}

That makes sense. It could be clearer, and be called $writeProtected, but it's okay. So there are two problems: some blame goes to PHP not protecting keywords, and thus allowing a variable to be called $protected. And of course some of the blame falls on the programmer for actually thinking it's a good idea to use that variable name, regardless of whether it's allowed or not.

Now we just had a discussion over the last two pages, and shitty unthinking programmers will be a reality forever, so ffs, make your language more stupid proof than that.

C has the excuse that it was invented in the 60s. Back when most programmers were still, essentially, rocket scientists.
phar
Profile Joined August 2011
United States1080 Posts
December 22 2015 06:27 GMT
#13904
On December 21 2015 16:27 pEcul!Ar wrote:
Show nested quote +
On December 21 2015 11:35 phar wrote:
On December 21 2015 07:08 pEcul!Ar wrote:

The other college has a department purely focused on game development with 4 ways you can choose from (3D Production & VFX - Game Graphics Production - Game Development - Independent Game Production) - http://www.digitalartsandentertainment.be/page/14/Course overview

I strongly urge you to not go to a school that focuses purely on game development. On average in the game industry as a programmer, compared to virtually any other industry as a programmer, you will:

  • earn less
  • work longer hours
  • have significantly
  • burn out faster (see above)


The exception being some parts of the finance industry. In that case as a game developer you will just earn like 3-4x less, but have potentially better hours. Game programming has a problem, in that too many people want to do it.

That said, if it is truly your passion, have at it. Just bear in mind the above.


Yeah, I'm aware of the current problems/issues with the gaming industry, which is why I'm opting to go for app dev and taking game dev as one of the optional choices along the way. Another option is software dev (and 2 courses you can choose from the list I mentioned).

A reasonable choice. And, if you do end up really truly wanting to go into game dev later, you can always do so. If you get a solid grounding, you can pick up game-specific stuff later (or even on the job). But, if you study purely game dev from the get go, you're backing yourself into a (potentially very underpaid) corner.
Who after all is today speaking about the destruction of the Armenians?
pEcul!Ar
Profile Joined December 2015
52 Posts
December 22 2015 09:07 GMT
#13905
On December 22 2015 15:27 phar wrote:
Show nested quote +
On December 21 2015 16:27 pEcul!Ar wrote:
On December 21 2015 11:35 phar wrote:
On December 21 2015 07:08 pEcul!Ar wrote:

The other college has a department purely focused on game development with 4 ways you can choose from (3D Production & VFX - Game Graphics Production - Game Development - Independent Game Production) - http://www.digitalartsandentertainment.be/page/14/Course overview

I strongly urge you to not go to a school that focuses purely on game development. On average in the game industry as a programmer, compared to virtually any other industry as a programmer, you will:

  • earn less
  • work longer hours
  • have significantly
  • burn out faster (see above)


The exception being some parts of the finance industry. In that case as a game developer you will just earn like 3-4x less, but have potentially better hours. Game programming has a problem, in that too many people want to do it.

That said, if it is truly your passion, have at it. Just bear in mind the above.


Yeah, I'm aware of the current problems/issues with the gaming industry, which is why I'm opting to go for app dev and taking game dev as one of the optional choices along the way. Another option is software dev (and 2 courses you can choose from the list I mentioned).

A reasonable choice. And, if you do end up really truly wanting to go into game dev later, you can always do so. If you get a solid grounding, you can pick up game-specific stuff later (or even on the job). But, if you study purely game dev from the get go, you're backing yourself into a (potentially very underpaid) corner.



Yeah, and I want to keep my options as broad as possible. Sure, game dev is something I really want to do but I think it's unwise to limit your options in the IT sector or any sector in general.
You look at people and you see puzzles. I see games. You? You're a game I'll win everytime.
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
December 22 2015 21:28 GMT
#13906
On December 22 2015 15:27 phar wrote:But, if you study purely game dev from the get go, you're backing yourself into a (potentially very underpaid) corner.


I don't think that's necessarily true. It depends on the content of the course. I did a software engineering degree that was purely focused on game dev, and feel it gave me a pretty good grounding for doing non game dev work. I did have an advantage over my classmates though, in that I managed to score a part time job during my 2nd year where I got to do a lot of SQL and web stuff that wasn't really covered.

The other stuff about being underpaid etc is pretty accurate though, although I've managed to end up at a studio where the pay is pretty decent compared to some of the other local options.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2015-12-27 04:50:05
December 27 2015 04:47 GMT
#13907
Right, but a software engineering degree with a focus on game dev sounds different from what was described ("a program" for game dev).

This: http://www.digitalartsandentertainment.be/page/14/Course overview

doesn't look like a normal software engineering program with a focus on game dev.
Who after all is today speaking about the destruction of the Armenians?
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
December 27 2015 19:49 GMT
#13908
Yeah that bachelors program does sound a bit different. We had a game art degree at my school, but it was completely separate from the programming one. Artists and programmers did work together on some papers, but the two paths had separate qualifications.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2015-12-27 22:23:44
December 27 2015 22:23 GMT
#13909
Wow, C# that's nasty...


int @float = 10;


It compiles fine. :D
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
December 27 2015 22:47 GMT
#13910
On December 28 2015 07:23 darkness wrote:
Wow, C# that's nasty...


int @float = 10;


It compiles fine. :D

Meh. Of course you shouldn't do it, but there's worse.

Essentially, any unicode character (including unicode escapes) in the character classes Lu, Ll, Lt, Lm, Lo, Nl, Mn, Mc, Nd, Pc, and Cf. The first letter is an exception and it must be a letter (classes Lu, Ll, Lt, Lm, or Lo) or an underscore. Also, if the identifier is a keyword, you must stick an @ in front of it. The @ is optional otherwise.
Source: stackoverflow
If you look up those character classes (there are links on the stackoverflow page), you'll find some crazy stuff. And I've thrown a dll into dotPeek and found class names that apparently used one of these characters that is or looked like a period (or dotPeek does weird things, but in this case I'd err on the side of the dll being weird).

Also don't forget that keywords may be context-specific. If you rename a variable with ReSharper to "group", ReSharper turns that into "@group" because that's a keyword for LINQ. But in most cases you can just skip the @ and call your variable "group" anyways.
If you have a good reason to disagree with the above, please tell me. Thank you.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
December 28 2015 01:57 GMT
#13911
http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Directors-Christmas-puzzle-2015.aspx anyone managed to complete this? (Without cheating on the internets for a walk-through)

I'm part-way through the first part, pretty fun.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2015-12-28 16:29:52
December 28 2015 16:28 GMT
#13912
Out of curiosity, how many of you actually end up using ternary operators when you code? Why do these even exists?

I mean obviously it's slightly shorter than it's "if" counterpart and arguably slightly more readable, but it just seems to add another thing to remember how to do lol.
tofucake
Profile Blog Joined October 2009
Hyrule19217 Posts
December 28 2015 16:32 GMT
#13913
I use them all the time, especially ?:
Our current codebase has at least 2000 uses of compact ternary and many, many more verbose.

I'm looking forward to when my company upgrades to PHP7 and I get to use ?? too.
Liquipediaasante sana squash banana
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
December 28 2015 19:44 GMT
#13914
Okay, I am taking a look at python right now

And I keep seeing this in examples for putting variables into strings

return "%d or %s put the variable into the string" %variablename


Can someone explain what the benefit of doing this is, compared to:

return variablename+" put the variable into the string"




Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2015-12-28 20:08:53
December 28 2015 19:56 GMT
#13915
--- Nuked ---
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2015-12-28 20:10:37
December 28 2015 20:01 GMT
#13916
Nesserev, can you give a quick explanation of what is happening?

Is it taking the provided list and putting it into them braces based on index of the list in example 2?

And I am guessing example 1 just defaults to putting them in based on the order of the braces?

edit: thank you
Manit0u
Profile Blog Joined August 2004
Poland17756 Posts
Last Edited: 2015-12-28 22:20:37
December 28 2015 22:14 GMT
#13917
On December 29 2015 01:32 tofucake wrote:
I use them all the time, especially ?:
Our current codebase has at least 2000 uses of compact ternary and many, many more verbose.

I'm looking forward to when my company upgrades to PHP7 and I get to use ?? too.


?: is the bomb. Null coalesce will be big in 7, so will be the spaceship operator.

I don't mind regular ternaries that bad, but there are cases (and I come across them frequently) when it's disastrous...


$someObj->someMethod() ? $someVar = $someObject->someMethod() : '';


Ugh! I cringe every time when I see it. I have absolutely no idea why would anyone want to do it this way, but it's there.

On December 29 2015 04:44 travis wrote:
Okay, I am taking a look at python right now

And I keep seeing this in examples for putting variables into strings

return "%d or %s put the variable into the string" %variablename


Can someone explain what the benefit of doing this is, compared to:

return variablename + " put the variable into the string"


It's actually present in many languages, not just Python. The problem with "+" operator here is that sometimes variable being cast to string won't be what you expect and you'll get corrupted output. In general, you should make your string concatenation as explicit as possible to avoid such errors.
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19217 Posts
December 29 2015 01:28 GMT
#13918
but....

$someVar = $someObject->someMethod() ?: '';


WHY
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17756 Posts
Last Edited: 2015-12-29 10:00:34
December 29 2015 01:45 GMT
#13919
On December 29 2015 10:28 tofucake wrote:
but....

$someVar = $someObject->someMethod() ?: '';


WHY


Well, your code technically does the same. But then it'll return true when you do isset($someVar) later on if $someObject->someMethod() returns null, 0, empty array or false (since you'll set $someVar to be an empty string), the code above returns false (since the variable was never declared). I know, it's stupid to use it this way (rather obscure way of declaring + instantiating a variable only if you can assign something to it) and it boggled my mind on a multitude of occasions... Figuring out that an empty string there was basically a "do nothing" clause was a true revelation.

That's what you get when you're working on a code written by a lazy person who can't for the life of them be explicit.

Example:


$test1 = false ? 1 : '';

(false) ? $test2 = 1 : '';

if (isset($test1)) {
echo("t1 is set. ");
} else {
echo("t1 is not set. ");
}

if (isset($test2)) {
echo("t2 is set. ");
} else {
echo("t2 is not set. ");
}


Result:

t1 is set. t2 is not set.


Mindblowing, isn't it? I'm wondering to this day why use an empty string there instead of false or null though. Would be slightly bit more intuitive (but still very bad).

Of course, those two are equivalent:


$someVar = $someObj->someMethod() ?: null;
$someObj->someMethod() ? $someVar = $someObj->someMethod() : '';
Time is precious. Waste it wisely.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
December 31 2015 22:26 GMT
#13920
Happy New Year guys!
Prev 1 694 695 696 697 698 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
09:00
SEL Masters #6
Solar vs Classic
LiquipediaDiscussion
The PiG Daily
21:30
GSL Ro8 Group B Replay Cast
Maru vs SHIN
Rogue vs Zoun
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 135
BRAT_OK 1
StarCraft: Brood War
Calm 10250
firebathero 527
Horang2 341
BeSt 246
Britney 232
Soma 227
Larva 217
EffOrt 165
Leta 148
Zeus 124
[ Show more ]
Last 124
Hyun 118
Light 104
ZerO 77
scan(afreeca) 76
Rush 64
910 52
Mind 34
yabsab 21
Mong 18
sorry 15
Sacsri 11
Barracks 8
Liquid`Ret 4
Dota 2
Gorgc3171
XcaliburYe105
Dendi42
Counter-Strike
fl0m3103
byalli597
zeus211
Super Smash Bros
Mew2King69
Heroes of the Storm
Khaldor85
Other Games
singsing2715
B2W.Neo746
Sick162
Pyrionflax162
KnowMe109
ZerO(Twitch)12
MindelVK11
Lowko8
OptimusSC27
Organizations
StarCraft: Brood War
lovetv 13
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis2072
• Jankos1416
Upcoming Events
uThermal 2v2 Circuit
3h 59m
Grudge Match
4h 59m
FlaShFTW vs A.Alm
OSC
9h 59m
MaxPax vs YoungYakov
Krystianer vs Shameless
GgMaChine vs Creature
LetaleX vs MiniZergUA
ReBellioN vs TBD
ArT vs HiGhDrA
Nicoract vs Azura
GSL
20h 59m
herO vs Rogue
Maru vs Cure
Patches Events
1d 1h
uThermal 2v2 Circuit
1d 3h
BSL
1d 7h
Bonyth vs Dewalt
OSC
1d 12h
Monday Night Weeklies
2 days
Replay Cast
2 days
[ Show More ]
Sparkling Tuna Cup
2 days
Replay Cast
3 days
Kung Fu Cup
3 days
Maestros of the Game
4 days
Classic vs Lambo
Clem vs Maru
Replay Cast
4 days
The PondCast
4 days
Replay Cast
5 days
Replay Cast
6 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

KK 2v2 League Season 1
RSL Revival: Season 5
Heroes Pulsing #1

Ongoing

BSL Season 22
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
CSCL: Masked Kings S4
YSL S3
SCTL 2026 Spring
WardiTV Spring 2026
Maestros of the Game 2
uThermal 2v2 2026 Main Event
2026 GSL S2
Murky Cup 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026

Upcoming

BSL 22 Non-Korean Championship
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
Heroes Pulsing #3
Heroes Pulsing #2
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
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...

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.