ITT: Retarded shit in programming

ITT: Retarded shit in programming

>explicit data types
>variable must be final in anonymous class method call
>array index starts at 0
>casting
>Manager, Impl, Factory
>Listeners

Attached: dc07-02d3-4af4-ab84-082c8023b106.jpg (300x300, 17K)

Other urls found in this thread:

github.com/python/cpython/blob/master/Objects/rangeobject.c#L722
en.wikipedia.org/wiki/Operators_in_C_and_C++#Criticism_of_bitwise_and_equality_operators_precedence
en.wikibooks.org/wiki/C++_Programming/Code/API/Win32#The_Windows_32_API
youtu.be/CX_xUN89qeA?t=16m38s
twitter.com/SFWRedditImages

Stop using java.

>>array index starts at 0
not retarded
as for the rest, haskell doesn't have these problems

>array index starts at 0
i used to think this before i started coding daily. but it actually makes a lot of sense

for i in range(0, len(arr)):
print arr[i]


is just a good, logical way of doing it. i see no good other alternative

>implicit data types

>recursion
>lambdas

#include

>>array index starts at 0
an index parameter is not the numerical position of the item in the list, it's the offset from the first item in the list

that's a joke right? am i falling for the bait?

for i in arr:
print i

>>casting

Attached: KfvbBdIDR5lqQhLR0kJ1kWJDWcxtCf_oIt5gbLjzLiQ.png (560x632, 141K)

Yes I know but it is unintuitive for lists imo.

>casting
cum on

>>explicit data types
How is this a bad thing
>variable must be final in anonymous class method call
This is because when you use an anonymous class or lambda, for all you know it could execute it in another thread. There's no concept of synchronization for local variables, thus it would be a concurrency mess if it didn't enforce that they be final.
>array index starts at 0
Bait
>>casting
Necessary evil

Instead of enforcing final variables you could just have decent closures. But Java's not up for that.

How fucking hard is it to do
>final Foo finalFoo = mutableFoo
Most IDEs will do it for you anyway.
If you need it to be mutable and you know it won't get modified in another thread then you just use a mutable holder type.

Your intuition is garbage. Go program some more and you'll eventually learn why indexing starts at 0. (hint: off-by-one errors are so much easier to make if indexing from 1)

>casting is retarded
t. doesn't know what a a void pointer is used for

list comprehensions
everything is a string
comma (or any common character) separated list if it leads to escaping hell
C' operator precedence (== has higher than &)
C's char, short, int, long, long long, unsigned and multi-word type names
C's declaration syntax
C's printf format string
errno
implicitly adding semicolon at the end of line during lexing/parsing
UTC time format

>list comprehensions
There's nothing wrong with these. They're basically just compact versions of stream operations.
The problem is when people use list comprehensions when they should be using a generator expression.

> significant whitespace

Attached: grrrr intensifies.gif (643x539, 2.12M)

Arrays have the first element at offset 1 anyway. They use offset 0 to store the size. That's why you can see the size of an array in java.

> Language where every variable is global

The entire C language

Nothing specifies that an array has to be structured that exact way. An array could just as well be a struct consisting of a length value and a pointer, with the pointer pointing at a seqence of data elsewhere in memory.

>t. FORTRAN programmer

>explicit data types
>array index starts at anything other than 0
> ;
>not julia

that's not how it works
empirical observation: the length variable size can be larger than array element size

>objects
>classes
>encapsulation
>the jvm

>explicit data types
Necessary for good tooling that helps you find probable bugs and for good performance since with explicit types, the code can get optimized and doesn't have to branch depending on the variable type.
>>variable must be final in anonymous class method call
No idea.
>array index starts at 0
That's just how it is, no point in arguing about that now. I guess it's a minor optimization because otherwise, you'd either need an additional instruction to decrement the index or store the array as a pointer to the first memory address before the array, which would be strange.
>casting
Are you kidding me? Do you not understand types or something?
>Manager, Impl, Factory
Patterns are useful unless they are overused. But yes, if they are overused, and Java devs love to do that then that is actually retarded.
> Listeners
Probably one of the most useful patterns there is. Making code extensible is great, as is not putting all your code into one huge 5000 LOC function.

>Necessary for good tooling that helps you find probable bugs and for good performance since with explicit types, the code can get optimized and doesn't have to branch depending on the variable type.
Necessary? Type inference nets you the same without having to explicitly write type declarations, kiddo.

