Rashakil Fol 978 Super Senior Demiposter Team Colleague

Has Lisp ever really been anything more than an academic language with very little real-life applicability?

Yes.

Common Lisp and a subset of its ancestors are not academic languages at all. A few people even made money with it.

Scheme is (in particular) the academic lisp.

There are some corner markets (like early AI) that favored Lisp or Lisp-like languages, but they are pretty small and don't really have a mountain of legacy Lisp code to maintain.

I think the real reason "early AI" and such used Lisp was because it was a nice-to-use language the way Python/Perl/Ruby later were in comparison to C/C++03/Java. They just didn't have needs such as distributing software on floppies to Windows 3.1 users and running ultra-fast, and when other people ended up not needing the same thing (e.g. server-side environments), the same thing happened. Of course, I wasn't there.

Also, Haskell isn't obsolete in any sense, but C is obsolete for some set of things it used to be a premier choice for.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If only you had the ability to come up with ideas!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Scorpiono I tihnk you missed the entire point of the article. This article is trying to talk about cracking password hashes after the password database has already been compromised.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Instructions for proper password digestion:

http://codahale.com/how-to-safely-store-a-password/

happygeek commented: good piece, thanks for the share +11
Rashakil Fol 978 Super Senior Demiposter Team Colleague

In such a small example where it is not hard to see the context, and within a "detail" class that shouldn't be looked at by users, I don't think it's that bad. But, yeah, it's a bad example to give.

It's bad because it's l which looks like 1, in particular, not just because it's a single letter.

The alternatives are worse.

I don't quite understand you because you then said that naming it lock would be better. It doesn't matter, the function really should not exist at all.

The reason for having locked_ptr and detail::locked_ptr_impl is because it uses the "scope-guard" technique. Look at it again, and you will see that those two need to be separate, because locked_ptr is not just a typedef for detail::locked_ptr_impl, it is a typedef for const detail::locked_ptr_impl& and that makes all the difference in the world.

Nobody expects a typedef to be a reference type, so you should never ever do that. For example, I didn't know that it was a reference type. As you can see, the code is confusing to the reader and too subtle. Abandoning the practice of having this method on lockable which obtains the locked pointer, and instead having a constructor on locked_ptr which takes a lockable<T>& argument, is more clear and more ordinary. That's why, for example, std::unique_lock<T> works that way, and why std::mutex::lock is a dumb method that returns void.

Also, even if we wanted to keep the interface the …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

A master's in computer science is basically worthless when it comes to causing increased future life earnings. Actually, it has negative value, because of the lost year or two. It might be correlated with higher earnings (or might not) but don't be fooled into thinking that's a causative effect.

but it will give me more experience

No? A master's does not give you more experience. Having a job gives you more experience.

If you want to improve your job prospects, you need to get better at programming, and have better evidence that you're good at programming. A master's is not that, not at all.

There are good reasons to get a master's. One is indeed, simply to avoid having to have a job for another year or two! Maybe you like being in college better, or are afraid of being an adult with daily responsibilities. That was my reason for spending an extra semester in college to get a dual major.

Another reason might be if you want to learn specific things in the computer science field, if you've looked at the courses available in the master's program and find yourself saying, "Yes, I want to learn about that!"

Reverend Jim commented: Excellent points +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

What you actually want to do is return a pointer to a function.

(Or, perhaps you really want to return a std::function<void(YType, ZType)>, which is different, but the first thing to learn is how function pointers work.)

Search for "function pointers" and learn how they work, they'll do what you want.

They'll do it without involving strings, by the way. There's no table of function names available at run-time, so that couldn't work. A function pointer is just the memory address of the first instruction in the function.

Edit: Interpreting your question less literally, it's also possible that you actually want runtime polymorphism, involving virtual functions and class inheritance. You should make sure you learn how these work, they could also be used to accomplish the goal, albeit less directly and more generally. And it's a very important part of C++.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

NoSQL bandwagon marketing hype more than practical reality then?

No. Well, I'm not measuring hype, and I'm not sure if there even is hype. They're just tools. But they're useful. For example, a lot of Yahoo is powered by an internal proprietary NoSQL product.

