[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
List the most ridiculous parts of your least favorite programming
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: 117
Thread images: 6
File: stop_php.jpg (22 KB, 238x283) Image search: [Google]
stop_php.jpg
22 KB, 238x283
List the most ridiculous parts of your least favorite programming languages:
>PHP
>array() is not a function
>mysql_escape_string()
>zend
>>
>>42497210
keep that tripcode
>>
>>42497210
>English
>being a horrible mess of Latin, Anglic, Saxon, some Celtic dialects, Norse, Norn, some French, some Scots, etc
>>
>>42497220
second

>>42497210
I completely agree with everything you said
I added your trip to the follow list
>>
>Objective C
>needlessly complicated
>>
I admit, I actually really like Perl...
>regex abuse (
/\/[^\/]*\/\.\./
)
>2 argument open()
>object oriented perl (bless my ass)
>>
>>42497210
Swift
>doesn't work
>slow
>>
>>42497331
Upvoted fellow tripfag
>>
>Lua
>No continue
>>
>>42497210
What's your problem with mysql_escape_string()?
>>
>>42497210
> Python.
> Duck typing mostly based around "everything is a string"
> Much of Python implicitly does conversions on charsets
So perhaps your python code worked fine on Linux with UTF8, but Windows with cp1252 will crash in 100 places...

Add to that the various drawbacks on the compiler in terms of error detection and optimization, and I'm really not sure why the idiot who designed the language ever went with duck typing over static (but structural) typing...

> BASIC
> Fucking goto
> Line numbers (for older variants)

> ABAP
Maybe it was an older version, but the problem is that I can't remember what even was *good* about that piece of shit. Everything from the tools to the language and syntax was crap.
>>
>>42497331
What a disgrace to the Perl communities.
>>
>>42497210
>writing your own code in php
>not using frameworks
>not copypasta code from google
stay pleb
>>
Haskell:

-not object oriented
-doesn't know mutability
-cabal sucks
>>
>>42497210
>mysql_escape_string()
Is long deprecated btw. Complaining about deprecated features isn't really fair TBH
>>
>C#
After years I still have problems with it.
>>
If php is so bad, what do you replace with?
>>
http://yosefk.com/c++fqa/index.html
>>
>>42497396
You don't replace it, you just don't develop more crap in it.
>>
>>42497395
>DataBinding in WPF
Forgot about what I was talking about.
>>
>>42497210
>08 invalid octal literal parsed as 0
fuck.
>>
>>42497396
with a later version of php.. If you are not happy with php 4, use php 5
>>
>>42497396
>>42497406
suicide is the only option
>>
>>42497350
I like my databases secure.
>more PHP
>PHPE9568F34-D428-11d2-A769-00AA001ACF42
>different functions for slightly different situations
>the fact that goto was *added* to PHP
>>
>>42497424
>doing entire rewrites just because it's in PHP
NEET detected

I bet you rewrite Python in Haskell too, right?
>>
>>42497352
SAP is how Lucifer interacts with our world.
>>
>>42497439
suicide is the only option
>>
>>42497446
>telling me to commit suicide because I recommend not using PHP
>>>/v/
>>
>>42497396
CGI scripts/ASP .NET/Ruby on Rails/Django

Hell you are better off using Drupal instead of just plain PHP.
>>
>>42497455
suicide is the only option
>>
>>42497464
>ASP .NET
microsoft shill detected.
>>
>>42497396
Go
>>
>>42497430
>>42497352
There's nothing wrong with GOTO and you guys are all bandwagoning Djikstra without even understanding the context.
>>
>>42497485
Seconded
>>
>JS
what(function() {
the(function() {
fuck(function() {
am(function() {
i(function() {
doing(function() {
});
});
});
});
});
});


>PHP
>==
>T_PAAMAYIM_NEKUDOTAYIM
>if (): fuck(); endif
>define() and const
>The ternary operator precidence.
>FULL CAPS KEYWORDS
>CaSe InSenSiTiViTy Of ClAsSeS, MeThOdS aNd KeYwOrDs
>Consistency of std lib naming
>13 sort funitons
>"Headers already sent"
>No module system.
>Fucking errors
>$n / 0 == 0
>No routing
>Globals in functions
>Multiline statements result in moving line numbers in stacktraces
>>
>>42497396
Basically anything that can send data over an HTTP connection is better than PHP.
>>
>>42497498
>using js badly
>not educated about callback hell
wut
>>
File: israel_14.png (20 KB, 1176x783) Image search: [Google]
israel_14.png
20 KB, 1176x783
what is the real reason /g/ hates php??? pic related
>>
>>42497498
IMO, the alternative syntax(if: endif) is useful, at least for templates.
>>42497485
I'm not bandwagonning Djikstra. Can you tell me when did you ever need gotos in a templating language?
>>
PHP works just fine, stop being a pleb and learn how to use it.

>posting deprecated functions
>>
>>42497543
tripfag harder retard
>>
>>42497543
>PHP
>template language
I'm not a fan of mixing business logic and output...

If you use objects and functions in a template language, you're doing it very very wrong.
>>
>java
>explicitly have to declare which exceptions a method can throw
>change one method by adding a new exception that it can throw
>have to change the method signatures of all methods up in a chain that can call it
Jesus this is worse than Go's if err != nil bullshit.
>>
>>42497591
What's the deal with Go's panic()/recover() shit
>>
>>42497396
Ruby or Javascript/Node.js.

/thread
>>
File: whatsthedeal.jpg (15 KB, 300x257) Image search: [Google]
whatsthedeal.jpg
15 KB, 300x257
>>42497601
You forgot your pic
>>
>>42497601
The designers didn't want exceptions, everyone yelled at them and they found it was difficult writing parsers and such so they reneged and implemented a purposely retarded version of exceptions that's painful to use, thus both comprising their design intent as well as having a very shitty version of exceptions in the language after all.
>>
>>42497679
so in effect one could abuse panic()/recover() to avoid checking if err != nil conditionals... l o l
>>
>>42497614
>>>/HN/
werc is the least harmful solution
>>
>>42497498
>what is EventEmitter
>>
>>42497704
Sort of, but established convention is to return an error code, so for pretty much everything you haven't written yourself you'd need to check return values to know when to panic anyhow.

Like I said, the intent was to make it miserable to use in the general case.
>>
>>42497704
Not really. You don't know what caused the panic or where, so most of the time you have no idea how the fuck to clean it up.
>>
>>42497819
Panic takes an interface{} value you can retrieve and inspect from Recover.
>>
>>42497779
I love Uriel, but doesn't werc default to using Perl markdown rather than something in a not-shit language?

Besides, gopher is quite a bit less harmful than anything web-based.
>>
>>42497485
No Dijkstra bandwagon. It's just a shit concept.

Make and label a function or method, then jump to that, from a method call.

Jumping to arbitrary lines of code is a shit idea.
>>
>>42497236
>>42497220

Could someone explain this to me? What can you do with tripcodes?
>>
>>42497930
for (i = 0; i < N; ++i)
{
for (j = 0; j < M; ++j)
{
if (some_condition)
{
goto break_loop;
}
}
}
break_loop:
>>
>>42497950
His opinion was shit and they want to filter him.
>>
>>42497927
Just write you own
>>
Obj-C. Either the macfags or the syntax.
>>
>import aids
>couties
>>
File: erio_futon.jpg (144 KB, 1280x720) Image search: [Google]
erio_futon.jpg
144 KB, 1280x720
And yet PHP is most efficient (in terms of execution speed) and the language with the most tools implemented.

Are you mad because you didn't invent it or are you just too stupid to understand such a complex language?
>>
C++
> Template abuse in the STL
>>
>>42498241
>complex language
>>
>>42497958
Exactly. You can't do this with method calls, I just want to be able to jump out of code without having to jump back in.

Everybody tells me it's wrong, but it feels so right.
>>
>>42497958
But why? First of all, you can avoid breaks altogether if your language isn't silly.

But even if, you just want to return to the usual exit point of the block of code in question - never anywhere else. Like here:

import scala.util.control.Breaks._
val n = 10
val m = 20
for(i<-0 until n;j<-0 until m) {
if (i>10) break else {
if (i>j+4) break else(print("derp"))
}
}
>>
>>42498435
Of course you can.

Even if your language is pretty shitty, you should still be able to make this block of code a method or lambda or anonymous inner class or whatever, and just return from it.

It unfortunately doesn't solve the problem of other programmers using goto, but it can be company policy not to use it.
>>
I love Ruby, but...
>some parts of the community
>Blocks called in a function which have a return end the function, lambdas don't for some fucking reason
>implementations suck ass
>>
>>42498478
>>42498454
>C programming
>lambda or anonymous inner class or whatever
Nigger, there is a reason why goto exists in C and doesn't exist in Java.

>make this block of code a method
Not if the nested loops require a lot of state checking (as in beyond just i, j, N and M).

>inb4 C is shit
C is lingua franca in the world of embedded programming, and branch prediction is another important factor which makes it stupid to do a lot of unnecessary if checks.
>>
>>42498435
That's why I use while statements instead. Just add the extra boolean clause to terminate all loops.
>>
>>42498507
>what is branch prediction
>>
>>42498507
What has while loops anything to do with that, you can do that with for as well you fucking faggot

for (i = 0, continue_looping = 1; continue_looping && i < N; ++i)
{
for (j = 0; j < M; ++j)
{
if (some_condition)
{
continue_looping = 0;
break;
}
}
}
>>
>>42498528
Break is just as harmful as GOTO, if not more so
>>
>>42498536
No.

Break is my life.
>>
>>42498536
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>

jmp_buf env;

static void catch(int signo)
{
longjmp(env, signo);
}

int main()
{
int a, b, c;
signal(SIGFPE, &catch);

if (!setjmp(env))
{
a = 0;
b = 2;
c = b / a;
}
else
{
puts("you're wrong");
}
}
>>
>>42498536
Break IS goto.
It is a conditional goto with syntactic sugar.

Hell, the damn while statement does exactly what Goto does at the lowest levels.
It halts a whole chunk of code and JUMPS to another section beyond it.
Break is better than Goto due to that because it can only step ahead of the loop rather than go behind it.

That is one of the biggest abuses of Goto, jumping BACKWARDS.
There are very few places that should ever EVER need to be done.
A common one is ask something, wrong format / answer, goto the question again, instead of doing it in a loop until it is successful.
Not only is that nicer, it plays less hell with the computer.
Mind you, these days it doesn't matter as compilers are stupidly good, so really it is all retards being old and anal over a literal non-issue.
>>
>>42498241
>PHP is most efficient
Are you fucking serious?
>>
>>42498599
>taking the bait
>>
>>42498500
> Nigger, there is a reason why goto exists in C and doesn't exist in Java.
Java almost has a goto in shitty break <label>.

That aside, enabling the programming language to be less stupid might just be a good idea. It's not like most ways in which this can be addressed have a performance impact.

> Not if the nested loops require a lot of state checking (as in beyond just i, j, N and M).
Then make it a method.
def muhMethod {
val n = 10
val m = 20
def runLoops {
for(i<-0 until n) {
for(j<-0 until m) {
if(j+5<= i) return else print("derp")
}
}
}
runLoops
}

It's not that hard, is it?

> C is lingua franca in the world of embedded programming, and branch prediction is another important factor which makes it stupid to do a lot of unnecessary if checks.
So you could use a method OR have a compiler that optimizes this code or support a language construct that obsoletes "breaks" entirely or any other number of solutions.
>>
>>42498751
>Java almost has a goto in shitty break <label>.
I know, and they're great because they force you to only use GOTO as a nested break. That's also what PHP is getting now.

>It's not that hard, is it?
As I said, it's impossible to make it a function if it requires a lot of state beyond four simple variables. Lrn2 read

>So you could use a method OR have a compiler that optimizes this code or support a language construct that obsoletes "breaks" entirely or any other number of solutions.
You can't rely on the compiler to interpret what you read just because you have an autistic fit against gotos and breaks. Just look at the Linux kernel. There is a reason why you have macros such as likely and unlikely.
>>
>>42498751
> I know, and they're great because they force you to only use GOTO as a nested break. That's also what PHP is getting now.
I had little respect for PHP's designers, but if they thought breaks and gotos and shit like that needs to be expanded on rather than eliminated, I think I just lost some more of it...

> As I said, it's impossible to make it a function if it requires a lot of state beyond four simple variables. Lrn2 read
But this is simply not fucking true. You can have an infinite amount of state in a method. All you do now as opposed to before is not jump to a label placed anywhere, but return the method as usual.

One entry point into a method, one exit point. Simple for you, simple for the compiler, simple for whoever writes tests.

> You can't rely on the compiler to interpret what you read just because you have an autistic fit against gotos and breaks. Just look at the Linux kernel.
This is all unrelated. Of course you can rely on a compiler to optimize if statements.

Gotos are unnecessary and harmful, and I don't really care how the Linux kernel was coded.
>>
>>42498883
>You can have an infinite amount of state in a method.
Stopped reading there.

>Protip: standard C doesn't have inner methods
>>
>>42498904
> Protip: standard C doesn't have inner methods
It's a flaw of C, but you can still have your IDE / editor generate a regular method with parameters from the selected nested loops (plus the invocation thereof). Then you just add a return statement rather than a label and gotos, done.
>>
im gonna cum insie you
>>
>>42498599
Look at the benchmarks
It executes faster than Python and Ruby
>>
>>42498883
>Gotos are unnecessary and harmful
Are you for real
>>
>>42498318
>STL = Standard TEMPLATE Library
>>
>PHP
- application architecture (has to bootstrap the whole application for every single request)
- the syntax
- the fact that there are multiple different syntaxes to do the same fucking thing
- arrays a.k.a lists a.k.a maps
- module loading, class loading and namespaces
- annoying to debug
>>
>>42497384
So you want Haskell to be Java. Kay.
>>
>javascript
>object equality checks for identical memory addresses, not value equivalence
>variables are scoped at the function level, not the block level
>>
>>42500518
Its funny how similar PHP is to a CGI environment despite it attempting to replace it.
>>
>>42500518
don't forget php.ini and compile flags
>>
>>42497210
>using goto in any language
>having to use goto in php because you don't know how to write in an easy pleb language

You're a terrible programmer OP. You have to know how to use and write in any language if you know it.

If you find a job that uses PHP with good pay are you going to shit around and tell them they have to change it? You should consider killing yourself, you don't belong in technology at all. Go become a hating feminist.
>>
>>42497210
>array() is not a function
OMG SIZE_OF NOT FUNKT!!!!!

>mysql_escape_string()
and what's wrong with this?
>>
>>42497958
What if you use recursion instead of this?
>>
>>42497392
then why isn't it removed from the language
>>
>>42497483
Do you mean go like go or go like go?
>>
>>42501733
Nothing, he's probably using the function wrong by putting in the wrong parameters.

Also new versions of PHP require you to use mysqli_escape_string()

Also, you shouldn't rely on that function soley to save your ass.

You have to know how the vuln hole works/the bug is activated to patch your shit code. PHP isn't easy in that part because people don't want to use their heads to solve security problems.
>>
>>42501772
Because some sites still use it, older versions of PHP and their developers are lazy to upgrade it, or the site is protected by another function similar to that.
>>
>>42501772
"comportability"
>>
>>42501795
they are just going to stay on an older fuckin version of php anyway because they don't give a shit, deleting the function will just make shitters who don't deserve a single penny cry

php devs are morons
>>
>>42501833
It's not my fault the host has an old version of PHP.
>>
File: image.jpg (65 KB, 540x300) Image search: [Google]
image.jpg
65 KB, 540x300
>>42501833
At least they have jobs
>>
>>42497930

Confirmed for knowing how a computer work.

Every fancy loops and IF..THEN..ELSE statement will be converted into Jumps and Goto.
>>
>>42497210
>all that hate for PHP
why don't you look at the good side?
it's easy as fuck, most of the time is the first language you learn when you want get into programing, it have an enormous base of users, scripts, open source motors, web servers and support.

PHP It's completly fine if you wan't to do some proyect you will not drasticaly escallate in a near future.
>>
>>42501940
This, but don't limit yourself to PHP because it's easy, it'll become a prison.
>>
>>42501833
>php doesn't come with tooling to manage php versions when it's apparently such a huge problem
:DDDD

>>42501876
i have a job in php
>>
Http://phptherightway.com
>>
>Java
>array.length is a field and not a getter
>>
>>42501993
Arrays aren't really objects and length isn't really a field but a call to a special bytecode instruction "arraylength" which does what it says.
>>
>>42497384
Cabal hell is real.

I've been there.
>>
>C
>nothing
>>
C
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

switch(count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while(--n > 0);
}
>>
>Delphi
>fucking... everything
>Pascal synthax makes anonymous functions absolutely pointless - with all the BEGIN ENDs they're so huge you might as well create a normal method
>No covariance tends to be a pain in the ass
> The IDEs are just plain terrible
>>42502487
I lol'd at the loop
Thank God I switched jobs
>>
>>42501916
This.

>>42502487
Listen, you could make unreadable Python like that first line if you really wanted.

Duff's device is silly as hell though. Cute, but it's still kind of disgusting that by default case falls through.
>>
>>42497210
>PHP
>People actually use this intentionally
>>
>>42497498
>PHP
>errors
PHP never fails. It never fails, even if it have to.
>array_key_exists(true,false); // warning
> strlen(null); // warning
> "shit" + 1; // warning
and if it finally fails, for example if you try to do
>null.toArray();
it fails with fucking "Fatal error" message without sign of a stack trace.
PHP is for real magicians.
Thread replies: 117
Thread images: 6

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.