What syntax component do you despise most in a shows language you make use of regularly?

Despite just how much you enjoy a shows language, there are constantly a couple of information in it that aren't fairly as wonderful as they can be.

In this inquiry, I would love to especially concentrate on syntax components. In a shows language that you make use of regularly (probably your favorite shows language, or probably the one you are compelled to make use of at the workplace), which syntax component do you locate most unreadable, vague, bothersome or undesirable?

0
2019-05-07 03:01:06
Source Share
Answers: 30

Function reminder declaration syntax in C and also C+npls :

(int)(*f)(int, int);

That proclaims a function reminder called f whose pointee can take 2 ints and also return an int.

I would certainly a lot favor a syntax similar to this :

f: (int, int) => int

Say you intend to proclaim a function reminder g whose pointee can take 2 ints and also a function from int and also int to int, and also return an int.

With C or C+npls symbols, you would certainly proclaim it as :

(int)(*g)(int, int, int(int, int));

With the above - recommended symbols very same point can be proclaimed as :

g: (int, int, (int, int) => int) => int

Latter is far more instinctive IMO.


Apart : The shows language called OOC solutions this syntax (and also numerous other syntactical concerns in C and also C+npls ). Look into its homepage here.

0
2019-12-03 03:18:31
Source

Since individuals have actually currently whined concerning = vs. ==, allow me mention a much even worse choice. PL/I had both := and also =, yet when something was "obviously" an assignment, it would certainly allow you escape making use of = to do it. Making use of := allow you compel something to be an assignment in a scenario where the compiler would certainly or else analyze it as a contrast.

However, the compiler really did not constantly picked points fairly the means you could anticipate. Take into consideration simply one noticeable instance :

A = B = 0;

Now, to most individuals accustomed to the majority of "ordinary" languages, the definition of this is rather noticeable - - assign 0 to both An and also B. PL/I is simply a bit ...various though. For factors recognized just to the (ridiculous) developers of the language, the first = is taken an assignment, yet the 2nd = is taken a contrast. Consequently, this contrasts B to 0, and afterwards appoints the outcome of that contrast to A (adhering to the C - design convention that "false" cause 0 and also "true" in 1).

So, if B was 0, after that A comes to be 1. Or else, A comes to be 0. To put it simply, as opposed to appointing the very same value to An and also B, this in fact makes certain that A can not have the very same value as B.

Bottom line : despite the fact that the C/C+npls/ PHP design originally appears like a discomfort, the choice is a lot even worse 1 .

1 Well, practically, there is an additional different : Pascal design, where = constantly suggests contrast and also assignment constantly calls for :=. After making use of that for some time, it is rather noticeable (at the very least to me) that assignment suffices extra usual than contrast that if you are mosting likely to call for added "stuff" to disambiguate both, you need to most definitely maintain jobs tidy and also straightforward and also call for the added "grunge" on contrasts, not the other way around.

0
2019-12-03 03:09:00
Source

& & & | | | in C

C+npls has actually fixed it to some expand with specific "and" "or" search phrases. Several a pests and also torn hair can have been stayed clear of in C if sensible procedures and also bitwise procedures weren't so tough to set apart.

0
2019-12-03 03:02:09
Source

Javascript/Java etc, amounts to contrast, eg if (a = = 1)

How several times do I write if (a = 1)?

As a human I read that flawlessly. Yet the darn interpreter/compiler claims, "hi there I'll assign 1 to a, after that examine if an amounts to 1, and also would certainly you think it yes it is!

Drives me up the wall surface.

if (a = = 1) is much much less legible, and also the interpreter/compiler needs to recognize what I suggest anyhow ; several various other minimal languages (VB) have actually been functioning it out efficiently for centuries.

0
2019-05-17 22:23:51
Source

I detest the reality that curly dental braces can be optional after an if/while/for declaration.

Specifically when I see code like,

if (...)
    for(...)
        ... One line of stuff ...

