C++20 - Tomato Soup https://www.wholetomato.com/blog Visual Assist Team Blog Thu, 11 Apr 2024 18:04:40 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.5 https://i0.wp.com/www.wholetomato.com/blog/wp-content/uploads/2020/05/cropped-wt-logo.jpg?fit=32%2C32&ssl=1 C++20 - Tomato Soup https://www.wholetomato.com/blog 32 32 227787260 Visual Assist 2023.6 release post https://www.wholetomato.com/blog/2023/11/28/va-2023-6-release/ https://www.wholetomato.com/blog/2023/11/28/va-2023-6-release/#respond Tue, 28 Nov 2023 06:58:29 +0000 https://blog.wholetomato.com/?p=3637 Visual Assist 2023.6 is here and is available to download! This release is filled to the brim with new functionality that improves upon your staple VA features and a new, convenient way to share source...

The post Visual Assist 2023.6 release post first appeared on Tomato Soup.

]]>
Visual Assist 2023.6 is here and is available to download! This release is filled to the brim with new functionality that improves upon your staple VA features and a new, convenient way to share source code with colleagues.

We also have a new code checker, support for two new C++ language features, and small but useful improvements to VA’s behavior. Read on further to get the complete details of the changes and improvements in this release, or download the release right away.

Share source code via email, GitHub, and more.

Starting from VA 2023.6, users can now highlight sections of code from the editor and open the Quick Actions and Refactoring (Shift + Alt + Q) menu, or right-click on the code and select the “Share with team member” option to instantly send code to other developers.

Select and share sections of code by highlighting it and using the Quick Actions
menu (Shift + Alt + Q).

Choose where and how you want to share your code. This new feature can work in conjunction with GitHub Gist and GitLab’s snippets feature, where you can instantly share and upload parts of your source code. You can also send your source code via email for more general-use purposes. 

Improvements to VA’s navigation features

This release provides a number of improvements and additional functionality to VA’s bread and butter navigation features, such as open file in solution and find symbol in solution.

  • Fuzzy search and uppercase search for opening files and searching symbols
    Fuzzy search is a technique used in searches and information retrieval to find approximate matches for a given query, accommodating variations like typos and misspellings. It employs string distance metrics to measure the similarity between strings.

    Visual Assist’s open file in solution and find symbol in solution will now employ this algorithm, so you can expect more results with fewer, less accurate search queries.

    Furthermore, besides fuzzy searching for inexact matches, VA will also match capital letters. If you have a class named MyClassName, searching for “mcn” would find it. It works similarly if you have a global variable named myGlobalVariable and type “mgv”. It is smart enough to count the lowercase “my” as if it were MyGlobalVariable leading to expected results.

    Enable fuzzy search and see smarter search results using approximate string matching.

     

     

  • Select all items in open file in solution (Ctrl + A)
    You can now select and highlight multiple files and open them simultaneously when using open file in solution. The usual shortcut Ctrl + A works.

    Select and open all files with the new select all shortcut.

Improved support for Braced Initialization Lists / Uniform initialization (C++ 11)

2023.6 also improves support for braced initialization of lists and/or uniform initialization. Brace initialization lists and uniform initialization provide a more consistent and flexible way to initialize objects in C++. 

These features  improve code readability and reduce the chances of certain types of errors. Visual Assist’s parser will recognize these lists and highlight and suggest auto corrections within them.

Improved support for constexpr, consteval and constinit  (C++ 20)

These features are related to compile-time evaluation and initialization. They have specific use cases and are used to enforce certain behaviors at compile time. If you haven’t been using these, here’s a quick breakdown:

  • constexpr used to indicate that a function or variable can be evaluated at compile time.
  • consteval a stricter version, ensuring that the function or expression is only evaluated at compile time and cannot be evaluated at runtime.
  • constinit is used to indicate that a variable must be initialized at compile time and, once initialized, its value cannot be changed during the program’s lifetime.

When using these features, Visual Assist will recognize what you are trying to accomplish such as refactoring commands mainly. Refactorings such as Create From Usage will now properly handle these keywords.

New code inspection for detecting “magic-numbers”

This new Clang-based code inspection checks for instances of magic numbers—or numeric literals that are used without any definition—that are advised against by many coding guidelines for readability sake.

Enable code inspections by navigating to Extensions ->> VAssistX ->> Code Inspection ->> Enable code inspections.  This specific code inspection is disabled by default because some users may be intentionally using it and are not interested in “fixing” it.

Then you can either click on detected issues underlined in blue, use the Quick Refactoring Menu (Shift + Alt + Q) while on the highlighted issue, to allow VA to do it for you. In this case, there is no automatic fix so it will prompt you to define a variable with that number as its value and use the variable instead. 

Protip: VA can help do that for you with the introduce variable feature. If you highlight the number, then use the Quick Actions menu and select Introduce Variable it will ask you for a name and pull the number out into a variable for you.

You can read more about the readability-magic-numbers code checker on Clang’s documentation

New move class feature

You can now move entire classes into different files with the new move class feature included in 2023.6. 

For example, if you have a class named MyClass, with its declaration in MyClass.h and its definition in MyClass.cpp, you can move the entire class into a new pair of files, MyClassNew.h and MyClassNew.cpp. 

This is useful if you have a header and source file pair (.h and .cpp) that contain multiple classes and you want to break that up into multiple files.

Bug fixes and improvements

For this release, we have a couple of fixes based on user requests. The most notable of these improvements include a fix for file exclusion instructions using .json configs similar to a previous release, a parser improvement for Unreal Engine 5, and improved auto-detect logic for Unity.

  • Fixed multiple issues with file exclusion logic when reading from “.vscode\settings.json” configs.  
  • Our parser now better understands Unreal Engine 5.0 (specifically that build) types, such as FVector.
  • Fixed Create from Usage behavior when used inside const inline methods. 
  • Fixed coloring of [[fallthrough]] marked enum items. 
  • Attempted to fix rare temporary hang when debugging C# Unity projects.
  • Code Inspections options dialog now displays much more quickly. 
  • Improved Unity engine auto detect logic to reduce false positives.

Thanks to those who submitted their feedback and bug reports. Please continue sending them our way. Send us a message or start a thread on the user forums for bug reports or suggestions.

You can also check our download page to manually update to the latest release. Happy coding!

 

 

The post Visual Assist 2023.6 release post first appeared on Tomato Soup.

]]>
https://www.wholetomato.com/blog/2023/11/28/va-2023-6-release/feed/ 0 3637
Summer CodeFest: C++ coding camp hosted by Whole Tomato https://www.wholetomato.com/blog/2023/07/20/summer-codefest-c/ https://www.wholetomato.com/blog/2023/07/20/summer-codefest-c/#respond Thu, 20 Jul 2023 22:28:34 +0000 https://blog.wholetomato.com/?p=3268 CodeFest happened on August 17th, 2023. Registration is not available now. Stay tuned and find out when next CodeFest begins! Get ready to unwind with Whole Tomato at our first Summer C++ CodeFest! Join us...

The post Summer CodeFest: C++ coding camp hosted by Whole Tomato first appeared on Tomato Soup.

]]>
CodeFest happened on August 17th, 2023. Registration is not available now. Stay tuned and find out when next CodeFest begins!

Get ready to unwind with Whole Tomato at our first Summer C++ CodeFest! Join us for two weeks of laid-back learning, collaboration, and coding sessions. Expand your C++ coding skills and ignite your passion for coding in a join-when-you-can environment.

Why this virtual coding camp for?

C++ is one of the most established procedural and object-oriented programming languages but it has also undergone numerous revisions throughout its lifetime. What you may have learned from using prior versions as a wee developer in C++11 may have drastically changed in the most recent version of the C++ standard (C++20). 

But as C++ developers ourselves, we understand that keeping up with the ever changing standards may sometimes feel like an unnecessary chore—if what we’re using works, don’t fix it, right? 

