• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 20:44
CEST 02:44
KST 09:44
  • 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
Serral wins EWC 202524Tournament Spotlight: FEL Cracow 20259Power Rank - Esports World Cup 202580RSL Season 1 - Final Week9[ASL19] Finals Recap: Standing Tall15
Community News
[BSL 2025] H2 - Team Wars, Weeklies & SB Ladder4EWC 2025 - Replay Pack4Google Play ASL (Season 20) Announced38BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams10Weekly Cups (July 14-20): Final Check-up0
StarCraft 2
General
Serral wins EWC 2025 The GOAT ranking of GOAT rankings EWC 2025 - Replay Pack #1: Maru - Greatest Players of All Time Greatest Players of All Time: 2025 Update
Tourneys
Sea Duckling Open (Global, Bronze-Diamond) TaeJa vs Creator Bo7 SC Evo Showmatch Sparkling Tuna Cup - Weekly Open Tournament FEL Cracov 2025 (July 27) - $10,000 live event Esports World Cup 2025
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 484 Magnetic Pull Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL [BSL 2025] H2 - Team Wars, Weeklies & SB Ladder BW General Discussion Google Play ASL (Season 20) Announced Shield Battery Server New Patch
Tourneys
[Megathread] Daily Proleagues [BSL] Non-Korean Championship - Final weekend [BSL20] Non-Korean Championship 4x BSL + 4x China CSL Xiamen International Invitational
Strategy
Does 1 second matter in StarCraft? Simple Questions, Simple Answers Muta micro map competition [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Recover Binance Asset - Lost Recovery Masters Nintendo Switch Thread Total Annihilation Server - TAForever
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
UK Politics Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread [\m/] Heavy Metal Thread Movie Discussion! [Manga] One Piece Korean Music Discussion
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
TeamLiquid Team Shirt On Sale The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Socialism Anyone?
GreenHorizons
Eight Anniversary as a TL…
Mizenhauer
Flash @ Namkraft Laddernet …
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 687 users

TL++ [So much ++ its Meta] - Page 3

Blogs > CecilSunkure
Post a Reply
Prev 1 2 3 All
Meta
Profile Blog Joined June 2003
United States6225 Posts
June 28 2013 21:43 GMT
#41
I'm in favor of TLMeta.
good vibes only
Jacmert
Profile Blog Joined October 2011
Canada1709 Posts
June 28 2013 21:44 GMT
#42
On June 28 2013 22:36 BisuDagger wrote:
Show nested quote +
On June 28 2013 21:24 3FFA wrote:
On June 28 2013 20:52 Burrfoot wrote:
I say TL switches things up and upgrades TL+ to +TL+ or started with TL. And incrementally went to TL.. TL... all the way past 9000.s

Ahh so do something like
    
BOOL newday; //is it a new day? Yes or no answers only.

//other code to define newday would most likely go here.

if(newday = YES) // if it is a new day...
{
double TLplus = 9000; //9000 TL+
for (int TL=1; TL < TLplus; TL++) //endless loop is endless
{
printf("Sup Oh Great And All Powerful Master Wizard R1CH"); //Say hi to R1CH
printf("/n you are now %i R1CH in TL",TL); //TL, new currency.
TLplus ++; //OVER 9000 TL+!
newday = NO; //not a new day anymore :(
return TL; //because why not?
}
}


Show nested quote +
//endless loop is endless

Your loop only runs once.

Ha ha! Good, I'm not crazy. I don't usually code in C++ (I work with a C++ like language), but I was like, "doesn't return break out of the loop?"

And I've NEVER heard/known about i++ returning any value, nor the difference between i++ and ++i. Good to know. Thanks!
Plat Support Main #believe
mizU
Profile Blog Joined April 2010
United States12125 Posts
June 28 2013 22:09 GMT
#43
what da fuk is going on
if happy ever afters did exist <3 @watamizu_
Shana
Profile Blog Joined July 2009
Indonesia1814 Posts
June 28 2013 23:48 GMT
#44
So there will be TL++ soon?
Believing in what lies ahead. | That which we call a rose, by any other name would smell as sweet.
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
Last Edited: 2013-06-29 00:59:41
June 29 2013 00:58 GMT
#45
On June 29 2013 02:44 spinesheath wrote:
Show nested quote +
On June 29 2013 02:12 wherebugsgo wrote:
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.

So now instead of

void func(int i) { }
int i = 42;
func(i++);

you always write

void func(int i) { }
int i = 42;
int t;
func((t = i, i += 1, t));

Yes, that's an assignment too, even though there is no = sign in the function call.

Granted, the sequence
vector<int> v(10, 0);
int i = 0;
v[i] = i++;
Can resolve to pretty much anything your compiler wants it to, but is that a reason to avoid ++?

My C++ got really rusty from all that C# lately, geez. Had to look up all of this to make sure I'm not making mistakes...


Actually, I'm almost 100% sure this is exactly why some programmers suggest avoiding ++ and --, because when you use them inline with other things, it tends to confuse people who did not write the code themselves. The professor I had that required += instead of ++ was not the only one who suggested this, though he was the most vocal about it. A few that I've had have said that increment and decrement operators should only be used by themselves on a single line, i.e.


i++;
a[i] = x;


instead of


a[++i] = x;


The fact that you had to look up documentation to see if you were doing everything correctly is another indication that perhaps you should consider simplifying your style, regardless of whether you've spent time programming in C#. Good programming practices lead to simple and readable code. I don't think what you suggested is very simple. Even if it takes more time to write it initially, clean and simple code is much easier and less painful to maintain.

For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.

Then again, maybe I am significantly biased, since the first three languages I learned to program in were Fortran, Scheme, and Python, none of which use the ++ operator. It was only after I used them for 2 years that I moved onto Java and C.
rabidch
Profile Joined January 2010
United States20289 Posts
June 29 2013 01:26 GMT
#46
On June 28 2013 19:20 spinesheath wrote:
The # is actually just two overlapping + signs. So it's C[++ in a single character].

or it could be 4 smaller +s
LiquidDota StaffOnly a true king can play the King.
aNGryaRchon
Profile Joined August 2012
United States438 Posts
June 29 2013 02:39 GMT
#47
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

Good question
Power overwhelming!!!
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-06-29 06:02:12
June 29 2013 06:00 GMT
#48
On June 29 2013 09:58 wherebugsgo wrote:
Show nested quote +
On June 29 2013 02:44 spinesheath wrote:
On June 29 2013 02:12 wherebugsgo wrote:
I really prefer +=. In fact I actually had a stylistic guide in a class once that would not allow you to use the ++ operator. The autochecker for assignments would throw an error until you changed it.

So now instead of

void func(int i) { }
int i = 42;
func(i++);

you always write

void func(int i) { }
int i = 42;
int t;
func((t = i, i += 1, t));

Yes, that's an assignment too, even though there is no = sign in the function call.

Granted, the sequence
vector<int> v(10, 0);
int i = 0;
v[i] = i++;
Can resolve to pretty much anything your compiler wants it to, but is that a reason to avoid ++?

My C++ got really rusty from all that C# lately, geez. Had to look up all of this to make sure I'm not making mistakes...


Actually, I'm almost 100% sure this is exactly why some programmers suggest avoiding ++ and --, because when you use them inline with other things, it tends to confuse people who did not write the code themselves. The professor I had that required += instead of ++ was not the only one who suggested this, though he was the most vocal about it. A few that I've had have said that increment and decrement operators should only be used by themselves on a single line, i.e.


i++;
a[i] = x;


instead of


a[++i] = x;


The fact that you had to look up documentation to see if you were doing everything correctly is another indication that perhaps you should consider simplifying your style, regardless of whether you've spent time programming in C#. Good programming practices lead to simple and readable code. I don't think what you suggested is very simple. Even if it takes more time to write it initially, clean and simple code is much easier and less painful to maintain.

For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.

Then again, maybe I am significantly biased, since the first three languages I learned to program in were Fortran, Scheme, and Python, none of which use the ++ operator. It was only after I used them for 2 years that I moved onto Java and C.

I had to look this stuff up because things like the comma operator are pretty damn exotic and I would never use them in real code unless I had a very specific reason to use it. Also to make sure the example of undefined behavior is actually undefined behavior.
Increment operators are generally fine if you only have a single occurence of the incremented variable in the whole statement and don't have any side effects on the variable. Sure, it means you need to be careful, but in fact compilers should be able to warn you about these things nowadays and I wouldn't give up proper ++ usage (which really is just in cases where it is clear what it does) where appropriate just for a little false security. You're not allowed to be any less careful just because you avoid ++, anyways.
If you have a good reason to disagree with the above, please tell me. Thank you.
Mobius_1
Profile Blog Joined April 2011
United Kingdom2763 Posts
June 29 2013 08:23 GMT
#49
doubleplus? Are we at war with Eastasia or Eurasia?
Starleague Forever. RIP KT Violet~
docvoc
Profile Blog Joined July 2011
United States5491 Posts
June 29 2013 15:38 GMT
#50
On June 28 2013 15:49 CecilSunkure wrote:
u gotta skate

The moral of the story.
User was warned for too many mimes.
Scorpion77
Profile Blog Joined January 2013
98 Posts
June 30 2013 17:41 GMT
#51
idk, this sounds like it would disturb the fabric of the metagame
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-06-30 22:29:28
June 30 2013 22:27 GMT
#52
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

=.=

-removed comment-
There is no one like you in the universe.
MaGariShun
Profile Joined May 2010
Austria305 Posts
July 01 2013 15:28 GMT
#53
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

Because calling it 'Java' would have been to obvious of a ripoff
XCetron
Profile Joined November 2006
5226 Posts
July 01 2013 16:15 GMT
#54
On June 28 2013 16:55 haduken wrote:
So.... why is C# called C Sharp... instead of C pound sign or C hash..

[image loading]
Rayeth
Profile Blog Joined April 2010
United States883 Posts
July 01 2013 21:07 GMT
#55
On June 29 2013 09:58 wherebugsgo wrote:


For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.


I can show off my knowledge of old languages, whee!


i = i++ + ++i;

This is straight up undefined behavior by the C standard. I don't know about C++ or C# (as I don't use them), but the C standard says this will lead to undefined behavior. You are using the ++ operator in such a way as to make its use dependant on what the compiler chooses to do first. It is equally undefined to say:

u = u++;


Now something will happen, but what you get is dependent on what system, what compiler and who knows how many other variables. The correct way to write the above would simply be u++;

The technical reason for these being incorrect is that you are modifying the stored value more than once between sequence points. As for what a sequence point is refer to the Wikipedia article as it is much clearer than I could ever be. The end result here is that you are right. No one should ever use expressions like that. They are sometimes used in classrooms to demonstrate bad code for a reason!

I will disagree with you about the pointers though. Yes bad code can be created using silly means, but a competent coder should not fear to use pointers. They are really useful! Don't shy away from such a powerful tool because they can be confusing, just make sure you are not the one writing the bad code. =)
The Innocent shall suffer... big time.
Targe
Profile Blog Joined February 2012
United Kingdom14103 Posts
July 01 2013 22:26 GMT
#56
u gotta skate

+ Show Spoiler +
this thread hurts my head
11/5/14 CATACLYSM | The South West's worst Falco main
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
July 02 2013 01:00 GMT
#57
On July 02 2013 07:26 Targe wrote:
u gotta skate

hahaha, I wonder if anyone got the baller reference in there too
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
Last Edited: 2013-07-06 01:17:43
July 06 2013 01:13 GMT
#58
On July 02 2013 06:07 Rayeth wrote:
Show nested quote +
On June 29 2013 09:58 wherebugsgo wrote:


