[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Anyone else go to a retarded university? Earlier this week my
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 2
File: 1418181199058.jpg (174 KB, 1533x961) Image search: [Google]
1418181199058.jpg
174 KB, 1533x961
Anyone else go to a retarded university? Earlier this week my dumbass professor asked me why I keep using ternary operators and hex numbers in my homework.
>>
What was your answer?
>>
>>51559392
Don't you have a street to poo into rajeesh?
>>
>>51559431
They're faster and more efficient.
>>
I go to a uni where all of my professors are either Chinese or Indian
>tfw code in PowerPoint slides contains basic errors
>tfw every class is in Java or PHP
>tfw they teach us to uselessly comment every like //increment i by one
>>
>>51559392
>retarded university
If you can't afford/manage to get into the best in your country why even bother going to uni tbqh pham?
Polimi master race reporting in
>>
>>51559452
Not really: ternaries compile just the same as if-statements (with conditional branches, or very occasionally conditional-coded instructions on legacy ARM), and basically any literal constant is equivalently referenced.

Be careful of ternaries. While they are useful syntactic shortcuts, careless use can bite you where you least expect it sometimes, especially in duck-typed languages where which things are 'truthy' and 'falsey' when coerced into a boolean are not necessarily obvious: PHP's a poster child for that, but so is javascript. The same can be true of using inline (statemented) if/then/else constructs in the languages that support it - I frequently used it in Lua as a nil-squasher, but you need to be vigilant about in which circumstances it could fuck things up.

Clear formatting can be challenging, too. It can look quite nice sometimes as:
 variable = expression
? value_if_true
: value_if_false;
>>
>>51559461
I hate that comment every line crap. If you write good code it shouldn't be necessary to explain every single line. This is only acceptable somewhat in assembly.
>>
>>51559452
Your uni is dumb, but you're equally as dumb if you actually responded with that.
>>
File: 79aE4Wu.png (12 KB, 565x365) Image search: [Google]
79aE4Wu.png
12 KB, 565x365
>>51559833
>PHP's a poster child for that
PHP evaluates ternaries from right-to-left, which is why it confuses fucking everybody.
>>
>>51559392
>at uni
>computing lecture
>slides on laptop through laptop, stepping through, not on slideshow
>look at taskbar, bubble about bluetooth
>try to connect to laptop from phone
>security popup, laptop makes a noise
>lecturer gets flustered
>5 minutes later gets popup to go away
>doesn't turn off bluetooth, doesnt silence.
>repeat for the rest of the class
>>
>>51559392
>frogposter
Makes sense.
Thread replies: 12
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.