For my link archive, as I will likely need this one day: [WayBack] GitHub – JensBorrisholt/GoogleSpeak: This repository demonstrates how to Use Google for implementing Text to Speech. You’ll find both a Delphi version and a C# version
–jeroen
Posted by jpluimers on 2020/04/15
For my link archive, as I will likely need this one day: [WayBack] GitHub – JensBorrisholt/GoogleSpeak: This repository demonstrates how to Use Google for implementing Text to Speech. You’ll find both a Delphi version and a C# version
–jeroen
Posted in .NET, C#, Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/02/26
This post is a reminder to myself that not all mappings from XSD to programming languages are possible.
There are many impossible cases, so this is just a general reminder.
A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBack] Using XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.
More generic examples from my answer to the above question:
I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…
–jeroen
Posted in C#, Delphi, Development, Java, Java Platform, Software Development, XML, XML/XSD, XSD | 2 Comments »
Posted by jpluimers on 2020/02/18
This is indeed an interesting live way to learn about C# even if you think you know most of it:
[WayBack] Scott Hanselman on Twitter: Learn C# in your browser, no install! Practice your .NET skills on an ChromeBook if you like! Your choice!
Here you go:
–jeroen
Posted in .NET, C#, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/01/23
Another blast from the past. I’ve been using many development environment all my live, so I have been using .NET very early on allowing me to make a good comparison: [WayBack] Delphi developer switching to C# – Stack Overflow.
I have a broad toolbox because we’ve never lived in a “silver bullet” era: any problem needs a combination of tools to solve them. Having a broad toolset allows you to pick and choose more easily. Mastering the different tools however requires a lot of effort and time. You really need to love this profession to put that energy in it.
I heavily use both for software development.
Development speed of server apps (web apps, web services, windows services) is much higher in .NET.
Development speed of business apps (pure Windows UI) is much higher in Delphi.
Development of sexy apps is a pain in both environments.
A few things you should know:
- Learning the .NET framework will take a lot of time: it is huge, but contains a lot of gizmos (some gems are really well hidden).
- Don’t lose yourself in following all new trends at once: generics, lambda, LINQ, each are nice, but grasping them all at once is only for a few of us
- For web apps, skip WebForms, but learn ASP.NET MVVC (yes, the Ruby guys were right after all); learn HTML 5 and JavaScript too.
- For sexy Windows apps, learn WPF, but be prepared for a steep learning curve (designer, and framework are radically different)
- Don’t get a too sexy UI: it costs you a disproportional amount of time while your users are waiting for functionality
- Like the market has been bashing Delphi since version 1, the market is bashing SilverLight too
- Skip WinForms; if you need something like WinForms, then Delphi is way more productive (even more so if you have an existing Delphi VCL codebase).
- WPF is just as thread-friendly as the VCL or WinForms (read: neither of the 3 is thread friendly)
- Don’t perform rewrites of your Delphi stuff in .NET (or for that matter any other 1:1 rewrite from platform A into platform B): it is a waste of your time.
- Threading and synchronization are a pain in all development environments. The pain is not so much in the general stuff (the Concurrent Collections in the .NET 4 framework helps, as do the Delphi OmniThreadLibrary), but in getting the final details and exception cases right is the real pain.
- Garbage collection does not mean that you won’t leak memory: it means that you won’t leak when your app terminates, but while it runs the leaks are way harder to detect (boy, I wish I had the FastMM memory monitor for .NET)
–jeroen
Posted in .NET, C#, Delphi, Development, Software Development | 3 Comments »
Posted by jpluimers on 2020/01/16
[WayBack] Mad With PowerShell: FileInfo and DirectoryInfo objects are not populated upon creation in PowerShell.
TL;DR:
FullName property, the other poprerties of FileInfo and DirectoryInfo are populated later than their instance creationRefresh method populates or re-populates themFullNameExample: see the [Archive.is]fileinfo.cs: Length property
–jeroen
Posted in .NET, C#, CommandLine, Development, F#, PowerShell, Software Development, VB.NET | Leave a Comment »
Posted by jpluimers on 2019/12/10
Every time I run into complex nested if/then/else statement in any language with truckloads of code blocks, it usually means it is time to refactor in two steps:
Of course this adds some overhead, but usually you end up with code that is easier to unit-test and understand both the overall structure and detailed implementations of.
I’m all for language enhancements that allow deeply nested logic to be more manageable (for instance by enhancing a case construct), but usually refactoring makes that less of a need and more of a nice to have.
Via: [WayBack] Anybody else have a gripe with nested if-then-else statements in Pascal? What if we had the following statement/syntax available in Pascal? … – Gerhard Venter – Google+
–jeroen
Posted in .NET, C#, Design Patterns, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2019/09/12
For my link archive.
Full text at: [WayBack] … why the Delphi language does not allow parameterless constructors… – David Heffernan – Google+
Abstract:
+Stefan Glienke deleted his post about parameterless record constructors, presumably due to all the off topic comments.
…
.net at CLR level does allow parameterless constructors on structs. But the C# language bans them: https://msdn.microsoft.com/en-us/library/saxz13w4.aspx
Jon Skeet posted an answer on SO way back in 2008 on this topic: http://stackoverflow.com/a/333840/ From that answer:
—-
The CLR allows value types to have parameterless constructors, but C# doesn’t. I believe this is because it would introduce an expectation that the constructor would be called when it wouldn’t. For instance, consider this:
MyStruct[] foo = new MyStruct[1000];…
—-My guess is that Embarcadero decided to ban parameterless constructors on Delphi records for the same reason. Or perhaps they just copied the rules from C# without realising that the CLR supported parameterless struct constructors.
References:
--jeroen
Posted in .NET, C#, Delphi, Development, Jon Skeet, Software Development | Tagged: 1029 | Leave a Comment »
Posted by jpluimers on 2019/07/16
Design Patterns and Refactoring articles and guides. Design Patterns video tutorials for newbies. Simple descriptions and full source code examples in Java, C++, C#, PHP and Delphi.
Source: [WayBack] Design Patterns & Refactoring.
And indeed a lot of examples in Delphi too; few sites have that: Delphi site:sourcemaking.com.
–jeroen
Via: [WayBack] I stumbled upon this yesterday, very informative, accessible and also with Delphi examples – among other languages. – Steffen Nyeland – Google+
Posted in .NET, C, C#, C++, Delphi, Design Patterns, Development, Java, Java Platform, PHP, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2019/06/12
For my archive: [WayBack/Archive] Cyclomatic Complexity of switch case statement – Stack Overflow.
Ultimate reference: [WayBack/Archive] NIST Special Publication 500-235: Structured Testing: A Testing Methodology Using the Cyclomatic Complexity Metric
Via: [WayBack/Archive] I have a question regarding Cyclometric Complexity… IF versus CASE… – David Hoyle – Google+
–jeroen
Posted in .NET, C#, Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2019/05/15
One more thing to take away from Procedural Programming: It’s Back? It Never Went Away – Kevlin Henney [ACCU 2018] – YouTube was explained in [WayBack] How to Design Early Returns in C++ (Based on Procedural Programming) – Fluent C++.
Though in C++, it applies to all programming languages that stem from a procedural background (Pascal, C#, Java, golang, to name just a few).
The article is about keeping an if/else-if/else tree, even when they can be removed becomes some of their bodies perform an early return, as
In C++, as well as in other languages, the
returnkeyword has two responsibilities:
- interrupting control flow,
- yielding a value.
It basically comes down to this argument:
Essentially, the argument for Code #1 is that you need to know less to understand the structure of the code.
Indeed, if we fold away the contents of the if statements, Code #1 becomes this:
1234567 bool isLeapYear(int year){if (year % 400) { ... }else if (year % 100) { ... }else if (year % 4) { ... }else { ... }}The structure of the code is very clear. There are 4 different paths based on the
year, they’re independent from each other, and each path will determine the boolean result of the function (if it doesn’t throw an exception).Now let’s see how Code #2 looks like when we fold away the if statements:
12345678 bool isLeapYear(int year){if (year % 400) { ... }if (year % 100) { ... }if (year % 4) { ... }return false;}And now we know much less. Do the if statements contain a
return? Maybe.Do they depend on each other? Potentially.
Do some of them rely on the last
return falseof the function? Can’t tell.With Code #2, you need to look inside of the if statement to understand the structure of the function. For that reason, Code #1 requires a reader to know less to understand the structure. It gives away information more easily than Code #2.
–jeroen
via [WayBack] Kevlin Henney – Google+: How to Design Early Returns in C++ (Based on Procedural Programming) – Fluent C++
Posted in .NET, C, C#, C++, Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »