|
I don't care so much about the language as everything else. When Java first came out, I finally had a system to write graphical desktop applications on different systems without a ton of BS. Sure people joked about AWT being "write once, debug everywhere", but compared to everything else it was light years ahead. I had libraries that actually worked - on average, I could not compile a C library, so who knows if it did what I wanted or not. I had really simple database access, network access, all the stuff I had wanted and couldn't seem to get. I was like a kid in a candy store.
This is the problem with C - not the language, but the lack of something akin to the JSR process, where standard libraries for all sorts of useful things are created. I'd be the first guy to say that Java programmers love to go overboard and make a Rube Goldberg library for everything with 59 layers of abstraction, whereas C programmers tend towards minimal libraries that do just what's needed and no more. But then those C programmers love macros and other things that make the code hard to understand, and they need systems like autoconf and ports trees to actually get their libraries to even compile on different platforms. Six of one, half dozen of the other.
So I still love Java for all it provides. The language is overly complicated, and generics are by far the singular worst - and completely unnecessary - feature. When I saw all these new script languages cropping up, I thought, well what about the library for database access, for generating spreadsheets, PDFs, reports, images, etc? I failed to see why I'd want to switch to something shiny and new that is clearly less capable just because the language was simpler.
Years later, I see people moving back to Java because they had scalability problems, or problems like this author described with something fundamentally wrong buried deep in the guts of the system. And I still don't see much in the way of database libraries and other things.
I have a chuckle when I read about such things. The more things change, the more they stay the same. I'm sure there are other languages that have a great set of libraries for useful stuff, I'm sure .Net can likely do a lot of the things I need. But would I be any better off with another language? I don't think so. And I can use other languages through the ScriptManager anyway, while retaining access to all the libraries Java offers.
|
|
|
|
|
I think my favorite quotation about C is, "C is memory with syntactic sugar."
AFAIK it is original to Dennis Kubes and first appears here: http://denniskubes.com/2013/04/23/how-to-think-about-variables-in-c/[^]
The nice thing about C is you can almost always do whatever it is you want to do in C. The downside is, you can almost always do whatever it is you want to do an order of magnitude more easily in something else, even if that "something else" is C++. Nevertheless, that "something else" is almost universally just an interface, in some form or fashion, to C or C++ code.
|
|
|
|
|
C is a weakly hyped language.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
|
|
|
|
|
https://mail.python.org/pipermail/python-list/2002-November/141486.html
|
|
|
|
|
Let's start with this.
Name any other language other than C.
But there's a catch: the language's primary implementation must not currently be in C. So Java, JavaScript, Python don't qualify since they're canonical implementation is written in C.
Also, self-hosting doesn't count; in that case, it must not have been bootstrapped with C.
I'll start -- Pascal -- first version of Pascal was written in Fortran.
Next...
ken@kasajian.com / www.kasajian.com
|
|
|
|
|
Kenneth Kasajian wrote: Pascal
Aaaannnd... how do you work with very long strings? Very large structures*?
* Maybe only a problem with Turbo Pascal with its 64K per structure limit.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
With visual basic, actually most languages deal with strings better then C...
|
|
|
|
|
Better than Pascal I think you meant.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
No I mean it's a waste of time.
When you look at home long at takes to get a result and maintain that result visual basic wins every time.
|
|
|
|
|
I think I may not have been clear in my point because I don't understand what you're asking me.
I'm not saying Pascal is better than C or the other way around.
I'm saying Pascal is a language that was not originally written in C. It was written in Fortran, after which it was bootstrapped to be written in itself.
ken@kasajian.com / www.kasajian.com
|
|
|
|
|
It sure looks like you are proposing that Pascal is a better language than C, based on certain criteria. Pascal is indeed a very good language and I really liked it when I was using it in college, but I haven't used it since, and I can't even read/understand the code I have from that period.
Kenneth Kasajian wrote: Pascal is a language that was not originally written in C
Nor was C.
Kenneth Kasajian wrote: after which it was bootstrapped to be written in itself
As was C.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
No, you have completely missed the point of my message. Go back and re-read it.
What I am saying is that, a lot of people bash C but those same people don't realize that whatever language they prefer is probably written in C. So I challenged the readers to name a language that was not written in C.. because it's hard to do. Most new languages, VB, JavaScript, Python, Ruby all written in C.
However, there are languages not originally written in C, although they are old. Pascal is one, which is the one I mentioned to get the ball rolling.
You're being unnecessarily antagonistic without understanding, or taking the time to read, what I'm saying. I suggest you drop it.
ken@kasajian.com / www.kasajian.com
|
|
|
|
|
Sooo... your post is totally unrelated to Chris' prompt for discussion of languages that are or are not better than C. OK.
Kenneth Kasajian wrote: Go back and re-read it
I have read it many times, always in the context of the thread.
Kenneth Kasajian wrote: a lot of people bash C but those same people don't realize that whatever language they prefer is probably written in C
So what?
Kenneth Kasajian wrote: I challenged the readers to name a language that was not written in C
You could have made that clearer.
Kenneth Kasajian wrote: not originally written in C ... Pascal is one
Pascal pre-dates C slightly, it certainly pre-dates C's popularity. COBOL, Fortran, and BASIC also pre-date C.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Also to answer the more specific question, I don't think the language has anything to do with 64K limits, for strings, or otherwise. Those are all implementation details of specific compilers.
ken@kasajian.com / www.kasajian.com
|
|
|
|
|
Kenneth Kasajian wrote: implementation details of specific compilers
That may well be, but is it not part of the Pascal language spec that a string is limited to 255 characters because the length is stored in the first byte of the string?
I suppose not every implementation uses 8-bit characters, but it still imposes a definite limitation other than "available system resources".
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Okay, although it's true that one can implement Pascal differently, you're right that it's limited to 64K (or 32K) in length for strings.
But I really don't think that's a good example of Pascal's inferiority over C. There's advantages to counted-strings, and I've worked in environments where actually simulated Pascal strings in C for efficiency (i.e. you can easily get to the length). COM BSTRs use a similar structure, but store 32-bit lengths.
And the reason I don't think it's a limitation is because if you needed a string that long, C's null-terminated string is hardly preferable. You likely need a different data-structure (rope, array of strings) to do whatever you're doing anyway. Or, more likely, it's that big, it's probably a memory buffer that you'd manage using address and count.
As a reminder, my initial post was not stating Pascal is better than C. It was to point out that many of today's languages are written in C.
ken@kasajian.com / www.kasajian.com
|
|
|
|
|
Kenneth Kasajian wrote: I don't think it's a limitation
Perhaps you just don't find the limit to be a hindrance. I never had any trouble with it either, but I never had to use Pascal to do real-world development.
Just as .net strings are limited to 2GB -- it's a limit, but it hasn't yet been a hindrance.
Kenneth Kasajian wrote: C's null-terminated string is hardly preferable
They certainly have some disadvantages, but at least they're easy to work around.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Visual basic 2013.
It can utilize every C, C++, and C# library.
Plus it looks pretty.
For example the "with" operator is in Visual basic but is not in C.
|
|
|
|
|
Colborne_Greg wrote: the "with" operator
...is useless filth.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Which is more readable to everyone, and which uses less lines?
Public Shared Function RotateStream(stream As IsolatedStorageFileStream, angle As Int16) As WriteableBitmap
stream.Position = 0
Dim bitmap = New BitmapImage()
bitmap.SetSource(stream)
Dim WriteableBitmapSource = New WriteableBitmap(bitmap)
Dim WriteableBitmapTarget As WriteableBitmap
Dim Target As Int64
With WriteableBitmapSource
Select Case angle
Case 360 : Return WriteableBitmapSource
Case 180 : WriteableBitmapTarget = New WriteableBitmap(.PixelWidth, .PixelHeight)
Case Else : WriteableBitmapTarget = New WriteableBitmap(.PixelHeight, .PixelWidth)
End Select
For xAxis = 0 To .PixelWidth
For yAxis = 0 To .PixelHeight
Select Case angle
Case 90
Target = (.PixelWidth - yAxis - 1) + (xAxis * WriteableBitmapTarget.PixelHeight)
WriteableBitmapTarget.Pixels(Target) = .Pixels(xAxis + yAxis * .PixelWidth)
Case 180
Target = (.PixelWidth - xAxis - 1) + (.PixelHeight - yAxis - 1) * .PixelWidth
WriteableBitmapTarget.Pixels(Target) = .Pixels(xAxis + yAxis * .PixelWidth)
Case 270
Target = yAxis + (.PixelWidth - xAxis - 1) * WriteableBitmapTarget.PixelWidth
WriteableBitmapTarget.Pixels(Target) = .Pixels(xAxis + yAxis * .PixelWidth)
End Select
Next
Next
End With
Return WriteableBitmapTarget
End Function
versus without
public static WriteableBitmap RotateStream(IsolatedStorageFileStream stream, int angle)
{
stream.Position = 0;
if (angle % 90 != 0 || angle < 0) throw new ArgumentException();
int target;
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(stream);
WriteableBitmap wbSource = new WriteableBitmap(bitmap);
if (angle % 360 == 0) return wbSource;
WriteableBitmap wbTarget = null;
if (angle % 180 == 0)
{
wbTarget = new WriteableBitmap(wbSource.PixelWidth, wbSource.PixelHeight);
}
else
{
wbTarget = new WriteableBitmap(wbSource.PixelHeight, wbSource.PixelWidth);
}
for (int x = 0; x < wbSource.PixelWidth; x++)
{
for (int y = 0; y < wbSource.PixelHeight; y++)
{
switch (angle % 360)
{
case 90:
target = (wbSource.PixelHeight - y - 1) + x * wbTarget.PixelWidth;
wbTarget.Pixels[target] = wbSource.Pixels[x + y * wbSource.PixelWidth];
break;
case 180:
target = (wbSource.PixelWidth - x - 1) + (wbSource.PixelHeight - y - 1) * wbSource.PixelWidth;
wbTarget.Pixels[target] = wbSource.Pixels[x + y * wbSource.PixelWidth];
break;
case 270:
target = y + (wbSource.PixelWidth - x - 1) * wbTarget.PixelWidth;
wbTarget.Pixels[target] = wbSource.Pixels[x + y * wbSource.PixelWidth];
break;
}
}
}
return wbTarget;
}
Visual basic is better
|
|
|
|
|
OK, now use with to copy values between two instances.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
You can't think outside the box can you.
Usually I would do something like this to copy a class
Public function copy(byval ojbectName as objectType) as objectType
Return objectName
end function
There are many ways of getting values from one structure to another, not just with the use of methods. Lastly this points out that you should be utilizing different methods of programming to get a result instead of manually coding each line out.
|
|
|
|
|
Colborne_Greg wrote: to copy a class
Not copying everything; just some values.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
If you only want a few of the values use visual basic reflection.
|
|
|
|
|
reflection ???!!!
You'll never get very far if all you do is follow instructions.
|
|
|
|