Slashdot stories can be listened to in audio form via an RSS feed, as read by our own robotic overlord.


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Re:Such potential (Score 1) 520

by vilanye (#49074315) Attached to: Nim Programming Language Gaining Traction

Enforcing whitespace in the language weakens it.

Add in the sad decision to not make everything an expression in Python and you have a weaker language with zero benefit to go along with the enforced whitespace.

Guido is almost as stupid Rasmus.

Python used to not have any scoping at all which is why you have all those redundant self self self self self....

Comment: Re:It was a terrible example of went to use a goto (Score 1) 677

by vilanye (#49074161) Attached to: Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful"

> I say "please don't use goto" and instead have a "cleanup_lock" function
> and add that before all the return statements.. It should not be a
> burden. Yes, it's asking the developer to work a little harder, but the
> end result is better code.

No, it is gross and it bloats the kernel. It inlines a bunch of junk
for N error paths, as opposed to having the exit code once at the end.
Cache footprint is key and you just killed it.

Nor is it easier to read.

As a final argument, it does not let us cleanly do the usual stack-esque
wind and unwind, i.e.

        do A
        if (error)
                goto out_a;
        do B
        if (error)
                goto out_b;
        do C
        if (error)
                goto out_c;
        goto out;
        undo C
        undo B:
        undo A
        return ret;

Now stop this.

        Robert Love

Comment: Re:why? (Score 1) 677

by vilanye (#49074135) Attached to: Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful"

"Don't prematurely optimize" is another one of those proverbs that people worship without thinking about it.


People have taken that to mean that it is okay it write poor code because the compiler will save you and if it doesn't then you can do it the right way.

Most of the time I know the optimal way to write it so I do. Waiting is pure stupidity.

If I am not sure, I come up with the best that I can, profile it and if it isn't efficient enough I tweak it.

Comment: Re:As any developer worth their salt knows (Score 1) 260

by vilanye (#48430799) Attached to: Computer Scientists Ask Supreme Court To Rule APIs Can't Be Copyrighted

Quoting a small snippet from a larger work with attribution in the USA is generally fair use. But in any case, how can the Free Software Foundation claim that code that links to GPL libraries even *dynamically* is a derived work if APIs are not copyrightable? As much as I am against excessive copyright, people can't have it both ways.

There is a huge difference between an API header and the implementation.

The implementation is copyrightable and no one is claiming otherwise.

If you don't understand the difference between:

static int acpi_ac_get_state(struct acpi_ac *ac);


static int acpi_ac_get_state(struct acpi_ac *ac)
        acpi_status status = AE_OK;
        if (!ac)
                return -EINVAL;
        status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state);
        if (ACPI_FAILURE(status)) {
                ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
                ac->state = ACPI_AC_STATUS_UNKNOWN;
                return -ENODEV;
  return 0;

You have nothing valid to say on the topic.

The former is what is under discussion. In no way should that be copyrightable.

The latter should be and is copyrightable.

One person's error is another person's data.