Sponsored Content
The Lounge What is on Your Mind? Programming languages polyglots: how many languages you know? Post 302225359 by redoubtable on Friday 15th of August 2008 08:35:50 AM
Old 08-15-2008
I see! So in very simple terms, the letter does not criticize goto by itself. It criticizes programmers that used to over use goto on their programs because that could lead to a less structured and harder to maintain program. Although I can agree with that, I often see people criticizing goto even if it's only used in a structured basis like packing all errors and returns in the end portion of a function:
Code:
int
whatever()
{
        int error;

        do_stuff();
        keep_doing_stuff();
        if (!this_is_right())
        {
                error = EINVAL;
                goto err;
        }
        bla();
        if (this_is_wrong())
        {
                error = EPERM;
                goto err;
        }
        while (...)
        {
                stuff();
                if (stuff2())
                {
                        error = EFAULT;
                        goto err;
                }
        }
        ...
err:
        do_this();
        do_that();
        do_whatever();
        return -error;
}

 

8 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Shell scripting & programming languages

If I want to do high-end 3d animation, what skell scripting languages, and programming languages shoul I learn? If you know any good resources for learning these languages they would be appreciated. (1 Reply)
Discussion started by: aloysius1001
1 Replies

2. UNIX for Advanced & Expert Users

Operating System and Programming languages

I'm trying to create an operating system. Just as a small hobby, it will not be anything big I am trying to get some practice. Does anyone reccomend a certain programming language because I dont know which one to use. Any help please? (2 Replies)
Discussion started by: jacx2
2 Replies

3. UNIX for Dummies Questions & Answers

Programming/Scripting Languages To Learn

Which languages would, in the long run, be best to learn on a UNIX environment for kernel work, every day programs, and overall UNIX programming? I've been learning C for over a year now (which I'm pretty confident with) and decided I want to look into some other languages. I'll mainly be... (1 Reply)
Discussion started by: tjinr
1 Replies

4. Shell Programming and Scripting

output in different languages

hello, i have to change a lot of shell scripts for one reason : the output in a script should be done in different languages. for example: echo "this is a test" and "this is a test" should be printed out in language for an example: german,italian and so. i saw a tool "gettext" ,... (2 Replies)
Discussion started by: bora99
2 Replies

5. Shell Programming and Scripting

bash and languages

Hi everyone, First of all, i dont know what id do without this forum its been such a great help:) so a big thankyou to all, anyway i have a simple question, if i wrote a scrpt in english would it work on another machine with a different language, or do i have to put something in the script to say... (9 Replies)
Discussion started by: dave123
9 Replies

6. UNIX for Advanced & Expert Users

How to export/link Control_m with another programming languages

Hello All. Everyday at work I have to fill a big .xls spreadsheet with process chains start and end time information. The thing is that it takes too long and a lot of boring work. :( I was wondering if I could link this with a tool in java that would export this information into a .xls... (1 Reply)
Discussion started by: pingosa
1 Replies

7. Web Development

What Web Development languages should i learn?

I am learning Web Development, so far i am learning html,xhtml, css, java script.... What I want to know is what other Web Development languages should i learn? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

8. What is on Your Mind?

How can I learn computer programming languages on my own?

I would love the idea to develop games. How can I teach myself computer programming? What programs or software must I use? I have the new iMac? (5 Replies)
Discussion started by: Anna Hussie
5 Replies
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy