|
Eddy Vluggen wrote: A decent C# class uses less characters to convey the same info as written in Object Pascal. Less characters to convey the same info - do you really need a "begin" and an "end" block?
If you are looking for terseness, go APL.
On a more moderate scale: What is really the purpose of those parentheses around if conditions, while conditions and for loop specification? Pascal can make due without them. Why do you have to double up the equals sign? Pascal can make due without that. Why do you have to double up all logical operators? The answer: Because the language "designers" didn't have a clue about language design.
Why do you have this ugly try-catch mess? In Chill, any statement may include an exception handler before its closing semicolon; it doesn't have to be pre-announced. The presence of an ON clause implies exception handling; you don't need to pre-announce it.
Why do you have to explicitly declare that "this is the end of the handling of this alternative", when the specification of the next alternative follows immediately? In Pascal you don't.
Why do you have to enclose exception handling in braces? The braces must , unconditionally, be there, but Chill makes due without them. A general rule in Pascal and its derivatives is that {...} is a block, and a simple statement is a block, so wherever a block is called for, a simple statement can be used.
Why to you have to include the body of a switch statement in braces, creating two nesting levels (the second one is each of the alternatives) when there logically is only one?
etc. etc.
Terseness is to remove from the language selected keywords and markers on your private hate list. The keywords/markers on someone else's hate list that is not on yours, you might fiercely defend as a way to improve readability, provide redundance to catch errors etc etc. Very few people really sat down to "tersify" a language specification, removing ALL unneccessary blurb; they use terseness as an argument to defend their own hate list.
|
|
|
|
|
Let's see.. there must be a relevant XKDC... oh, yeah, this'll do: http://xkcd.com/927/[^]
Such language should not be English-centric like most of today's languages; rather each developer should be able to view and edit the code in his own chosen language. (And formatted as the individual likes as well.)
In fact, I think a new language should be XML-based with the IDE applying styling and such as specified by the user.
Of course, I would never use such a language, I'd stick with good old C#.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Algol-67 was defined in terms of abstract syntax elements that could be represented using any suitable set of concrete symbols. I never saw much Algol-67 source code, but most of what I have seen used German keywords.
(Algol-67 never caugth on - it was way ahead of its time. Even today, 47 years later, it would definitely be descibed as a very advanced language. I haven't looked at the specification for a while, but I am sure that some of its useful features are still missing from today's languages.)
Maybe it was Algol-67 that inspired us when we as students made a Norwegian version of Pascal. It really was a simple word replacement program replacing MEDAN with WITH, BYRJ with BEGIN and STOGG with END (those who know Norwegian will see that we chose the dialect-based Norwegian variant), writing it to a temporary file and invoking the standard compiler on that temporary one. It worked perfectly as long as you in you user defined symbols stayed away from both the Norwegian and English reserved words.
|
|
|
|
|
Sounds like you really just want a compiler to be more helpful with errors. Tools like Resharper help with this in Visual Studio!
Hogan
|
|
|
|
|
(Not everyone uses Visual Studio.)
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
If it was easy, everybody could it it!
But on a more serious note, not using Visual Studio is a choice... For the hourly costs of developers (at least in the US), its worth the money to equip people with the best tools to accomplish work.
And before going off on costs, there are free versions of VS.
Hogan
|
|
|
|
|
snorkie wrote: not using Visual Studio is a choice
Exactly.
snorkie wrote: the best tools
What's that got to do with Visual Studio?
Seriously, I use Visual Studio when I need to, but not when I don't. I have Ultimate at work and Express at home.
Use the right tool for the right job.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
snorkie wrote: If it was easy, everybody could it it!
Did Resharper help you fix that sentence? No? Then why didn't you use VS to write your posting?
On a more serious note:
1. VisualAssist beats Resharper and (Un)Intellisense on C++ coding (at least unmanaged C++ - no experience wrt managed C++/CLI).
2. I do miss quite a few official standard C++11 features that VS still doesn't support. And I hate to figure out the exact syntax on certain template constructs with virtually no documentation on how to do properly (or at all)! (E. g. defining a template friend function inside a class)
3.snorkie wrote: And before going off on costs, there are free versions of VS.
... which don't support Resharper (or any other plugins)
I do agree that VS is a great tool. But for some people it may not be the right one.
|
|
|
|
|
In a way, yes!
What I'm really driving at is more along the lines of psychologically helpful.
I read a study not that long ago that the average programmer is now producing 1.2 lines of code per man-day. I don't know if this correct or not, but it causes me to wonder "why?" and what could be done to change it.
So my question becomes: What can we do differently?
|
|
|
|
|
There is no one party at fault here...
On the employee side, there is personal responsibility. There needs to be a desire to be a better developer and to work hard.
On the employer side, they need to be more organized. I've heard and experienced issues with companies (mostly large ones) who hire people but don't utilize them anywhere near a person's capacity. I spent a few weeks waiting to get access to systems and be assigned work to do. I left because the job was not fulfilling.
From my perspective, I should strive to be better each day. Secondly, mentor people around me that don't know as much. That was the main way I got up to speed.
Hogan
|
|
|
|
|
Programming languages are not for sissies.
Veni, vidi, vici.
|
|
|
|
|
Didn't he say it was a BASH script? Isn't that Klingon?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
At most he was.
Veni, vidi, vici.
|
|
|
|
|
20 years of programming in Cobol, C++, and html
The language that meets your requirements is Visual Basic 2013.
Everything that C++ can do Visual Basic 2013 can do.
Here is an example of code, with no documentation, lets see if you can figure out what it does.
Public Interface iArray(Of someType)
Event ItemAdded(ByRef Item As someType)
Sub AddRange(Range() As someType)
Function Clear() As someType()
Property Collected() As someType()
Function Count() As Int64
Property Item(Index As Int64) As someType
WriteOnly Property NewItem() As someType
WriteOnly Property NewItems As someType()
Property Populated As Boolean
Function LastIndex() As Int64
End Interface
<Serializable>
Partial Public Class Array(Of SomeType)
Implements iArray(Of SomeType)
Private mCollected() As SomeType
Private mPopulated As Boolean
Public Event ItemAdded(ByRef Item As SomeType) Implements iArray(Of SomeType).ItemAdded
Public Property Collected() As SomeType() Implements iArray(Of SomeType).Collected
Get
If mCollected Is Nothing Then mCollected = New SomeType() {}
Return mCollected
End Get
Set(value As SomeType())
mCollected = value
End Set
End Property
Public Sub AddRange(Range() As SomeType) Implements iArray(Of SomeType).AddRange
Allocate(Collected, Range)
Populated = True
End Sub
Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Value As SomeType) As SomeType()
Return Allocate(TheArray, Value, LastIndexOf(TheArray))
End Function
Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Values() As SomeType) As SomeType()
Return Allocate(TheArray, Values, LastIndexOf(TheArray))
End Function
Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Values() As SomeType, ByRef Index As Int64) As SomeType()
Try
For Current As Int64 = 0 To Values.Length - 1
Allocate(TheArray, Values(Current), Index + Current)
Next
Catch
End Try
Return TheArray
End Function
Public Shared Function Allocate(ByRef TheArray() As SomeType, ByVal Value As SomeType, ByRef Index As Int64) As SomeType()
Try
TheArray(Index) = Value
Catch
ReDim Preserve TheArray(Index)
TheArray(Index) = Value
End Try
Return TheArray
End Function
Public Property Item(Index As Int64) As SomeType Implements iArray(Of SomeType).Item
Get
Return Collected(Index)
End Get
Set(value As SomeType)
Allocate(Collected, value, Index)
Populated = True
End Set
End Property
Public Function Clear() As SomeType() Implements iArray(Of SomeType).Clear
Clear = Clear(Collected)
Populated = True
End Function
Public Shared Function Clear(ByRef TheArray() As SomeType) As SomeType()
TheArray = Nothing
Return TheArray
End Function
Public Function Count() As Long Implements iArray(Of SomeType).Count
Return Collected.Length
End Function
Public Overridable WriteOnly Property NewItem() As SomeType Implements iArray(Of SomeType).NewItem
Set(value As SomeType)
Allocate(Collected, value)
Populated = True
End Set
End Property
Public WriteOnly Property NewItems As SomeType() Implements iArray(Of SomeType).NewItems
Set(values As SomeType())
Try
For Each value As SomeType In values
NewItem = value
Next
Catch
End Try
End Set
End Property
Public Property Populated As Boolean Implements iArray(Of SomeType).Populated
Get
Return mPopulated
End Get
Set(value As Boolean)
mPopulated = value
End Set
End Property
Public Function LastIndex() As Int64 Implements iArray(Of SomeType).LastIndex
Return LastIndexOf(Collected)
End Function
Public Shared Function LastIndexOf(TheArray() As SomeType) As Int64
Try
Return TheArray.Length
Catch
Return 0
End Try
End Function
End Class
|
|
|
|
|
It does create a maintenance hell
Seriously though: you can write undocumented code in any language. And it is never a good idea!
|
|
|
|
|
All of my code is self documenting enough that maintenance well never happens because it was written clear and concise to begin with.
|
|
|
|
|
Just joking - I do concede that it's remarkably well structured for a BASIC program. Bonus points for using declarative variable names!
But don't expect me to have a look and understand what it really does - I'm sure I could do it, but I've never programmed in VB and don't intend to start now
|
|
|
|
|
It simplifies the use of arrays to be allowed to be controlled more like collections without the overhead.
That is a self contained module of a 4000 line program.
No basic program here.
|
|
|
|
|
Colborne_Greg wrote: All of my code is self documenting enough that maintenance well never happens because it was written clear and concise to begin with.
Okay, here's my challenge: Find the error(s) in your above statement.
|
|
|
|
|
I failed English,
I started programming before I started highschool, its like I think in code, then have to translate to English
|
|
|
|
|
Not to be a smart-a$$, but if you failed English, how can I as a user/buyer/customer/manager of your software be reasonably assured that you understood the requirements well-enough to implement them accurately?
|
|
|
|
|
I've only met one project managers, one client, and two senior developers capable of giving concise requirements.
If a client say "this needs to be for each item", when really they mean "this needs to be shared by all items", then no understanding of English will help. Only an understanding on the clients business will help, that way you can understand what they mean even though it's not what they said.
|
|
|
|
|
As a owner of two companies I don't see your point, and if I was stupid enough not to have someone go over my work before trying to sell an app well it wont make money will it.
Grade 12 math ability in grade 2... English is for communications, it means nothing to the end result, unless English is the only way possible for you to understand something, then I would be worried more about you.
|
|
|
|
|
Colborne_Greg wrote: Here is an example of code, with no documentation, lets see if you can figure out what it does.
The fallacy in that statement is that it presumes that the reader only needs to know what the code does.
However to maintain code one also needs to know 'why' code is doing what it it does. For example, in your code example 'why' is "Nothing" acceptable? Is the caller expecting that as a valid condition or is the caller going to error on that? Or perhaps it is up to the caller to decide that themselves?
Additionally how does that work for a caller who wants to use the code but does not care how it is implemented? Where is the contract for the code defined? How can the caller be sure that even if the implementation changes that the contract will not? How will the maintainer be sure that they can make a modification to that code without breaking that code?
|
|
|
|
|
In generic programming there is no why.
As a programmer of 25 years, we in the field usually did not comment code or even tried to make the code readable, job security...
That is retired code, otherwise I would not allow anyone else to see my work, as the concepts are experimental and solve just about every problem known in computing.
Also if a programmer I hire creates a piece of code that was not well thought out in the first place, and it comes down to that code needing to be maintained that person is gone. Then I go over the code myself and make it generic to last the ages. See I believe that if you can't understand code just by reading it, you need more experience, the readability should just be what gets the job done faster.
|
|
|
|