#DEFINE TRUE FALSE
god C sucks
Forum Index > General Forum |
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
Hyrule18969 Posts
December 21 2015 20:57 GMT
#13901
#DEFINE TRUE FALSE god C sucks | ||
Shield
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
Spain17835 Posts
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:
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
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:
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. | ||
pEcul!Ar
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:
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. | ||
Soan
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
United States1080 Posts
December 27 2015 04:47 GMT
#13907
This: http://www.digitalartsandentertainment.be/page/14/Course overview doesn't look like a normal software engineering program with a focus on game dev. | ||
Soan
New Zealand194 Posts
December 27 2015 19:49 GMT
#13908
| ||
Shield
Bulgaria4824 Posts
December 27 2015 22:23 GMT
#13909
It compiles fine. :D | ||
spinesheath
Germany8679 Posts
December 27 2015 22:47 GMT
#13910
On December 28 2015 07:23 darkness wrote: Wow, C# that's nasty...
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: stackoverflowIf 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. | ||
Birdie
New Zealand4438 Posts
December 28 2015 01:57 GMT
#13911
I'm part-way through the first part, pretty fun. | ||
Deleted User 3420
24492 Posts
December 28 2015 16:28 GMT
#13912
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
Hyrule18969 Posts
December 28 2015 16:32 GMT
#13913
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. | ||
Deleted User 3420
24492 Posts
December 28 2015 19:44 GMT
#13914
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
Belgium2760 Posts
December 28 2015 19:56 GMT
#13915
| ||
Deleted User 3420
24492 Posts
December 28 2015 20:01 GMT
#13916
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
Poland17187 Posts
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...
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. | ||
![]()
tofucake
Hyrule18969 Posts
December 29 2015 01:28 GMT
#13918
$someVar = $someObject->someMethod() ?: ''; WHY | ||
Manit0u
Poland17187 Posts
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:
Result:
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:
| ||
Shield
Bulgaria4824 Posts
December 31 2015 22:26 GMT
#13920
![]() | ||
| ||
![]() StarCraft 2 StarCraft: Brood War Dota 2 League of Legends Counter-Strike Super Smash Bros Other Games summit1g11108 singsing1879 C9.Mang0857 hungrybox492 Tasteless254 JuggernautJason121 Skadoodle109 Nina58 Organizations Other Games StarCraft: Brood War StarCraft 2 StarCraft: Brood War
StarCraft 2 • Berry_CruncH281 StarCraft: Brood War• practicex ![]() • v1n1z1o ![]() • Catreina ![]() • IndyKCrew ![]() • AfreecaTV YouTube • sooper7s • intothetv ![]() • Kozan • LaughNgamezSOOP • Laughngamez YouTube • Migwel ![]() Dota 2 League of Legends Other Games |
PiG Sty Festival
Clem vs Bunny
Solar vs Zoun
Replay Cast
BSL Nation Wars 2
Korean StarCraft League
PiG Sty Festival
herO vs Rogue
ByuN vs SKillous
SC Evo Complete
[BSL 2025] Weekly
Online Event
Replay Cast
SOOP Global
ByuN vs Zoun
Rogue vs Bunny
[ Show More ] PiG Sty Festival
MaxPax vs Classic
Dark vs Maru
Sparkling Tuna Cup
BSL Nation Wars 2
Online Event
The PondCast
|
|