Please simply place the dental braces in and also be performed with it.

0
2019-05-17 06:34:28
Source

The for ... in construct in JavaScript and also the foreach construct in PHP when knotting over selections. Both of them make it less complicated to write pests than proper code.

0
2019-05-17 04:25:05
Source

VBScript Doesn't Have Logical Operators

Unlike virtually every reasonable language, VBScript makes use of bitwise drivers as opposed to sensible drivers. What does this mean in technique? Well, as Eric Lippert points out:

If Blah = True Then Print "True!" Else Print "False!"

and also

If Blah Then Print "True!" Else Print "False!"

are NOT the very same in VBScript!

Also even worse, however, this suggests that there is no brief - circuit analysis in VBScript to make sure that the adhering to declaration will certainly crash your program if Blah is Nothing

If (Not Blah Is Nothing) And (Blah.Frob = 123) Then
...

That is right, VBScript will certainly review both components of the AND contrast, also if the first one is incorrect! Simply allow that sink in ...

0
2019-05-17 04:15:28
Source

Array affirmations in C and also C+npls.

Commonly, a variable declaration is of the layout type variable_name. You can conveniently read those affirmations in a left - to - appropriate fashion. Yet int foo[size] considers first like it is proclaiming foo as an int, and afterwards you read better and also see that foo is of type "array of integers." int[size] foo reviews better.

And also I additionally despise it when designers proclaim reminders similar to this for a comparable factor : int *foo. For one reason or another I have not identified, that is the regular means it is created.

0
2019-05-16 20:34:52
Source

REGEX/ preg_match() in PHP

Firstly, its entirely various syntax than PHP makes use of. While the preg_match() function mimics regex fairly outstandingly, I need to entirely change my setting of believing to collaborate with it.

Second of all, its simply simple obscurification half the moment. I generally need to fairly essentially obtain a scrape pad and also identify WTF its doing half the moment.

Besides, I program in PHP, not Perl. If I suched as Perl, I would certainly program in Perl. (no, sir I do not like it.)

To make issues worse, with the new PCRE delimiter layout, you can almost make use of any kind of personality, that includes needing to run away that very same nested personality, making the pattern a lot more rare.

Certain, its wonderful if you intend to be puzzling. or perhaps reliable ... yet divine heck the quantity of time it throws away to generally execute straightforward jobs.

0
2019-05-16 20:29:19
Source

Commenting in CSS

// does not comment out lines of code like it carries out in several various other languages, like PHP and also Javascript. Although /* this is commented out */ jobs, I favor to make use of //.

Its a hassle, due to the fact that half the moment I neglect I am editing and enhancing CSS and afterwards need to go back and also deal with the mistake.

0
2019-05-13 13:03:45
Source

Redundant parameterization in Java :

HashMap<String,HashMap<String,String>> foo = new HashMap<String, HashMap<String, String>>();

What various other type parameterization does the compiler assume foo could have?

0
2019-05-10 06:22:12
Source