Many NoSQL products out nowadays are quite poorly written pieces of software. Cassandra was and possibly still is one of them, according to some HFT developer I talked to about a year ago, who claimed and acted like it was common knowledge that it and others would disappear data. I've also heard that it's gotten better recently. MongoDB, for example, has a global write lock on each database, making it quite mediocre for writes. Almost all have bad performance when it comes to how they write to disk, and some others are shoddily glued together monstrosities of Java and MySQL. Also they're usually bad at managing the notions of datacenters and machines between datacenters.

Another reason NoSQL isn't that useful is because computer RAM capacities keep getting larger, we now have SSDs too, which means single-machine SQL databases or primitive multi-machine failover mechanisms can keep getting larger and larger. And single-machine network capacity keeps getting larger. And of course the upgrade path for an SQL database is "sharding" and more often "buying a newer machine".

But if you have craploads of data, especially a crapload of large blobs like images and such, terabytes or petabytes of data, you need some integrated system for managing …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The answer is that yes, exploiting security holes requires programming. And finding them requires knowing how to code, too.

(Or we could get butthurt and chatter on about how one person could write the code and another might deploy it, and gosh, some people are morally wrong, how dare they be so? But that's boring and we might as well find something more entertaining like watching the paint dry, or arguing about what the definitions of words should be.)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Actually to be honest I might be thinking of the prior generation of XPS's. So don't necessarily dislike XPS's altogether -- however the 1366x768 screen is too weak.

As for your parts, I assume they'd work (specwise they work), but I wouldn't be able to tell you whether they'd be incompatible.

Your T430 config is fine except I don't see why you configured two hard drives.

Labdabeta commented: Thank you for all your help! +4
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Generally speaking, having different linking structures overlaid on the same information is a very normal thing. A common example is when you want a one-to-one bidirectional dictionary, where you can lookup values by key or keys by value.

The appropriate solution is situational. If you have, for example, things concurrently iterating through a tree, your data structure would have certain limitations than they would otherwise lack.

There are many ways to link stuff together. To get the language straight, let's say you have values of type V, with x.key() being the key (of type K) by which the value x (which is of type V) gets compared.

Naturally one way to implement your tree and graph is to have a balanced BST consisting of BST nodes of type BSTNode each containing a value of type V, and an adjacency list which you might say is a List<BSTNode *>. (I'm just repeating this so that if this is inconsistent with what you've said, it's now obvious.) The BST is ordered by the comparison x.key() < y.key().

So obviously, to improve locality of lookup, you put things in a B-tree. (Might I ask: How many keys are in your B-tree nodes? If your b-tree nodes are wider than an L3 cache line, are there really locality advantages? (In prefetching, perhaps?) If you're hitting swap, buy more RAM. If it's 1 TB, buy some SSD's.)

So now you have a b-tree, or generally some kind of lookup structure that has V values packed …

mike_2000_17 commented: Great answer! Thanks! +13
Rashakil Fol 978 Super Senior Demiposter Team Colleague

When I go to reply to a post, the textbox is absurdly tiny, and since it's no longer a browser textarea, it can't be resized using browser controls. It's basically unusable.

Also I'm not contributing an article when making this post. I am creating a new thread.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It's probably too late for the OP, but for any google searchers out there, definitely don't get a game design degree from DeVry, or anything from DeVry. There's a whole community college system and state college system out there that's much cheaper and much better for you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

(That depends on your competition.)

Your degree and GPA don't matter. You have to not suck at programming.

The only purpose your degree or GPA matters in this game is for the purpose of getting a company that might like to hire you to give you a phone screen. (It also functions as a signaling mechanism that may affect how much money they offer you for your starting salary.) (Also there is the learning that happens, which makes you a better programmer.)

What really matters is evidence that you don't suck at programming. For example, projects (in your free time) that you have written for fun (or allegedly for fun) will put you ahead. That'll mark you as a non-retarded actual programmer, not just somebody who takes tests and copies off of his groupmates on projects. This means there's less of a chance that you suck at programming, before you get interviewed (because there's actual code you've written that we can see) and after you get interviewed (because there's evidence that you can actually do real things and not just contrived interview problems).

Basically, as your GPA crosses a certain threshold, you go from being high-probability of being retarded to low-probability of being retarded. This range probably goes from 3.2-3.6 and it depends on the school, and the reason there's a range is because factors whether the student was working while in school and how much they cared can skew the outcome. Even the most lazy of smart people can't …

happygeek commented: well said sir! +0
hussain_786 commented: YOu are correct +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

really? are you saying that based on experience or maybe observations

I know that experience beats certifications but would including certifications actually make your resume worse?

Since I'm still a student I'm a bit curious about this :)

Observations and experience. Of the eight or ten people I've been involved in interviewing, that the development teams I've been on have decided to hire, none have had certifications. None of those who were even close had certifications. (Except, of course, for the certification known as a college degree.)

All the people who had certifications listed did quite atrociously on the interview. Others have reported similar experiences.

If somebody is a fresh 'n eager college student and thought it would be good to have a certification, that wouldn't count against them, they're just stupid. Somebody experienced who thinks it's good to have certifications on their resume? That seems to be a sure sign they come from this parallel hiring universe filled with bad developers.

It's not like we go "oh, this guy has a certification, we're not going to interview him." If we're looking closely at a resume we'll just try to ignore it. It's more like, when you're doing a quick screen of resumes, you look for signs that they're an interesting candidate, and certifications aren't one of them.

Other examples of people with the same opinion:

See http://stevehanov.ca/blog/resume_comic.png

See also Tip #6 at http://steve-yegge.blogspot.com/2007/09/ten-tips-for-slightly-less-awful-resume.html


So.

The …

zeroliken commented: well said +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Java compiles only .java source files

This is completely wrong.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

interesting.

end function

end class PerfectTest

end interesting.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Java, C++, C#, any of those would be appropriate. With Python you have to deal with the fact that any code you write yourself will be very slow.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The only reason I could see for using Java over C# is that Microsoft owns C#.

Oracle owns Java.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

> It works if I changie the functor operator() to be const std::shared_ptr<Test>, but can't you always pass a mutable object to a function expecting a const object?

Uh, yeah. And your error was that you were trying to pass a const object to a function expecting a non-const reference.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The people in this thread are apparently completely wrong, ignorant hicks.

Can I use my own code that I slapped a GPL on and provided to sourceforge in my own commercial application?

Yes.

In that way, does the GPL somehow relinquish my own rights to my IP?

No. It only gives other people rights to your IP.

Yes. You could use the code to a certain extent and with sufficient changes not be legally bound by the GPL, but by placing the code under the GPL you've given up your right to make a verbatim copy under closed source.

This is completely wrong.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

> Moreover, I somewhat find the way in which the depth (height) relates to the number of nodes at each level confusing to me. Perhaps because I think of how the Heap is represented both as an array and as a tree. But I know that with every deeper i, the Heap splits children such that its got 2^i nodes at each i.

Okay. It seems to me that you get it. At the end of this post I will show an exact calculation of the heap's height.

> The while loop runs in O(log n) time because the worst case depth an element could have is the whole height of the tree.

Also there's implicit in your argument the fact that the body of the while loop takes O(1) time. It's perfectly reasonable that you omitted this obvious fact in writing down your explanation. This and the rest of your argument are correct.


Now here's how I would calculate the exact height of the complete binary tree. Let's first note that the first k levels of the tree can hold 1, 2, 4, 8, ..., 2^(k-1) nodes, respectively. Then the first k levels of the tree can hold a total of 1 + 2 + 4 + 8 + ... + 2^(k-1) nodes. That sum equals 2^k - 1. So, if we have a complete tree with n nodes, where 2^k <= n < 2^(k+1), the first k levels of the tree cannot …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do something involving computers.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Well, Im a college junior. IF I get a certification, say OCJP, now will it be useful when I apply for a job for the first time?

Oracle Certified Java Programmer? Useless. If anything it would count against you. What's much more useful is writing some fun code and putting it up on the web, on your personal website or on a Github account (or Bitbucket, whatever), and mention these things in a section of your resume. I think putting it on a personal website is better, since a lot of candidates have "github accounts" that just contain projects they've forked with very few personal contributions.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

They're all good. Since you're familiar with C# you might want to make your web app in C# using the MS MVC framework. Since you're familiar with Java, using Scala would be an excellent choice. I'd say these are your top choices.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You need to make a helper function, analogous to identifierOrKeyword, that scans past the first newline in the string. The span or break functions might come in handy.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Are you compiling with optimizations on?

Maybe you shouldn't evaluate sqrt(j) every time through the for loop. That sounds like something an optimizer might catch, but even then you're converting i from int to double every round of the loop.

You could use a better prime testing algorithm. Miller-Rabin would do fine. See http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Currently I am studying multi-thread, and I feel pretty confusion about the concept
of blocking, non-blocking, synchronous and asynchronous.

Exactly, there are so many explanations, and each of them have something differents,
someone says synchronous could be non-blocking too, someone says synchronous must be blocking.Someone says asynchronous must be non-blocking, someone says it could be blocking too.

Someone says synchronous is same as blocking, someone says it is different.

I am extremely confuse about those concepts now, don't know how to discern the differents between them.

Could anybody help me clear up my mind?Thanks a lot

Okay, here's what they mean.

"Blocking" and "non-blocking" describe individual operations, or individual function calls (or system calls). A blocking operation is basically one that can take a long time. In particular, if you made a function that read data, and waited for data to arrive before returning, it would be a blocking operation, because it could take arbitrarily long before the data arrived, and the CPU would be idle (or another thread would be scheduled to run). A non-blocking operation, on the other hand, would be one designed to return immediately, with some return value indicating that it does not have data at this time.

If you want to manage multiple forms of I/O at the same time, blocking system calls are fine as long as you use multiple threads. A blocking system call will only block the thread it's on, and that thread has nothing better to do, …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yeah, there's a way. Learn C++ and then use Webkit.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

PHP is obviously better because the security holes and developer incompetence make life more interesting.

jbennet commented: :) +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hi,