>for i in range(0, len(arr)
THIS is an example of retarded shit in programming. That's wasteful Ruby-Python-JS bullshit.
You could write a simple for loop, which means optimal performance, readability and only 1 memory allocation for the loop variable (though that happens on the stack on non-retard languages so it literally doesn't matter). But no, you make a function call in which an array with the same number of elements as the array you're trying to iterate through is allocated (on the heap of course), then a for loop goes through the array and initializes it so that it contains the desired sequence (so you do the for loop anyway), then a pointer to it is returned (actually a pointer to some huge struct wrapper that also handles things like cyclic dependencies and refcount and type and whatever, one for the array and one for each element in that array, because lol script languages, computers are fast now, I can afford to be wasteful, LOL).
Then an iterator is allocated and initialized for the array by the "in" loop construct. Then, its "next" method gets Called, its "valid" method is called and checked whether it's false, and if it isn't, then the iterator's current element is fetched and only then your loop body, the code you actually need to run, is executed.

FUCK, this is some retard shit. No wonder programs haven't gotten faster since the 90s even though computers are now ridiculously absurd supercomputers compared to back then.

>an array with the same number of elements as the array you're trying to iterate through is allocated
That's how range used to work in python2, then they introduced iterators and generators with xrange that did not done any allocation (beside closure I guess) which became the default range in python3. It's iterator interface without any collection underneath.
Since it's a builtin function I would guess range is optimized in C but could not find the implementation in hurry.

Attached: 1516108161841.jpg (1561x2048, 236K)

Yes but that's a retarded way of doing it.
You almost never need to do a plain 0, 1, 2...n loop in Python.
If you're iterating over a list, you just use a foreach loop on it.
If you need the index too, you use
for index, value in enumerate(values)

Also, if the code is python 3, then you're wrong. range in py3 is the same as xrange in py2, as in it does not create an array, it's just an iterator from x to y. It never dumps all the values to a single array unless you explicitly convert it to a list.

there it is
github.com/python/cpython/blob/master/Objects/rangeobject.c#L722
doesn't look like a big overhead to me

>because lol script languages, computers are fast now, I can afford to be wasteful, LOL
yes, when an abstraction that can be applied to a much wider variety of things than iterative access of sequential memory allows you to write code and complete tasks in a tenth of the time it'd take to write it the "fast" way, you can definitely afford to be wasteful

enjoy being a unemployable loser

>wasteful

It's not wasteful. It trades runtime for devtime.

all of the things you mentioned there are good

well, explicit types are only good when they're optional

Good bait

>That happens on the stack in non retarded languages
Wrong, it happens in a register, why would you push a counter to ram every time it updates in a loop that's dumb

had to bypass the legal protections on C somehow.

There's absolutely NOTHING wrong with casting your pointers you lazy orc.

>typedef int INT;

you'll get UB, you should use a union

>retarded shit in programming
-Non-hardware level programming.
-Graphics.
-This website.

>explicit data types
>array index starts at 0
>casting

Literally he opposite of retarded

>variable must be final in anonymous class method call
>Manager, Impl, Factory
>Listeners

Don't use shitty OOP languages, retard.

There is any example of a mutable datatype that is not a slogfest that takes a shitton of memory?

That's how it works in code written by brainlets.
Hint: How do you have an array of more than 255 bytes?

When will javajews learn

Javeets, you mean

Dude, all of those things are perfectly fine. If you think they retarded shit, you might want to rethink your life choices.

>How is this a bad thing
Why should I have to tell the compiler what type of integer to use? It should be smart enough to figure it out on its own.

I'm guessing you also think oop was a mistake right?

>It should be smart enough to figure it out on its own
How the fuck is it going to know what is or is not an acceptable value for a public field on some object?
Code that is completely separate from the code you're compiling might write to it, and the compiler has no way of knowing what values it will try to write.
If you use a value that's too wide, it's wasteful of memory and might be inefficient on 32-bit systems. If you use a value that's too short, you don't get to use all the values you wanted to.

>If you use a value that's too wide, it's wasteful of memory and might be inefficient on 32-bit systems
Holy shit you're retarded. RAM is cheap I could double the width of all the numbers in any program I run and not even notice. Nobody runs 32bit any more.

It's like you WANT integer overflows.

*good* fortran HAS significant whitespace you joker.

Attached: 1526251752601.png (450x450, 265K)

>functional
>meme pattern

I agree with you when you're talking C.
If not, then I would urge you go read a fucking book.

Attached: 1529086990558.jpg (350x350, 35K)

>premature optimization

Attached: 1481037475356.gif (245x245, 721K)

Python 3 aliases range() to xrange() now so it produces the array indices incrementally; still a bit of runtime overhead for the iterator call but it doesn't eat up RAM anymore

>tfw edit some php code for my website
>never learned php
>had to select something from an array I couldn't see by using 0
It took a while before I understood the logic behind it. Because I initially thought 0 would have meant false or something.

poopie

>RAM is cheap I could double the width of all the numbers in any program I run and not even notice
ram bandwidth isn't, pleb

Winner

Never again working with the win32 api.

You trade dev time for technical debt.

>wide strings hell
>annoying typedefs that hide if something is a pointer/reference or const
>tons of inconsistent stuff
>shitty documentation
What a terrible mess, fuck winapi.

haskell doesn't understand tabs in 2018

The offside rule is optional. You may use braces and semicolons.

takes like an hour to set up a window context

this. I sure hope no one is using python for performance critical programs, and if they do, they should C-inline or assembly inline relevant sections (after proper profiling of course)

So much of the Python work I've done scales just by throwing more machines at it that - as long as I don't write the dumbest possible algorithms and thrash a db - it is "fast enough".

Nobody uses Python et al. for performance critical stuff you absolute retard.

Attached: computer_science.png (728x800, 79K)

Shut up nerd

>implying it isn't the exact opposite of what graduates think

>C's char, short, int, long, long long, unsigned and multi-word type names
>2018
>not using uintX_t and intX_t

The entire delphi language. Not only retarded, but pig disgusting and vile.

I won.

I don't even understand tabs.

There is a very good reason for why the C operator precedence is like it is.

ok then, tell me why

Kek, your complaining about C is totally unfunded. The C language was made for writing operating systems. A retard like you who never wrote a driver wouldn't ever understand why C is like it is.

>syntax decisions were made like this because it was made for writing operating systems REEEEEE
no

>all these BUT PYTHON 3 ALIASES IT TO XRANGE responses
Fucking pathetic

if (flags.flag1==0 && flags.flag2==0 && flags.flag3==1) { ...}

Well it doesn't; xrange isn't a thing in Py3.

It's entirely beside the point though, 'cause if you're at the point where the memory efficiency and function call overheads of range() matter, you're fucking retarded for continuing in Python.

& is not &&

??????

& has higher precedence than ==, you literal chimpanzee.

You know jack shit about C, yet you're trying to pose as you know it. Go back for webdesign.

Attached: 1491962003096.jpg (211x238, 15K)

wat is gud web framework in C

Oh wait, the retard is talking about the bitwise and? It is the exact same reason why logical and is under equality.

en.wikipedia.org/wiki/Operators_in_C_and_C++#Criticism_of_bitwise_and_equality_operators_precedence

see

>>array index starts at 0

In VBA it starts at 1
And I can tell you it leads to all sorts of retarded hacks to add the extra digit.

I don't see why the same reason on both makes any sense, bitwise should intuitively evaluate before comparisons and those should evaluate before logical
all sane languages do it this way, C only as this stupidity to keep backward compatibility with pre-standard k&r C

They use Numba, Theano, Numpy etc.
Using specifically written inline C over those is in 99% of cases premature optimization. The devtime cost is huge and the speed gain is literally single digit % at very best.

Unless you're heavily constrained by memory or are writing something so performance-critical that increasing devtime by a factor of 10 is still worth it, you're better off not being a fedora.

>Because I initially thought 0 would have meant false or something.
integers autocasting to boolean is more retarded than anything else mentioned in this thread.

>The Windows version was still only one working line of code but it required many, many more lines of overhead. Charles Petzold, who wrote several books about programming for the Windows API, said: "The original hello world program in the Windows 1.0 SDK was a bit of a scandal. HELLO.C was about 150 lines long, and the HELLO.RC resource script had another 20 or so more lines. (...) Veteran programmers often curled up in horror or laughter when encountering the Windows hello-world program."

Imagine writing 170 lines just to say hello world. I dont know much about programming; I just finished my first couple java and c++ classes at the local community college. Can anyone explain why it would take 170 lines to write hello world?

It's talking about a GUI hello world example using the Win32 API, which (of course) is arduous.

en.wikibooks.org/wiki/C++_Programming/Code/API/Win32#The_Windows_32_API

That said, Java is embarrassingly verbose for something like Hello World, too, so keep your head down.

That's still a shitty wasteful method. A higher-order reduce function can be run in parallel to do anything you want with arrays in constant time.

>run in parallel
>in constant time

Attached: 1529541134032.png (476x519, 275K)

youtu.be/CX_xUN89qeA?t=16m38s