The switch declaration (in C, C+npls, C#, Java, etc)

Here is an instance of why I locate it very bothersome:

switch (someVariable)
{
    case 1:
        int i = something();
        doSomething(i);
        break;

    case 2:
        int i = somethingElse();
        doSomethingElse(i);
        break;
}

This does not compile due to the fact that the variable i is redeclared in the very same extent. This feels like a small information, yet it attacks me actually usually. I can add curly brackets to minimize it, yet it would certainly have behaved if the curly brackets had actually been required component of the syntax, and also there was no repetitive added degree of impression. I additionally actually despise needing to write the added break. This would certainly be much better:

switch (someVariable)
case 1
{
    int i = something();
    doSomething(i);
}
case 2
{
    int i = somethingElse();
    doSomethingElse(i);
}
default
{
    ...
}

This makes it look extra like an if/ else chain, which is a good idea due to the fact that it is semantically comparable also. At the very least in C# it would certainly still not coincide point nonetheless, due to the fact that in a switch declaration the order of the instance classifies does not matter, yet in an if/ else it does.

0
2019-05-09 01:20:29
Source

Array Declarations in VB.NET

I constantly take care of to neglect that when booting up dealt with selections in VB.NET, you're defining the upper bound of the array and also not the variety of components like in C/C+npls, PHP, or Java. Besides VB6 (we will not go there ...), I can not consider an additional language that does it in this manner:

Dim myArray(20) as Integer  '# Creates an array with 21 elements,
                            '# indexed from 0 to 20
0
2019-05-09 01:19:36
Source

structPointer->member in C/C+npls. Might benefit reviewing a person else's code, yet I do not like it. 2 personalities as opposed to one ... what a waste of room!

0
2019-05-09 01:19:25
Source

Semicolon insertion in JavaScript.

I have not actually been attacked by it usually, yet it's simply such an extremely negative suggestion it makes my head spin.


Below's the regulations (from ECMA - 262 Section 7.9)

  1. When the program has a token that is not permitted by the official grammar, after that a semicolon is put if (a) there is a line break then, or (b) the unanticipated token was a closing support.
  2. When completion of a documents is gotten to, if the program can not be analyzed or else, after that a semicolon is put.
  3. When a "limited manufacturing" is run into and also has a line terminator in an area where the grammar has the note" [no LineTerminator below ] ", after that a semicolon is put.

Instance:

return 1; // returns 1

return
1; // returns undefined
0
2019-05-09 01:14:50
Source

VB6 - Separate Variable Declaration and also Assignment

Most languages allow you proclaim a variable and also assign it in one line of code ; VB6, on the various other hand, pressures you to make use of 2.

Dim i as Integer
i = 0

Dim derpderp as Collection
Set derpderp = new Collection

You can make use of a colon to place 2 commands on one line, yet it promptly transforms unpleasant in real code.

Dim i as Integer: i = 0
Dim derpderp as Collection: Set derpderp = new Collection
0
2019-05-09 01:11:44
Source

PHP - regular getting of debates

PHP has a variety of convenient features for doing virtually every procedure you can consider on an array or string. Most of these procedures call for making use of both a $needle and also a $haystack, yet various features take them in various orders. Which function calls for which debates is just one of those realities my mind rejects to soak up, despite just how usually I find them!

Take the features in_array and also strstr:

// Check whether $needle occurs in array $haystack
bool in_array (mixed $needle, array $haystack [, bool $strict])

// Check whether $needle is a substring of $haystack
string strstr (string $haystack, mixed $needle [, bool $before_needle=false])

Funnily sufficient, PHP appears to be inside regular with these purchasings because all string operates appear to make use of $haystack, $needle while array features are vice versa, yet this can take a little obtaining made use of to for a person new to PHP. There's an excellent post on ExpressionEngine speaking about this certain trait in extra information, along with a discussion on the PHP bugs list, which includes a really brief feedback from the PHP group!

helly @php.net
Use a suitable IDE after that.
0
2019-05-09 01:03:55
Source

Pointers of selections or selections of reminders in C/C+npls. I am still perplexed concerning these.

0
2019-05-09 01:01:15
Source

Verbosity in Java.

ie:

public static final int 
0
2019-05-09 00:20:43
Source

In/out debates. I'm all for in debates (good idea I am), out debates are great also, yet an argument that has to share these 2 states pisses me off.

What I target below are features that take input from a parameter after that overwrite that input with some result. It's all right to pass an object by reference to upgrade it. Yet, primarily for primitive kinds, taking an object, utilize it, after that transform it entirely, is wrong by me. You should not transform the definition of the argument via an inout.

0
2019-05-09 00:11:37
Source

EDIT : Following the conversation in the remarks I determined to upgrade this response to clarify myself much better.

I actually despise the means function reminders search in C. Usually any kind of variable declaration resembles a tuple of : type varname; Function reminder affirmations on the various other hand resemble a declaration of the function with * prior to the function name. I can approve this as a summary of a reminder type, yet in C this proclaims both the type and also the name of a variable of that type. This looks irregular to me due to the fact that type affirmations are or else distinctive from variable affirmations. struct myStruct{int X; int Y;} just specifies a type, it does not specify a variable called myStruct. Furthermore I see no factor for type affirmations and also variable affirmations to be organized right into one atomic declaration in function reminders, neither do I value the inconsistency from the type varname; framework.

A person mentioned that it's regular with some spiral regulation, which might hold true, yet the mark of an excellent syntax is that it is self informative and also its inner reasoning is noticeable. The spiral regulation is not noticeable whatsoever.

0
2019-05-08 23:59:51
Source

Whitespace Sensitivity.

Python frustrates me in this regard. I suggest, I indent effectively anyhow, yet it pests me that I need to have to. Making discussion component of the syntax irritates me.

0
2019-05-08 23:37:42
Source

Perl

  1. I desire Perl allow me write if($x < 10) do_something();. Presently, you need to write that as either do_something() if($x < 10); or as if($x < 10) { do_something(); }.
0
2019-05-08 16:41:23
Source

reinterpret_cast<unsigned long> in c+npls. This procedure serves in managing international APIs and also making certain mathematical accuracy, why should it be such a discomfort to type therefore hideous to consider?

0
2019-05-08 11:04:29
Source

Scala multi - line code in brackets

For instance :

class Foo(
         val bar: String,
         val baz: Int,
         val bing: String,
         val bong: Boolean
 ) extends Model {
   // body here
 }
.

What you in fact obtain from it is great. It creates the erector and also the getters and also setters for you. Yet it certain is hideous and also breaks all my psychological versions of just how to indent code and also primarily leaves me seeming like I'm in a type of peculiar sandwich with Java on one side and also Lisp on the various other. (Oh, wait ... that is instead the factor of Scala.)

0
2019-05-08 05:58:50
Source

Python

self parameter in instance method interpretations

0
2019-05-08 04:48:14
Source

Semicolons in VBScript - or the absence thereof

I invest throughout the day operating in languages that anticipate semicolons at the end of each line. Add one throughout of the line in VBScript and also your code does not run any longer.

0
2019-05-08 01:59:11
Source

Java-bean syntax as a result of absence of C# buildings

/**
 * Name of user
 */
private String name;

/**
 * Gets name of user
 * @return Name of user
 */
public String getName() {
    return this.name;
}

/**
 * Sets name of user. 
 * @param name
 */
public void setName(final String name) {
    this.name = name;
}

GAH!!!

Issues I have with this

  • Too much code - Have an area that's recorded, a getter method that's recorded, and also a setter method that's recorded. This exceptionally standard instance has 20 lines of code for a solitary building
  • Clutters method checklists - "Let me locate that method, hand on : getX, getY, getZ, getAnotherAnnoyingField, getWhyIHateJavaBeans, getThisIsVerbose, getGAH ... ah there it is, hashCode.
  • Numerous location's of documents bring about inadequate, obsolete, or missing out on documents - Annoying when attempting to recognize what code does
  • So frustrating a 3rd event needed to think of a plugin to do this conveniently - Spoon, Shark, to name a few.
0
2019-05-08 00:15:55
Source

The reality that Python relies upon message format.

0
2019-05-07 17:14:39
Source

\ we \ wouldnt \ solution \ our \ parser namespace syntax in PHP

The syntax is not just hideous, it brings about complication when more recent programmers need to think of namespaces in strings. (PHP inserts backslashes in double-quoted strings as retreat series. Attempting to stand for a namespace like \you\should\never\do\that in a double-quoted string as opposed to a single-quoted string will certainly bring about newlines, tabs and also calamity. )

0
2019-05-07 16:48:36
Source