if Rashakil's explination is beyond you, you can use a typecast to treat your enum as say an integer.

This won't work. Your code won't compile, and even if it could compile, it would not work properly at runtime. (That's why it doesn't compile. Casting between references to different integral types, which is probably what you actually wanted, also wouldn't necessarily work properly at runtime, and I don't think why you'd think it would, unless you were severely confused. Making stuff up is a deprecated form of autodidacticism. In the future, you should try something that involves facts.)

Kanoisa commented: Thanks for the correction +5
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is it possible for the 'cin' to work directly with 'mycolor' here, or would you need to create an int as the only way to do that? It seems like that's not the only way, otherwise why does line 5 work in the above example? It's taking a value that's not an int there.

The way the expression cin >> foo works is that it calls a function with signature istream& operator>>(istream&, type_of_foo&) where type_of_foo is the type of the variable foo.

The expression cin >> foo is another way to write the expression operator>>(cin, foo) , which is a function call. It just calls the function, which does nothing magical, it reads a few characters off of the input stream and does some math on them to convert them to whatever value of type type_of_foo they were representing, and then writes that value to the variable.

It takes the value cin (which is just a global variable containing a value somewhere) as its first argument.

There are definitions of this function for a whole bunch of types. There's definitions of istream& operator>>(istream&, double&) , istream& operator>>(istream&, string&) , and so on. Different functions can have the same name (which in this case is "operator>>") as long as they have different argument types.

There is no definition of the function istream& operator>>(istream&, color_t) anywhere. C++ does not automatically define such functions just because you've created an enumeration type. You could write such a definition yourself though.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

1. I'm not telling you my name. My job is "Systems Engineer" but "Software Engineer" or "Software Developer" or "Computer Programmer" would also fit.

2. Every day.

3. Not very important, because usually it's code comments and IRC messages, which is far less important than the actual code. Discussions are a more important form of communication at my company, but that's partly because it's small. As you grow you need more in writing.

4. Not really.

5. See #3.

6. This question makes no sense.

7. There are none. The only thing that matters is that the writing says what is needed to be said.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No.

By the way, wtf is up with the advertisement in this thread?

"Trying to Encrypt Your DB with MD5? ******* already does it. Try now!"

WTF.

Edit: But you can surely find one.

Since you're talking about a hash that outputs 32 characters (in hexadecimal, which presumably is what you're talking about), each character has a 5/8 chance of being a decimal digit and a 3/8 chance of being a letter.

