Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×

Comment Re:I like functions... (Score 1) 345

It's quite a bit more than that, at least if you're talking about pure functional programming. You also have to get rid of most all of your old notions of flow control. Imperative programming is about defining sequences of steps, some of which are conditional. Functional programming is all done with nested transformations; there are no sequential steps, there are no branches, there is no iteration.

If you think about it, those are inevitable consequences of the constraints I mentioned. However, it's good that you highlighted them.

If this sounds freakish and impossible to someone raised on imperative programming paradigms... yes, it is. Functional programming requires thinking in an entirely new way.

Yep, both recursion and constructs like map/filter are incredibly useful (even in procedural/OO languages) once you get the hang of them.

Comment Writing, technical and otherwise (Score 1) 380

Wow, you wrote that entire rant over a single letter. That's pathetic.

Language is an art, like painting. Technical language is an art where miscommunication leads to real world problems, and where evidence of lack of expertise leads to well justified lack of confidence up front.

With language, as with painting, you can paint like a master, or you can finger-paint like an addled child.

Which do you think will carry you further in life and in your career? Which do you think will result in more actual pathos?

Comment structs and fundamental OO (Score 3, Interesting) 345

Just having higher-order functions doesn't make a language a functional language any more than having structs makes C an object-oriented language.

Structs do, however, make the critical aspects of an object oriented approach practical in c. They can carry data, function pointers, etc., and they can be passed around.

I've been writing my c code like that since the 1980's. There are significant benefits.

Comment Hard stuff is, in fact, hard (Score 5, Interesting) 345

I would add to this that reducing the complexity by turning everything into separate functions tends to also increase what I call "opacity by non-locality."

Not only are some things hard, some things benefit from having the logic right there in front of your face; not in a header, not in some function elsewhere, not in a library.

Benefits in both comprehension, and so ease of construction, but also in execution time and smaller executables depending on just how smart the language is in constructing its own executables.

Comment function dictionaries in Python (Score 1) 345

So, for example, by storing functions as values in a dict you can build complex structures of execution without using any conditional codes .

This is the core mechanism of my text markup language. Once the specific built-in tokens are parsed out, they are immediately accessed via the language's function dictionary. This approach is quick, ultimately low-complexity, trivially extensible, and highly maintainable.

Comment Fluid type manipulation with unions (Score 2) 345

Would you consider unions in c a "means to circumvent the type system" as compared to a language with strong up-front typing?

Unions are certainly a very powerful, useful, and concise tool for manipulating data across type boundaries. If you don't have them, in trying to accomplish similar tasks as those unions make easy, in many languages you're going to be a lot more verbose, and likely a lot less efficient, than if you do.

I am assuming competence. Strong typing is a safety net. The need for such a thing varies with one's skill set. The fewer the participants, the more likely it is that the skill sets can be arranged to be similar. With larger teams, the need for safety nets almost always increases.

Comment Poorly understood? (Score 3, Interesting) 345

If you're using poor coders to maintain very old code then perhaps the choice of programming style is not your biggest problem.

You may have misunderstood the previous poster's use of "poor coder."

I read it as "unfortunate coder", not "incompetent coder."

I could certainly be wrong. Perhaps clarification will be forthcoming.

Comment Re:I like functions... (Score 3, Insightful) 345

Yes, it means your functions aren't allowed to have side effects (i.e., all parameters are passed by value and the only result is the value returned to the caller).

Personally, I like it because it's a good way to manage complexity -- kind of like the encapsulation of object-oriented programming, except applied to the verbs instead of the nouns.

Slashdot Top Deals

"We shall reach greater and greater platitudes of achievement." -- Richard J. Daley

Working...