DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Coding Topics

article thumbnail
Lambda Functions Help AI Developers Easily Create DataFrames in Python
One of the best ways to create more versatile machine learning applications in Python is to use lambda functions to create DataFrames.
August 17, 2022
by Ryan Kh
· 7,555 Views · 2 Likes
article thumbnail
ASP.NET Web Forms Modernization Series, Part 2: Business Logic Layer Considerations
In this second post of a series dedicated to ASP.NET Web Forms modernization, follow a discussion of data access layer considerations.
August 17, 2022
by Veli Pehlivanov
· 3,600 Views · 1 Like
article thumbnail
Step by Step Guide to Create Mule Custom Connector Using Java SDK
This tutorial guides you to create a custom connector for Mule 4 which includes both Source and Operation components.
Updated August 17, 2022
by Jitendra Rawat
· 4,574 Views · 2 Likes
article thumbnail
Docker Commands Beginners Should Know
This tutorial reviews basic Docker commands for a new user.
August 17, 2022
by Eric Goebelbecker DZone Core CORE
· 14,526 Views · 5 Likes
article thumbnail
Multi-tenancy Architecture With Shared Schema Strategy in Webapp Application Based on Spring-boot, Thymeleaf, and Posmulten-hibernate (Part 1)
One database to serve them all, one schema to bind them all.
August 16, 2022
by Szymon Tarnowski DZone Core CORE
· 7,619 Views · 2 Likes
article thumbnail
Java Thread Programming (Part 3)
Tip: We can only ask the Java thread to execute a piece of code, but we cannot guarantee the execution order of multiple threads!
August 16, 2022
by A N M Bazlur Rahman DZone Core CORE
· 7,002 Views · 6 Likes
article thumbnail
Integrate Oracle Database With Apache Kafka Using Debezium
Oracle Databases are used for traditional enterprise applications and departmental systems in large enterprises. Debezium connector for Oracle is a great way to capture data changes from the transactional system of record and make them available for application use.
August 16, 2022
by Hugo Guerrero DZone Core CORE
· 8,045 Views · 1 Like
article thumbnail
Understanding the Good and the Bad of .NET Development Framework
Many developers use .NET framework to create software applications. Here are some advantages and disadvantages of this framework you should know about.
August 16, 2022
by Huzaifa Khan
· 5,290 Views · 1 Like
article thumbnail
What to Know About Python and Why Its the Most Popular Today
Python is an incredibly versatile programming language that can be used for data science projects, data analysis, machine learning, and data visualization.
Updated August 16, 2022
by Aashutosh Kumar Yadav
· 8,945 Views · 4 Likes
article thumbnail
Top 10 Java Language Features
Let's explore ten Java programming features used frequently by developers in their day-to-day programming jobs.
August 15, 2022
by A N M Bazlur Rahman DZone Core CORE
· 9,435 Views · 14 Likes
article thumbnail
AWS CDK Project Blueprint - Modeling and Organizing (Part 2/2)
The second part of how to model, structure, and organize your Infrastructure-as-Code AWS CDK Project. Building from scratch until a CI/CD pipeline composition, all the cloud component resources, and services at AWS Cloud.
August 15, 2022
by Ualter Junior
· 5,920 Views · 2 Likes
article thumbnail
AWS CDK Project Blueprint - Modeling and Organizing (Part 1/2)
A sample of how to model, structure, and organize your Infrastructure-as-Code AWS CDK Project. Building from scratch until a CI/CD pipeline composition, all the cloud component resources, and services at AWS Cloud.
Updated August 15, 2022
by Ualter Junior
· 8,558 Views · 2 Likes
article thumbnail
On Cosmetics vs. Intrinsics in Programming
Code has cosmetic and intrinsic characteristics. See examples demonstrating how to achieve the same intrinsic with different cosmetics and vice versa.
August 15, 2022
by Nicolas Fränkel
· 4,184 Views · 2 Likes
article thumbnail
How To Build a Multi-Zone Java App in Days With Vaadin, YugabyteDB, and Heroku
Welcome to my journal documenting my experience building a geo-distributed app in Java from scratch. Here, I’ll share my first results and any challenges.
August 15, 2022
by Denis Magda DZone Core CORE
· 7,451 Views · 8 Likes
article thumbnail
What Is Pydantic?
Pydantic can be used with any Python-based framework and it supports native JSON encoding and decoding as well. Here, learn how simple it is to adopt Pydantic.
August 15, 2022
by Sameer Shukla DZone Core CORE
· 26,701 Views · 6 Likes
article thumbnail
How to Upgrade TiDB Safely
How to use this toolkit to test your upgrade process and how it helps you upgrade your TiDB with ease and happiness.
August 15, 2022
by Canyu Zhang
· 4,906 Views · 2 Likes
article thumbnail
MySQL's UTF-8 Isn't Real
In this blog, we will figure out why you should avoid using UTF-8 in MySQL and what to choose instead.
August 14, 2022
by Lukas Vileikis
· 7,072 Views · 3 Likes
article thumbnail
Brewing Patterns in Java: An Informal Primer
Thoughts on pattern matching, records, and sealing.
August 14, 2022
by Manoj N Palat
· 6,535 Views · 7 Likes
article thumbnail
What you must know about PHP errors to avoid scratching your forehead when something goes wrong
While pure object-oriented languages produce mainly exceptions to signal an error, PHP started out as procedural and so it has a wide range of errors that can be raised along with exceptions. Errors are Human, But We Must Identify Them There isn’t a programmer alive who hasn’t made errors when coding something at some point in their career. It is simply a part of the process, and it is important to recognize that we will all make these types of mistakes from time to time. That said, it is best to identify the errors as they occur so as to correct them at the moment. The faster that one can react to the errors that they are making, the better they will be able to correct those same errors and actually make a difference in the programming that they are doing. Put another way, it may be necessary to move rapidly to correct errors so that the project itself doesn’t get knocked off kilter at all. It is all up to you as to how you will move forward when you spot errors, but the best thing to do is remind yourself that this is expected and that you can do things to correct it. What is the difference between the two? Exceptions are objects which can be managed and caught with try/catch blocks. You can create your own exception classes, with custom arguments and methods. They really object with special additional functionalities and you should definitely manage your error with them in PHP 5 and higher. Errors are accompanied by a message like exceptions, but they are managed by calling an error handler function (which may be custom) from the point when they occur. PHP and its native functions generate mostly errors and not exceptions. PDO and the SPL are the exceptions (what a pun) since they have an object-oriented Api which also comprehends exception classes. Exceptions always bubble up until they are caught; errors are instead passed to the current error handler, whose job is to decide what to do with them. With non-severe errors, printing them in bold and going on with execution is the default behavior. Understanding exceptions and their usage is a key topic in transitioning to object-oriented PHP, but is out of the scope of this article. Here we will treat errors since you'll always have to deal with PHP native functions even if your code is so good it only throws exceptions to your custom hierarchy: when you omit a {, an error is generated, not an exception. When a file passed to include() is missing, again an error is generated, not an exception. Most of the time unhandled errors are the result of a programming error: if you get an error to be generated, probably something is already gone really wrong and you shouldn't ignore them. Translation into exceptions However, dealing with errors in an object-oriented way is very difficult: you can't catch them. Thus PHPUnit translates errors into exceptions by defining a custom error handler that throws PHPUnit_Frameworks_Error_Notice or PHPUnit_Framework_Error_Warning in case of manageable errors. PHPUnit will also signal you with an E in the test base in case of an error, while the F is reserved for particular exceptions that designate assertion failures. Nothing stops you from doing the same: by defining your error handler, you can translate the errors of missing files in include() into an exception you can catch. The question is: shall you? Often a missing file, when containing for example the source code of a class, will only result in a more serious error like a Fatl one when the script is allowed to continue. Main error types These are the main types of errors, which were present in the language before PHP 4. The majority of the time during development, you'll only see one of these four error types. E_NOTICE: a noncritical error, like accessing an initialized variable. PHP is very forgiving and will allow the script to continue in production environments. E_WARNING: a more serious error, like passing a non-Traversable to foreach(), or including a missing file. E_PARSE: a syntax error, like a missing } or using a reserved keyword for naming a class. The script won't run at all as these errors are raised at compile (to p codes) time. E_ERROR: also known as Fatal Errors, they are unrecoverable even by the error handler. Calling a method on null, or calling an undefined function, or creating an object of a non-existing class would result in a Fatal Error, which will terminate the script abruptly (even if it is a test suite!) There are many other types of errors, but they are rarer to encounter. The full list is in the PHP manual. From the list, some interesting special errors should be mentioned: E_STRICT: infringement of strict standards, which from PHP 5.3 it is in the default. If you call a non-static method statically (by Class::method()), you will get this error. Enabling strict standards can help you improve your code quality. E_RECOVERABLE_ERROR: a catchable version of Fatal Error, such as trying to convert an object without __toString() into a string. It can be managed by error handlers, while Fatal Errors and of course Parse Errors can't (they leave the interpreter in an unstable state and cause an immediate exit()). php.ini directives There are two directives that are very interesting for managing errors. The first is error_reporting, which prescribes reporting some types of errors while masking others. Typically this value varies between production environments (don't show anything to the end user as it won't understand anyway) and development environments (show me everything as I want to eliminate all errors before shipping.) In fact, in development, I always set error_reporting to E_ALL. Anything else is so '90s. display_errors has also to be set to On for the errors to be printed. When you get a blank page instead of the expected result, check this directive. PHP functions error_reporting() allows you to set which errors to report and override the error_reporting in php.ini, again by using E_ALL and other constants. Note that some errors, like E_PARSE, are detected at compile time and so won't be influenced by this function. set_error_handler() allows you to define your own function to manage errors, which can then delegate to PHP default handler or completely override it. Take-home points Errors are a tricky part of PHP, but knowing how to read them will speed up your development. In your code, always define exceptions, which are much more versatile, but be prepared to manage errors thrown by PHP itself. Most of the time, they're just programming errors like a typo in a variable name or a missing semicolon. However, you should know how to define custom error handlers in case you're forced to deal with runtime errors like a problem with a socket or a database connection.
Updated August 13, 2022
by Giorgio Sironi
· 20,163 Views · 1 Like
article thumbnail
Why "Polyglot Programming" or "Do It Yourself Programming Languages" or "Language Oriented Programming" sucks?
Last year we saw the launch of a new Web programming language Dart - Structured Web Programming from Google. A very interesting approach to support web application development. Not so long after Go, Groovy, Ruby, Scala, << Name your DSL here >>; we see Dart. Is it a good thing to have at least one programming language to solve one problem? The answer is, like we already know, it depends. Stay Away From “Do it Yourself” It is your choice as to if you will try to do things yourself or allow the truly seasoned professionals to help out. Some decide that they are going to try to go it alone when they are programming something new, but this often ends up in a less than desirable place. It may even be more expensive than just hiring an expert who can help you get it programmed for you in the first place. Most people do not go it alone with the vast majority of important services in their life, so why should they ever attempt to do so when they are looking at how to create a website? It is best to avoid making this mistake, and just try to make some progress towards your goals by hiring people who truly know how to help you make the progress that you need to make. Some important backgrounds you should know about the multi-programming language paradigm are the following: 1. You can read Martin Fowler's article about language-oriented programming with language workbenches which enables you to write small programming languages easily. In this article I see everyone writing their small language, everywhere. In this concept, we see DSL (Domain Specific Language) as the future of our programming activities. Source: http://martinfowler.com/articles/languageWorkbench.html 2. Neal Ford talked about Polyglot Programming, combining multiple programming languages in application development. Later Mr. Fowler added this paradigm with Polyglot Persistence, using different types of databases within one application. Source: http://memeagora.blogspot.com/2006/12/polyglot-programming.html and http://martinfowler.com/bliki/PolyglotPersistence.html Since 2006 I already discussed and collected some experiences in multi programming language paradigm: 1. I remember a “hot” discussion in 2006 with Sebastian Meyen, chief editor of JavaMagazin Germany, also the biggest organizor of Java Conference JAX. We agreed to see the future of programming in a multi-language paradigm concept. I also said that all those languages will be based on Java VM. I also told him that one day SAP will move ABAP as a language that can be run within the Java VM, so just another language within the Java environment, with no two different personalities anymore. Today we see the beginning of this in the project called Caffeine ABAP. Source: https://cw.sdn.sap.com/cw/groups/caffeine 2. Also in 2006 I had a project in which we also used different kinds of languages and also created our own DSL: Java for the most implementation stuff UML for the design of the business objects. We generate a lot of things using the concept of MDA (Model Driven Architecture) Groovy for a lot of things, especially for writing unit tests Based on ANTLR we create our own DSL for some aspects of the application It was really exciting and we had some very good programmers in the project. The result was a very nice and flexible product, just as what we expected at the beginning of the project. Please read this article in the German language for more information: http://www.sigs.de/publications/os/2009/02/dewanto_egger_OS_02_09.pdf So after all those nice things about the multi-language paradigm, I told you, why does this suck at the end? Here are some reasons from my point of view: 1. As typical in application development the problem comes first in the maintenance phase after all the capable programmers leave the project. Did you, programming language creators ever try to teach a new programming language to a “normal”, 9 till 5 programmers? I’m not talking about 9 (am) till 9 (pm) programmers who love to learn new languages. It is definitely tough to be proficient in one programming language. This is comparable with the languages we speak every day. I’m not a native English speaker, so I’m quite sure that I made a lot of syntax and grammar errors in this article. It is possible to be able to speak three or four languages perfectly but this is an exception. 2. Did you ever try to maintain a big Struts web application with AJAX? Just try to add functionality and you will end up creating and editing a lot of files: Action and Form files, Struts XML configuration files, JavaScript files with JSON, and also HTML or JSP files. Can you imagine adding Groovy, Scala, and Dart additionally into that web app? The complexity of such a project is very high. 3. Creating a new programming language means that you also have to build the environment for it. Good IDE, good documentation, good community support, a clear roadmap, and backward compatibility are some points to be done. Groovy is a bad example of this. In the early version of this language, the editor for Eclipse was really bad. After a while, they improved the editor but they made a lot of basic changes in the language so your old groovy applications do not work anymore. You are punished if you update to the new version. This never happens to Java. You still can compile Java 1.1 applications with Java 6 compiler. 4. Before you are creating your own DSL with e.g. ANTLR ask those language Gurus first, how hard it is to maintain a programming language for the long term. Before you discuss with them don’t ever create your own DSL. Especially if you are working for SME (Small and Medium-sized Enterprise). With a small team and small budget, you will never ever maintain your own language decently. So in year 2012, six years after my support to Polyglot Programming, I hope to see following things happen: 1. One language for all aspects in one application is the best concept ever. I name this as “One for All Programming Language paradigm”. Just like we don’t use English as a technical language, German as a literate language, and Indonesian as a community language, to be able to communicate internationally with each other we just use English pragmatically for all aspects of our life. In Germany, you need to speak German in all aspects to be able to communicate with others. My best solution so far is Java + XML, that’s it, no more, no less. No mixing with Groovy, Dart, Ruby, Scala, <> in one application. Especially if you are working as a contractor, please don’t try to use all those languages just for a small Java web application. I don’t say that you should not use the other languages at all. The only thing which is important is not to mix those languages in one application. In SME you may also want to use just one programming language for all your applications. 2. Concept like GWT (Java to JavaScript compiler) or XMLC (XML compiler which compiles XML, HTML to Java classes) is great. You can work just in plain Java. Guice with all Java and no XML is also a great solution (I know that SpringFramework is also doing this with Annotations). Android is great because it uses Java as its application programming language. In conclusion, I can only hope to see more such pure and plain Java solutions in 2012!
August 13, 2022
by Lofi Dewanto
· 14,476 Views · 5 Likes
  • Previous
  • ...
  • 301
  • 302
  • 303
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×