That means there's a (5/8)^32 chance of them all being decimal digits.

Which means it will take on average 1/(5/8)^32 guesses to get such a hash, which is easily small enough for a computer to brute force.

Finding a hash with just letters is about 8 million times harder than that.

JeffGrigg commented: Good explanation that hex contains both decimal digits and letters (A-F). +5
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Python, Ruby.

Now, these aren't "uber high-level" (I would put Haskell, Scala in that category, and they have a large learning curve), they're just normal useful languages.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yes, zdep had posted badly formatted code to solve aomas98's problem. What grade do you think zdep should get for his effort? What about aomas98? Who should pass the class?

ztdep deserves the detah penalty, aomas98 deserves life in prison, with parole. What do I win?

iamthwee commented: You win th3 shobadobs b3st piano play3r award on Youtube. +15
Rashakil Fol 978 Super Senior Demiposter Team Colleague

For any N methodologies of software development, we can construct a methodology that is as good as the best of the N. Hire N teams to develop the product in parallel, each using a different methodology. When one of them finishes, stop. Your costs will differ from the best methodology's costs by a constant factor, N, which as computer scientists we know is not important.

kvprajapati commented: well said. +15
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Study what you're interested in. If you're good at programming, i.e. actually capable of serious programming, you'll be in demand no matter what. And if you're not, well, I wouldn't care if my advice was bad for you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

