Showing posts with label Visual Studio Code. Show all posts
Showing posts with label Visual Studio Code. Show all posts

Saturday, November 30, 2024

What are Google style docstrings?

 

If you are working with Python, sooner or later you will encounter the Google Style docstrings.

What are Google style docstrings?

Google docstrings are a special, custom format for documenting Python code based on Google's style guide for documentation. They completely and unambiguously document everything about the python code.

I will keep it simple. Let us say you need to concatenate two strings, "Hello," and " World" that you need to concatenate to produce, "Hello, World".

The python code will be:

====

str1 = "Hello,"

str2 = " World!"

result = str1 + str2

print(result)  # Output: Hello, World!

===========

This good for a simple stuff like this. Perhaps, it is unambiguous to most folks.

How does it look like?


You can appreciate as to how well it has documented. It has definition, arguments, returns neatly documented.

Now what does the Google style docstring looks like when pasted into Notepad, Surprise!

==========

str1 = "Hello"

str2 = " World!"

result = str1 + str2

print(result)  # Output: Hello World!

=====================

Well, Google-style docstrings are not simple text. They are a specific format used to document code in a structured way.

Notepad, as a basic text editor, cannot interpret this format. It simply displays the raw text.

While Notepad may not display the Google Style Docstring(GSD), there are other software

that can:

  • Visual Studio Code: A versatile code editor with excellent support for Python.


  • Atom: A customizable text editor with a focus on simplicity and extensibility.


  • Sublime Text: A powerful text editor with a wide range of plugins for various programming languages.


What is the use of this new rendering of the code and its documentation?

Here are some reasons why it's worth the effort:

  • Enhanced Code Clarity:

Clear and concise docstrings make it easier for others (and future you) to understand the code's intent and usage. Consistent formatting improves code readability and reduces cognitive load.

  • Improved Collaboration:

  • Sharing code with the team:

A shared style guide ensures that all team members are on the same page, leading to smoother collaboration and fewer misunderstandings.

  • Facilitated Code Review:

Clear docstrings make it easier for reviewers to understand the code's logic and identify potential issues.

  • Automated Documentation Generation:

Tools like Sphinx can automatically generate professional-looking documentation from well-formatted docstrings.


 


Tuesday, June 8, 2021

Which of Microsoft's SQL Tools provide a Graphical User Interface?

Some people like GUIs more than scripting languages. They can still manage to work with SQL Servers.

Databases reside in the database servers. These servers may reside on your laptops, computers running with various operating systems such as Windows, Linux, and macOS. These servers may run in the cloud such as Azure. The tools, however, may not reside on the same platforms but allows you to connect to the various above-mentioned servers.

In brief, the tools are the following:

1. Azure Data Studio uses the operating systems, Windows, macOS, and Linux

This tool can run on-demand queries and save data as text, JSON, or Exel. It has a lightweight editor

2. SQL Server Management Studio (SSMS)

It is a full-featured GUI as well as it can run TSQL statements. It has tons of features.

It is a one-stop database management tool.

It can connect to the cloud, Azure SQL Database, Azure Synapse Analytics, etc.

Developers and DBMs of all skill levels can use this tool.


3. SQL Server Data Tools(SSDT) 

Using this you can build relational databases, Azure SQL databases, Analytical services, integration services, reporting services, etc

4. Visual Studio Code

Using the "mssql extension" for Visual Studio Code you can connect to SQL Servers

You can do scripting with a lightweight editor after connecting to SQL Server in Visual Studio.

You can find extensive references to complete articles on the following sister blogs:

http://hodentek.blogspot.com

http://hodentekMSSS.blogspot.com

More on GUI tools here:

https://docs.microsoft.com/en-us/sql/tools/overview-sql-tools?view=sql-server-ver15