What makes code maintainable




















I imagine what it would be like to read this code for the first time. Would I understand the overall flow? Have I used terms in a way that is consistent with the rest of the project? If I had to search for this thing without knowing what it is called, would I be able to find it quickly?

At Atomic Object, we often do pair programming, which is a great way to immediately get answers to these questions from someone who is not you. One of the best ways to ensure that your code is maintainable by someone else or your future self is to make it self-documenting. Comments should be reserved for the rare bits of code that are influenced by factors beyond the code itself for example, a customer requirement or a bit of historical context.

But rather, put serious thought into the naming of everything. After all,. There are only two hard things in computer science: cache invalidation and naming things. Have you ever seen an obfuscated code contest? Yes, it is possible to write code that does something useful and yet is completely unreadable itself.

Those contests are just for fun, of course, but it can be easy to slip into bad formatting habits or apathy toward it altogether. Code that is pleasing to look at also tends to be easier to scan quickly. Service for training ML models with structured data. API Management. Manage the full life cycle of APIs anywhere with visibility and control. API-first integration to connect existing data and applications.

Solution to bridge existing care systems and apps on Google Cloud. No-code development platform to build and extend applications. Develop, deploy, secure, and manage APIs with a fully managed gateway. Serverless application platform for apps and back ends. Server and virtual machine migration to Compute Engine. Compute instances for batch jobs and fault-tolerant workloads.

Reinforced virtual machines on Google Cloud. Dedicated hardware for compliance, licensing, and management. Infrastructure to run specialized workloads on Google Cloud. Usage recommendations for Google Cloud products and services. Fully managed, native VMware Cloud Foundation software stack. Registry for storing, managing, and securing Docker images. Container environment security for each stage of the life cycle. Solution for running build steps in a Docker container.

Containers with data science frameworks, libraries, and tools. Containerized apps with prebuilt deployment and unified billing. Package manager for build artifacts and dependencies. Components to create Kubernetes-native cloud-based software. IDE support to write, run, and debug Kubernetes applications. Platform for BI, data applications, and embedded analytics. Messaging service for event ingestion and delivery. Service for running Apache Spark and Apache Hadoop clusters.

Data integration for building and managing data pipelines. Workflow orchestration service built on Apache Airflow. Service to prepare data for analysis and machine learning. Intelligent data fabric for unifying data management across silos. Metadata service for discovering, understanding, and managing data.

Service for securely and efficiently exchanging data analytics assets. Cloud-native wide-column database for large scale, low-latency workloads. Cloud-native document database for building rich mobile, web, and IoT apps. In-memory database for managed Redis and Memcached. Cloud-native relational database with unlimited scale and Serverless, minimal downtime migrations to Cloud SQL.

Infrastructure to run specialized Oracle workloads on Google Cloud. NoSQL database for storing and syncing data in real time. Serverless change data capture and replication service. Universal package manager for build artifacts and dependencies. Continuous integration and continuous delivery platform. Service for creating and managing Google Cloud resources. Command line tools and libraries for Google Cloud.

Cron job scheduler for task automation and management. Private Git repository to store, manage, and track code. Task management service for asynchronous task execution. Fully managed continuous delivery to Google Kubernetes Engine. Full cloud control from Windows PowerShell. Healthcare and Life Sciences. Solution for bridging existing care systems and apps on Google Cloud. Tools for managing, processing, and transforming biomedical data.

Real-time insights from unstructured medical text. Integration that provides a serverless development platform on GKE. Tool to move workloads and existing applications to GKE. Service for executing builds on Google Cloud infrastructure. Traffic control pane and management for open service mesh. API management, development, and security platform. Fully managed solutions for the edge and data centers.

Internet of Things. IoT device management, integration, and connection service. Automate policy and security for your deployments. Dashboard to view and export Google Cloud carbon emissions reports. Programmatic interfaces for Google Cloud services. Web-based interface for managing and monitoring cloud apps. App to manage Google Cloud services from your mobile device. Interactive shell environment with a built-in command line. Kubernetes add-on for managing Google Cloud resources. Tools for monitoring, controlling, and optimizing your costs.

Tools for easily managing performance, security, and cost. Service catalog for admins managing internal enterprise solutions.

Open source tool to provision Google Cloud resources with declarative configuration files. Media and Gaming. Game server management service running on Google Kubernetes Engine. Open source render manager for visual effects and animation. Convert video files and package them for optimized delivery.

App migration to the cloud for low-cost refresh cycles. Data import service for scheduling and moving data into BigQuery. Reference templates for Deployment Manager and Terraform. Components for migrating VMs and physical servers to Compute Engine. Storage server for moving large volumes of data to Google Cloud. Data transfers from online and on-premises sources to Cloud Storage.

Migrate and run your VMware workloads natively on Google Cloud. Security policies and defense against web and DDoS attacks. Content delivery network for serving web and video content. Domain name system for reliable and low-latency name lookups. Service for distributing traffic across applications and regions. NAT service for giving private instances internet access. Connectivity options for VPN, peering, and enterprise needs.

Connectivity management to help simplify and scale networks. Network monitoring, verification, and optimization platform. Cloud network options based on performance, availability, and cost. VPC flow logs for network monitoring, forensics, and security. Google Cloud audit, platform, and application logs management. Infrastructure and application health with rich metrics.

All dependencies should be explicitly declared and used. There should be no dependence on implicit or system level packages.

A manifest file should be used to track all dependencies and the exact versions , along with a process in place to ensure these dependencies are downloaded and used. This allows developers and the CI process to remain in sync, and quickens the ability of a new developer to begin contributing.

Dependencies that are no longer used should be removed from the manifest file. Unused and orphaned code should be removed. Removing unused functionality makes clear what code needs to be maintained and tested, increasing its readability. It is insufficient to simply comment out the unused code for possible use in the future. With modern version control systems, old code can be easily retrieved if it is determined that it is once more needed.

If developing an externally used API or library, a deprecation strategy should be employed. Related to this topic is to avoid TODO or similar comments.

Missing features or changes should be tracked externally, and not littered throughout the code. It is far better to write self-documenting code and to not rely on inline comments to explain logic.

However, this does not mean that there should be zero documentation. This is especially true when working with multiple teams or when developing a consumable library or extensible application.

The public API should be accurately documented, describing the inputs, outputs, and functionality. This enables API consumers to understand and use the available functionality.

Configuration should be clear, consistent, and separate from the source code. It should be organized and defined in a central location. All available options should be described with how they are used and any applicable default values. It is preferable to use environment variables. In this way, the source code can remain unchanged, and how those environment variables are defined can change based on use case or environment. Anything that can vary between environments or deployments should not be located within the code itself.

Organizing and sufficiently describing the available configuration options makes it much easier to deploy to new environments and for new team members to begin contributing. Your email address will not be published. Programmers should choose a variable name that reflects the purpose of the variable and the data it is intended to hold:. H - poor choice. What does it mean? The value to be inputted will be a number.

Code within selections or iterations should be indented.



0コメント

  • 1000 / 1000