There is really no such notion of absolute utility of a position, there is only marginal utility. At some points on the (# developers, # designers) plane, adding a designer would give more benefit, while at others adding a developer would do so. For example, we might argue that at (0,0) it makes more sense to add a developer, since there'd be no hope of a project working with just a designer. However at some point like (10, 0) you really won't be helped by another developer but a designer would help a lot. Similarly, at (0, 1) it would certainly be better to add a developer instead of another designer, assuming making useful things brings value to the firm.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

1.) Describe your current job / job title.

Cyberpunk Analyst. Its initials are C.A. and it includes "Anal" as a substring.

2.) What do you like most about your job?

Daydreaming about the coming dystopian police state.

3.) What do you dislike most about your job?

LCD monitors. It really takes CRT's, filmed non-synchronously, to get that proper vibe. Also, cell phones. All the pay phones are disappearing and that ruins it.

4.) Overall, do you enjoy your job?

Yes, except when I have to make extra dough working as a bike messenger.

5.) What kind of education do you have? From what university?

The undergraduate kind.

6.) Any tips for people looking to enter your profession?

Don't buy a cell phone. They can track your location that way.

7.) (If you don't mind sharing) How much do you make per year?

One thousand.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Sadun89, don't listen to the haters.

1.What is Project Xen?

Xen a code project to make better code for make the executable.

2.What for use it?

Programs use it to put the program in your program so that your Xen program programs programs.

3.Is the new trend of multi OSs?

No.

4.Is it the part of Virtualization...?

No.

5.Give me some explanation about it...

If you put a Xen in your Xen it takes your program and program programs the program into program for making programs program their programs just like x86 microarchitecture.

Sadun89 commented: good explanation +3
Rashakil Fol 978 Super Senior Demiposter Team Colleague

The real purpose of classes is to allow for polymorphism using virtual methods. Classes in C++ also provide the mechanism for hiding implementation details.

If polymorphism is not in play, it doesn't matter whether you say player.SitDown(table) or table.OfferSeat(player) or Sit(player, table) . Or something analogous that involves Chairs.

You'll want to make it as difficult as possible to misuse the objects involved and minimize the public interface of each class. This follows the goal of making the code as easy to use as possible. You should consider which decision makes your code easier to write and modify.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You ask them.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The problem with recognizing counter-clockwise or clockwise motion of the mouse pointer is that it takes time to recognize, which means that the UI will lag severely behind the user input. You'll find this to be unacceptable.

To be more specific, you'll need to look at the mouse pointer at a certain time, and then look at the mouse pointer at a later time, and then look at the mouse pointer at a time after that, and see that the direction in which the pointer is moving has changed a not-too-big amount to the left or right. The time between the first and last samples needs to be large enough to represent a real user action, and not just some mouse jiggle. But only _after_ the action is complete will you be able to apply the results of what you just saw.

One way to more realistically simulate clockwise or counter-clockwise turning is to see where the user first presses the mouse button. If he mousedowns to the right of the center of the knob, and drags up, he means to turn the knob counter-clockwise. If he mousedowns to the left of the center of the knob and drags up, he means to turn the knob clockwise. Take the vector from the center of the knob to the mousedown point, rotate it by 90 degrees, normalize it, and call it X. The displacement of the pointer in the direction X indicates how much the knob should be turned …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

C or C++ for things that need to be pretty fast,
Python with the NumPy library for things that you would normally use Matlab for,
Fortran for things that really need to run on a supercomputer and run fast, or if you are using libraries written in Fortran,
Haskell or O'Caml for non-numerical computing math problems that are interesting and difficult.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And one more thing: @ Rashakil Fol
"People make up bureaucratic nonsense like this because the real problems in programming are too deep for them."
Let's hope you're talking about yourself and only yourself. You don't know me, never talk sh(*)t about people you don't know. One advise: change it, or will not find any job.

No, I'm not going to sit by silently as people be wrong on the internet. And gosh, I'm not going to get a job? I'm sooooo scared. I have no problem finding a job, in fact, and I'm sure I'll find one soon if I haven't already.

If you don't care about your coding style, do you really think the weird mind of a programmer will be understood by someone else? Or do you never make mistakes? (which would mean you made nothing at all, everyone makes mistakes). If a programmer with an opinion like that comes at our door for a job, he or she can return home without any talk.

I have a coding style, or several coding styles, depending on the project I'm working on, and (well of course implicitly everybody has a coding style, the question is whether they're aware of it) and the things mentioned in your post here are entirely superficial! You've answered questions about superficial things like naming schemes, and come up with arbitrary answers like using camel-case.