And while it’s certainly cool to be using new stuff in itself, we feel that there are potential benefits from modern C++ that are extremely underutilized. Getting familiar with modern techniques and strategies such as lambdas, structured bindings, and the like can not only optimize performance, it can make our work much much faster and easier too!

This is why we are holding our first ever summer code fest! This is a two-week long event where in usual Tomato fashion, we present short, highly digestible sessions about specific practices you should know about and use in your everyday  C++ workflow. 

Who is this coding camp for?

Junior developers looking to expand their skill set with modern C++ practices and strategies, and intermediate C++ developers that are stuck in the old ways are all welcome to join. While we will be primarily using Visual Studio with some features provided by Visual Assist, anyone with a C++-capable IDE will be able to benefit.

What topics will be covered?

At the Summer CodeFest, we invite you to join our mini lectures on a variety of C++ topics, condensed into 30 to 45 minute sessions with additional time for audience Q&A. Some of our specialized topics will include concurrency structures, lambda functions, and C++ templates.  Here are other things you can expect to learn at our coding camp:

  • The most important developments from C++ 11 all the way to C++ 20.
  • Modern practices and strategies that you should be using regularly
  • Life hacks and expert advice from our professional C++ presenters

Event Schedule

The Summer CodeFest will have four sessions, each ranging from 30 to 45 minute presentations.

  • Session 1: Next-Level Concurrency: Enhancing Scalability with C++20

    with Chris Gardner
    Explore modern C++20 multithreading and powerful parallelism techniques. As programs get more complex, computers get equipped with even more CPU cores. Learn to optimize applications for peak performance with real-world examples and practical insights with C++20’s new concurrency features.
    August 8 – 10:00 AM CT

  • Session 2: What the Hex? Ports and Adapters Architecture with C++

    with Nuno Castro
    In this session, we’ll dive into Hexagonal architecture. Explore how to build scalable applications effectively and address challenges with logic changes when refactoring code and maintaining application integrity during logic changes.
    August 10 – 10:00 AM CT

  • Session 3: Modern C++ with Modern 3D

    with Yilmaz Yoru
    This is a journey to modern 3D with modern C++, we will walk you through to modern 3D in C++. Rotation matrix, vectors, Viewport3D, 3D objects, 3D engines, animation, and more.
    August 11 – 1:00 PM CT

  • Session 4: Lambdas go Baa!

    with David Millington
    Many C++ developers still use functor objects instead of lambdas. That might be because they’re “ol’ reliable”, or lambdas seem complex, or there just seems no need. But lambdas are exciting, simpler than you think, and really useful.
    August 15 – 10:00 AM CT

  • Session 5: Tips and Tricks using C++ Templates

    with Miguel Angel Moreno
    Discover the many ways you can take advantage of C++ templates in your day to day coding. Templates are a very useful feature of C++, yet many developers still think of them as “too complex” to use. In this presentation we will show you some tips and tricks that will encourage you to start using templates in your next coding project.
    August 16 – 11:00 AM CT

  • Session 6: Magnificent or Malevolent? Maps! Measured, Monitored, & Magnified

    with David Millington
    Good old std::map. We use it everywhere. But what about some of the others? Like std::unordered_map — why would you use that? And is it true that the STL collections have inbuilt performance issues by design? Are there are collection classes out there that we could use instead?
    August 17 – 10:00 AM CT

 

The Summer CodeFest will be made up of multiple sessions organized and presented by a number of C++ experts, with some of our friends in the industry guesting for some of the sessions. You can choose which of these sessions you want to watch. Replays will also be provided but we encourage everyone to attend live so we can answer your questions and demonstrate them live to you. All content will be in English unless otherwise indicated.

Joining is easy and free. Sign up using the individual registration links or click this all-in-one link to register and add all of the sessions to your calendar. 

The post Summer CodeFest: C++ coding camp hosted by Whole Tomato first appeared on Tomato Soup.

]]>
https://www.wholetomato.com/blog/2023/07/20/summer-codefest-c/feed/ 0 3268