For example, what does this mean?


i = i++ + ++i;


Sometimes with pointer arithmetic in C the increment operators can become really confusing too.

The point is not that you CAN do these things. Sure, you can do them. It doesn't mean you should. I'm personally of the belief that code should not be a labor to read or understand. It's a pain in the ass to debug someone else's code when it's written poorly and not commented.


I can show off my knowledge of old languages, whee!


i = i++ + ++i;

This is straight up undefined behavior by the C standard. I don't know about C++ or C# (as I don't use them), but the C standard says this will lead to undefined behavior. You are using the ++ operator in such a way as to make its use dependant on what the compiler chooses to do first. It is equally undefined to say:

u = u++;


Now something will happen, but what you get is dependent on what system, what compiler and who knows how many other variables. The correct way to write the above would simply be u++;

The technical reason for these being incorrect is that you are modifying the stored value more than once between sequence points. As for what a sequence point is refer to the Wikipedia article as it is much clearer than I could ever be. The end result here is that you are right. No one should ever use expressions like that. They are sometimes used in classrooms to demonstrate bad code for a reason!

I will disagree with you about the pointers though. Yes bad code can be created using silly means, but a competent coder should not fear to use pointers. They are really useful! Don't shy away from such a powerful tool because they can be confusing, just make sure you are not the one writing the bad code. =)


I never once said that a good programmer should not use pointers. I use pointers all the time, I just don't necessarily increment them using ++.

edit: btw, I used those examples because I've actually seen them in codebases.

yep, that's right. I have seen real code written by real people that looks that confusing.
Prev 1 2 3 All
Please log in or register to reply.
Live Events Refresh
Next event in 16m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 207
RuFF_SC2 36
StarCraft: Brood War
Artosis 698
ggaemo 293
NaDa 98
Aegong 42
Dota 2
LuMiX1
Counter-Strike
Stewie2K829
taco 440
Foxcn214
Super Smash Bros
hungrybox362
Other Games
summit1g13661
shahzam1194
Day[9].tv850
monkeys_forever209
C9.Mang0198
ViBE174
Maynarde170
Livibee96
Trikslyr69
Sick50
Organizations
Other Games
gamesdonequick1669
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• Berry_CruncH210
• Hupsaiya 70
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• IndyKCrew
• Kozan
StarCraft: Brood War
• HerbMon 17
• Azhi_Dahaki16
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota22715
League of Legends
• Doublelift5908
• TFBlade584
Counter-Strike
• Shiphtur612
Other Games
• Day9tv850
Upcoming Events
DaveTesta Events
16m
davetesta57
The PondCast
9h 16m
Online Event
15h 16m
Korean StarCraft League
2 days
CranKy Ducklings
2 days
BSL20 Non-Korean Champi…
2 days
Mihu vs QiaoGege
Zhanhun vs Dewalt
Fengzi vs TBD
Online Event
2 days
Sparkling Tuna Cup
3 days
BSL20 Non-Korean Champi…
3 days
Bonyth vs TBD
OSC
4 days
[ Show More ]
uThermal 2v2 Circuit
6 days
Liquipedia Results

Completed

BSL 20 Non-Korean Championship
FEL Cracow 2025
Underdog Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL 20 Team Wars
CC Div. A S7
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025

Upcoming

BSL 21 Qualifiers
ASL Season 20: Qualifier #1
ASL Season 20: Qualifier #2
ASL Season 20
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
Maestros of the Game
SEL Season 2 Championship
WardiTV Summer 2025
uThermal 2v2 Main Event
HCC Europe
Yuqilin POB S2
ESL Pro League S22
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
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 © 2025 TLnet. All Rights Reserved.