Believe it or not, software errors are generally not caused by how you capitalize and …

ddanbe commented: Nice answer! +9
Rashakil Fol 978 Super Senior Demiposter Team Colleague

People make up bureaucratic nonsense like this because the real problems in programming are too deep for them.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hello mike_2000_17. Would you mind explaining why that's a dirty hack? That's not dirty at all. It's a proper example of the power of RAII, exception-safe and an excellent tool in general. Global variables (and "dynamic variables," which this construct helps implement) have their place in software and it's better to learn how to deal with them properly than to cover your eyes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

More explicitly, an algorithm is a comprehensive, language-independent description of a procedure for solving a problem, in a finite time.
I think that about covers it.

That's one definition. I would argue for these differences:

1. An algorithm does not have to take finite time. For example, it could be something describing an infinite process like "add 1 to each number that comes out of this pipe and put it into that pipe." Or it could be something like, "walk down this infinite tape and flip every bit." Or it could be 10 PRINT "u suck" 20 GOTO 10 , or it could just be a broken, incorrect algorithm.

2. An algorithm does not have to be for solving a problem. For example, you can randomly generate computer programs that describe algorithms, and they'll not be "for solving a problem." They'll just "do stuff." What you say is correct in a certain context, e.g. where problem means some language you wish to recognize, where you're writing an algorithm that can either accept or reject inputs or fail to terminate. This is not really a difference then, but I want to make it clear what it is you are probably saying.

So far, I think difference #1 is non-controversial, and difference #2 is really a pedantic disagreement on terminology. There is a third difference I'd argue, though.

3. Algorithms are not language-independent. Some languages are more powerful than others, either in terms of the set of …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No, they are all just fancy words. My job title was once "Software Engineer" and now it's "Systems Engineer" and there's no difference.

Ezzaral commented: Agreed. +14