Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 984515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:01:43+00:00 2026-05-16T05:01:43+00:00

I was introduced to Clojure not long ago, and while I haven’t fully assimilated

  • 0

I was introduced to Clojure not long ago, and while I haven’t fully assimilated all of it’s concepts, It has given me an alternative to Java and PHP’s OO that I really want to move towards. I consider Clojure’s systems to be my ideal. I know that I want to let it inform my PHP coding style as much as I can.

I really don’t like OO in PHP, I hate the amount of boilerplate and the hidden complexity that it often seems to lead to. At the same time, I can see benefits to encapsulation where you have multiple bits of data that carry the ability to modify themselves around. Maybe using 1st order functions is the main way to allow for that encapsulation, but beyond that how can the benefits of Object Orientation be translated into Functional Programming?

One part of the problem that I’m having now is how to deal with a collection of related functions that might otherwise be grouped in a class, in a sane way that keeps them useful to each-other.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:01:43+00:00Added an answer on May 16, 2026 at 5:01 am

    From Edward Garson’s piece in the book ’97 Things Every Programmer Should Know’ in the article titled ‘Apply Functional Programming Principles’ he boils it down to:

    Referential Transparency
    http://en.wikipedia.org/wiki/Referential_transparency_(computer_science)

    I think any OO language can be written with a functional style to some degree and I think the best way to think about it is to always be returning something. if you mutate a data structure, return a copy of the data structure with the mutation applied, don’t change the original data structure. If you need to change state of an object, be very declarative about doing so. And finally, without being too specific, write unit tests for your methods, because it will force you to write more methods that are more focused in intent and when you have returns from those methods, they are much easier to test.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Clojure has introduced me to the concept of Lisp syntax, and I'm interested, but
Ever since Microsoft has introduced the application blocks, I've been bumping into people who
Apple introduced Grand Central Dispatch (a thread pool) in Snow Leopard, but haven't gone
Rails introduced some core extensions to Ruby like 3.days.from_now which returns, as you'd expect
When I originally was introduced to Mocks I felt the primary purpose was to
I've just introduced a friend to GNU Screen and they're having a hard time
I've introduced visitors as one of core architecture ideas in one of my apps.
Delphi 2009 introduced a hierarchical system for project options configuration, where you set base
I recently introduced HTML into some RSS feeds that I publish (which up to
Having recently introduced an overload of a method the application started to fail. Finally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.